Skip to content

Commit

Permalink
Upgrade to JupyterLab
Browse files Browse the repository at this point in the history
  • Loading branch information
liamtoney committed Sep 13, 2023
1 parent 6bc80c3 commit b9850da
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/)
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ channels:
- defaults
dependencies:
- colorcet
- ipympl
- ipywidgets
- jupyterlab
- matplotlib
- notebook
- numba
- pip
- pygmt
Expand Down
4 changes: 2 additions & 2 deletions notebooks/example_paths.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand All @@ -61,7 +61,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "55872b4014b9456d98adf40c01da8a32",
"model_id": "1077cfe376b94f5b933f720160192d2f",
"version_major": 2,
"version_minor": 0
},
Expand Down
15 changes: 5 additions & 10 deletions notebooks/example_paths_grid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2cdeee055cf64051bd85a3500ef2679e",
"model_id": "b82169e71bc1458899b96ae8beecd328",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -54,7 +54,7 @@
"text": [
"Done\n",
"\n",
"Elapsed time = 8 s\n"
"Elapsed time = 7 s\n"
]
}
],
Expand Down Expand Up @@ -91,7 +91,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5bb8b57a302a402c9e2e0f5f74e3c443",
"model_id": "56b0e35c1c794c908bff419b09ff1e1a",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/example_paths_grid_geotiff.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2c0aa7bfbc5c4dfb8e97213b31765d4a",
"model_id": "fd6d39ea7c7d41b5a27b8c9b26b6ec58",
"version_major": 2,
"version_minor": 0
},
Expand Down

0 comments on commit b9850da

Please sign in to comment.