Skip to content

Commit

Permalink
refactor: Apply new name in example notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley authored and ayenpure committed Aug 15, 2024
1 parent 4caea8b commit 31f78aa
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion examples/jupyter/advanced_pyvista_rendering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"plotter.open_gif(\"esgf.gif\")\n",
"\n",
"# Update T and write a frame for each updated position\n",
"# Pan3D Viewer showed that T ranges from Apr 01 2000 12:00 to May 30 2001 12:00, and it has 420 time steps\n",
"# GeoTrame showed that T ranges from Apr 01 2000 12:00 to May 30 2001 12:00, and it has 420 time steps\n",
"n_time_frames = 420\n",
"n_skip_frames = 1\n",
"for i in range(0, n_time_frames, n_skip_frames):\n",
Expand Down
9 changes: 5 additions & 4 deletions examples/jupyter/import_config_esgf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
"outputs": [],
"source": [
"config_path = '../example_config_esgf.json'\n",
"builder = DatasetBuilder(catalogs=['esgf'], viewer=True)\n",
"builder = DatasetBuilder(catalogs=['esgf'])\n",
"geotrame = builder.viewer\n",
"\n",
"builder.import_config(config_path)\n",
"\n",
"# Show viewer in cell output\n",
"await builder.viewer.ready\n",
"builder.viewer.ui\n"
"# Show GeoTrame in cell output\n",
"await geotrame.ready\n",
"geotrame.ui\n"
]
}
],
Expand Down
9 changes: 5 additions & 4 deletions examples/jupyter/import_config_pangeo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
"outputs": [],
"source": [
"config_path = '../example_config_pangeo.json'\n",
"builder = DatasetBuilder(catalogs=['pangeo'], viewer=True)\n",
"builder = DatasetBuilder(catalogs=['pangeo'])\n",
"geotrame = builder.viewer\n",
"\n",
"builder.import_config(config_path)\n",
"\n",
"# Show viewer in cell output\n",
"await builder.viewer.ready\n",
"builder.viewer.ui\n"
"# Show GeoTrame in cell output\n",
"await geotrame.ready\n",
"geotrame.ui\n"
]
}
],
Expand Down
9 changes: 5 additions & 4 deletions examples/jupyter/import_config_xarray.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
"outputs": [],
"source": [
"config_path = '../example_config_xarray.json'\n",
"builder = DatasetBuilder(viewer=True)\n",
"builder = DatasetBuilder()\n",
"geotrame = builder.viewer\n",
"\n",
"builder.import_config(config_path)\n",
"\n",
"# Show viewer in cell output\n",
"await builder.viewer.ready\n",
"builder.viewer.ui\n"
"# Show GeoTrame in cell output\n",
"await geotrame.ready\n",
"geotrame.ui\n"
]
}
],
Expand Down
7 changes: 4 additions & 3 deletions examples/jupyter/manual_config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"outputs": [],
"source": [
"builder = DatasetBuilder(dataset='../example_dataset.nc')\n",
"geotrame = builder.viewer\n",
"\n",
"builder.data_array_name = 'density'\n",
"builder.x = 'length'\n",
Expand All @@ -26,9 +27,9 @@
"builder.t = 'second'\n",
"builder.t_index = 2\n",
"\n",
"# Show viewer in cell output\n",
"await builder.viewer.ready\n",
"builder.viewer.ui"
"# Show GeoTrame in cell output\n",
"await geotrame.ready\n",
"geotrame.ui"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/jupyter/no_viewer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"metadata": {},
"outputs": [],
"source": [
"# If you cannot install & use Trame for the Dataset Viewer,\n",
"# If you cannot install trame and use GeoTrame,\n",
"# the Dataset Builder can be used alone to obtain data structures\n",
"# and a corresponding mesh for rendering with PyVista\n",
"\n",
Expand Down
11 changes: 6 additions & 5 deletions examples/jupyter/url_config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
" 't': 'time',\n",
" },\n",
" 'data_slices': {\n",
" 'lat': [-90, 90, 50],\n",
" 'lon': [-180, 180, 50]\n",
" 'lon': [1000, 6000, 20],\n",
" 'lat': [500, 3000, 20],\n",
" },\n",
"}\n",
"builder = DatasetBuilder()\n",
"geotrame = builder.viewer\n",
"builder.import_config(config)\n",
"\n",
"# Show viewer in cell output\n",
"await builder.viewer.ready\n",
"builder.viewer.ui"
"# Show GeoTrame in cell output\n",
"await geotrame.ready\n",
"geotrame.ui"
]
}
],
Expand Down
18 changes: 9 additions & 9 deletions examples/jupyter/viewer_state.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
"metadata": {},
"outputs": [],
"source": [
"# A Viewer can be instantiated without a Builder.\n",
"# GeoTrame can be instantiated without a Builder using the DatasetViewer class.\n",
"# The Builder will be created behind the scenes.\n",
"viewer = DatasetViewer()\n",
"geotrame = DatasetViewer()\n",
"\n",
"# Use Xarray example: Regional Arctic System Model\n",
"viewer.state.dataset_info = {\n",
"geotrame.state.dataset_info = {\n",
" 'source': 'xarray',\n",
" 'id': 'rasm',\n",
"}\n",
"\n",
"# Apply change, allow for auto array/coordinate selection\n",
"viewer.state.flush()\n",
"geotrame.state.flush()\n",
"\n",
"# Make additional state modifications\n",
"viewer.state.ui_main_drawer = False\n",
"viewer.state.ui_axis_drawer = True\n",
"viewer.state.ui_expanded_coordinates = ['time']\n",
"geotrame.state.ui_main_drawer = False\n",
"geotrame.state.ui_axis_drawer = True\n",
"geotrame.state.ui_expanded_coordinates = ['time']\n",
"\n",
"await viewer.ready\n",
"viewer.ui"
"await geotrame.ready\n",
"geotrame.ui"
]
}
],
Expand Down

0 comments on commit 31f78aa

Please sign in to comment.