Skip to content

Commit 6f2cdf4

Browse files
committed
updates to example notebooks for latest client code
1 parent a03a9b2 commit 6f2cdf4

7 files changed

+83
-108
lines changed

examples/Grand_mesa_ATL03_classification.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
],
275275
"metadata": {
276276
"kernelspec": {
277-
"display_name": "Python 3",
277+
"display_name": "Python 3 (ipykernel)",
278278
"language": "python",
279279
"name": "python3"
280280
},
@@ -288,7 +288,7 @@
288288
"name": "python",
289289
"nbconvert_exporter": "python",
290290
"pygments_lexer": "ipython3",
291-
"version": "3.8.10"
291+
"version": "3.8.13"
292292
}
293293
},
294294
"nbformat": 4,

examples/api_widgets_demo.ipynb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@
306306
"### Create plots for a single track\n",
307307
"- cycles: Will plot all available cycles of data returned by SlideRule for a single RGT and ground track\n",
308308
"- scatter: Will plot data returned by SlideRule for a single RGT, ground track and cycle\n",
309+
"- (to select a track from the leaflet plot above, click on one of the plotted elevations and the RGT and Cycle will automatically get populated below)\n",
309310
"\n",
310311
"The cycles plots should only be used in regions with [repeat Reference Ground Track (RGT) pointing](https://icesat-2.gsfc.nasa.gov/science/specs)"
311312
]
@@ -437,14 +438,21 @@
437438
"SRwidgets.set_values(parms)\n",
438439
"m.add_region(regions)"
439440
]
441+
},
442+
{
443+
"cell_type": "code",
444+
"execution_count": null,
445+
"metadata": {},
446+
"outputs": [],
447+
"source": []
440448
}
441449
],
442450
"metadata": {
443451
"interpreter": {
444452
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
445453
},
446454
"kernelspec": {
447-
"display_name": "Python 3",
455+
"display_name": "Python 3 (ipykernel)",
448456
"language": "python",
449457
"name": "python3"
450458
},
@@ -458,7 +466,7 @@
458466
"name": "python",
459467
"nbconvert_exporter": "python",
460468
"pygments_lexer": "ipython3",
461-
"version": "3.8.10"
469+
"version": "3.8.13"
462470
}
463471
},
464472
"nbformat": 4,

examples/atl03_widgets_demo.ipynb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,14 +450,21 @@
450450
"SRwidgets.set_values(parms)\n",
451451
"m.add_region(regions)"
452452
]
453+
},
454+
{
455+
"cell_type": "code",
456+
"execution_count": null,
457+
"metadata": {},
458+
"outputs": [],
459+
"source": []
453460
}
454461
],
455462
"metadata": {
456463
"interpreter": {
457464
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
458465
},
459466
"kernelspec": {
460-
"display_name": "Python 3",
467+
"display_name": "Python 3 (ipykernel)",
461468
"language": "python",
462469
"name": "python3"
463470
},
@@ -471,7 +478,7 @@
471478
"name": "python",
472479
"nbconvert_exporter": "python",
473480
"pygments_lexer": "ipython3",
474-
"version": "3.8.10"
481+
"version": "3.8.13"
475482
}
476483
},
477484
"nbformat": 4,

examples/boulder_watershed_demo.ipynb

Lines changed: 7 additions & 32 deletions
Large diffs are not rendered by default.

examples/cmr_debug_regions.ipynb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
"print(\"Completed in {:.3f} seconds of wall-clock time\".format(perf_duration))\n",
288288
"print(\"Reference Ground Tracks: {}\".format(gdf[\"rgt\"].unique()))\n",
289289
"print(\"Cycles: {}\".format(gdf[\"cycle\"].unique()))\n",
290-
"print(\"Received {} elevations\".format(gdf.shape[0]))"
290+
"print(\"Received {} segments\".format(gdf.shape[0]))"
291291
]
292292
},
293293
{
@@ -315,14 +315,22 @@
315315
" style={'color': 'black', 'opacity':1, 'weight':0.1})\n",
316316
"m.map.add_layer(geodata)"
317317
]
318+
},
319+
{
320+
"cell_type": "code",
321+
"execution_count": null,
322+
"metadata": {},
323+
"outputs": [],
324+
"source": []
318325
}
319326
],
320327
"metadata": {
321328
"interpreter": {
322329
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
323330
},
324331
"kernelspec": {
325-
"display_name": "Python 3.8.10 64-bit",
332+
"display_name": "Python 3 (ipykernel)",
333+
"language": "python",
326334
"name": "python3"
327335
},
328336
"language_info": {
@@ -335,7 +343,7 @@
335343
"name": "python",
336344
"nbconvert_exporter": "python",
337345
"pygments_lexer": "ipython3",
338-
"version": "3.8.10"
346+
"version": "3.8.13"
339347
}
340348
},
341349
"nbformat": 4,

examples/single_track_demo.ipynb

Lines changed: 13 additions & 66 deletions
Large diffs are not rendered by default.

sliderule/sliderule.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def source (api, parm={}, stream=False, callbacks={}):
361361
362362
Returns
363363
-------
364-
bytearray
364+
dictionary
365365
response data
366366
367367
Examples
@@ -507,6 +507,36 @@ def set_rqst_timeout (timeout):
507507
else:
508508
raise FatalError('timeout must be a tuple (<connection timeout>, <read timeout>)')
509509

510+
#
511+
# UPDATE_AVAIABLE_SERVERS
512+
#
513+
def update_available_servers (desired_nodes=None):
514+
'''
515+
Manages the number of servers in the cluster.
516+
If the desired_nodes parameter is set, then a request is made to change the number of servers in the cluster to the number specified.
517+
In all cases, the number of nodes currently running in the cluster are returned - even if desired_nodes is set;
518+
subsequent calls to this function is needed to check when the current number of nodes matches the desired_nodes.
519+
520+
Parameters
521+
----------
522+
desired_nodes: int
523+
the desired number of nodes in the cluster
524+
525+
Returns
526+
-------
527+
int
528+
number of nodes currently in the cluster
529+
int
530+
number of nodes available for work in the cluster
531+
532+
Examples
533+
--------
534+
>>> import sliderule
535+
>>> num_servers, max_workers = sliderule.update_available_servers(10)
536+
'''
537+
# placeholder until functionality implemented
538+
return 7,7
539+
510540
#
511541
# AUTHENTICATE
512542
#

0 commit comments

Comments
 (0)