From b9850da1741a51093e39bd3a85ef1481709dfa7d Mon Sep 17 00:00:00 2001 From: Liam Toney Date: Wed, 13 Sep 2023 14:43:43 -0800 Subject: [PATCH] Upgrade to JupyterLab --- README.md | 4 ++-- environment.yml | 3 ++- notebooks/example_paths.ipynb | 4 ++-- notebooks/example_paths_grid.ipynb | 15 +++++---------- notebooks/example_paths_grid_geotiff.ipynb | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 02d40e2..7f315e3 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Additionally, several interactive notebooks containing usage examples are included in [`notebooks`](notebooks). To open the notebooks, with your conda environment activated run ``` -jupyter notebook notebooks +jupyter lab notebooks ``` Alternatively, you can run these notebooks in your browser — without installing *infresnel* — by navigating to the project's @@ -86,7 +86,7 @@ To cite a previous version of *infresnel*, go to the *infresnel*'s dependencies are [colorcet](https://colorcet.holoviz.org/) (for perceptually accurate colormaps to use in the creation of GeoTIFF path length difference grids), [Matplotlib](https://matplotlib.org/) (for applying colormaps to GeoTIFFs and -for generally plotting results), [Jupyter Notebook](https://jupyter.org/) +for generally plotting results), [JupyterLab](https://jupyterlab.readthedocs.io/en/latest/) (for running the interactive `.ipynb` notebooks), [Numba](https://numba.pydata.org/) (for computational acceleration), [PyGMT](https://www.pygmt.org/latest/) (for simplified SRTM data downloading and caching), [rioxarray](https://corteva.github.io/rioxarray/stable/) diff --git a/environment.yml b/environment.yml index 208de95..8688743 100644 --- a/environment.yml +++ b/environment.yml @@ -4,9 +4,10 @@ channels: - defaults dependencies: - colorcet + - ipympl - ipywidgets + - jupyterlab - matplotlib - - notebook - numba - pip - pygmt diff --git a/notebooks/example_paths.ipynb b/notebooks/example_paths.ipynb index e319a90..06e7cb5 100644 --- a/notebooks/example_paths.ipynb +++ b/notebooks/example_paths.ipynb @@ -37,7 +37,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/var/folders/vr/y2n71p290zzgzbzp8xzl0ykw0000gn/T/ipykernel_50468/340186350.py:27: UserWarning: 51.5% of DEM is NaN!\n", + "/var/folders/vr/y2n71p290zzgzbzp8xzl0ykw0000gn/T/ipykernel_52117/1476543577.py:27: UserWarning: 51.5% of DEM is NaN!\n", " ds_list, dem = calculate_paths(\n" ] }, @@ -61,7 +61,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "55872b4014b9456d98adf40c01da8a32", + "model_id": "1077cfe376b94f5b933f720160192d2f", "version_major": 2, "version_minor": 0 }, diff --git a/notebooks/example_paths_grid.ipynb b/notebooks/example_paths_grid.ipynb index 41eef6a..99c0157 100644 --- a/notebooks/example_paths_grid.ipynb +++ b/notebooks/example_paths_grid.ipynb @@ -37,7 +37,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "2cdeee055cf64051bd85a3500ef2679e", + "model_id": "b82169e71bc1458899b96ae8beecd328", "version_major": 2, "version_minor": 0 }, @@ -54,7 +54,7 @@ "text": [ "Done\n", "\n", - "Elapsed time = 8 s\n" + "Elapsed time = 7 s\n" ] } ], @@ -91,7 +91,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "5bb8b57a302a402c9e2e0f5f74e3c443", + "model_id": "56b0e35c1c794c908bff419b09ff1e1a", "version_major": 2, "version_minor": 0 }, @@ -115,8 +115,6 @@ } ], "source": [ - "from getpass import getuser\n", - "\n", "import colorcet as cc\n", "import matplotlib\n", "import matplotlib.pyplot as plt\n", @@ -130,11 +128,8 @@ "utm_crs = CRS(path_length_differences.rio.crs)\n", "proj = Transformer.from_crs(utm_crs.geodetic_crs, utm_crs)\n", "\n", - "# Set up interactive Matplotlib (JupyterLab doesn't support this?)\n", - "if getuser() == 'jovyan': # We're on Binder (which uses JupyterLab)\n", - " %matplotlib inline\n", - "else:\n", - " %matplotlib widget\n", + "# Set up interactive Matplotlib\n", + "%matplotlib widget\n", "\n", "\n", "# Format coordinates and grid values nicely for interactive use\n", diff --git a/notebooks/example_paths_grid_geotiff.ipynb b/notebooks/example_paths_grid_geotiff.ipynb index 2e5920e..b05202e 100644 --- a/notebooks/example_paths_grid_geotiff.ipynb +++ b/notebooks/example_paths_grid_geotiff.ipynb @@ -39,7 +39,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "2c0aa7bfbc5c4dfb8e97213b31765d4a", + "model_id": "fd6d39ea7c7d41b5a27b8c9b26b6ec58", "version_major": 2, "version_minor": 0 },