Skip to content

Commit 5309a67

Browse files
committed
Fix JB2 in CI
1 parent d7c3c5f commit 5309a67

2 files changed

Lines changed: 35 additions & 25 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,30 @@ jobs:
1919
environment:
2020
name: github-pages
2121
url: ${{ steps.deployment.outputs.page_url }}
22+
defaults:
23+
run:
24+
shell: bash -leo pipefail {0}
2225
runs-on: ubuntu-latest
2326
steps:
2427
- uses: actions/checkout@v5
2528

2629
- name: Set up Pages
2730
uses: actions/configure-pages@v5
2831

29-
- name: Set up Python
32+
- name: Set up conda env
3033
uses: mamba-org/setup-micromamba@v2
3134
with:
3235
environment-file: environment.yml
3336
cache-environment: true
3437

38+
- name: Install JB2
39+
run: python -m pip install -U --pre "jupyter-book==2.*" --no-deps -v
40+
41+
- name: Execute the notebook
42+
run: jupyter nbconvert --to notebook --execute --inplace 03-viz.ipynb
43+
3544
- name: Build HTML
36-
run: jupyter-book build --html --execute --strict --ci
37-
shell: micromamba-shell {0}
45+
run: jupyter book build --html --strict --ci
3846

3947
- name: Upload artifact
4048
uses: actions/upload-pages-artifact@v4

03-viz.ipynb

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"title: Viz\n",
1616
"subtitle: Visualizing native-grid output in Python\n",
1717
"label: page:viz\n",
18+
"kernelspec:\n",
19+
" name: python3\n",
1820
"---"
1921
]
2022
},
@@ -742,28 +744,28 @@
742744
},
743745
"outputs": [],
744746
"source": [
745-
"from lonboard import Map, PolygonLayer\n",
746-
"from matplotlib.colors import Normalize\n",
747-
"\n",
748-
"gdf = (\n",
749-
" uxds[\"areaCell\"]\n",
750-
" .to_geodataframe(engine=\"geopandas\", periodic_elements=\"exclude\")\n",
751-
" .set_crs(\"EPSG:4326\")\n",
752-
")\n",
753-
"\n",
754-
"arr = gdf.areaCell\n",
755-
"cmap = plt.get_cmap(\"gnuplot_r\")\n",
756-
"norm = Normalize(vmin=arr.min(), vmax=arr.max())\n",
757-
"colors = (cmap(norm(arr)) * 255).astype(\"uint8\")\n",
758-
"\n",
759-
"layer = PolygonLayer.from_geopandas(\n",
760-
" gdf,\n",
761-
" get_fill_color=colors,\n",
762-
" get_line_color=[0, 100, 100, 150],\n",
763-
" line_width_min_pixels=1,\n",
764-
")\n",
765-
"m = Map(layer)\n",
766-
"m"
747+
"# from lonboard import Map, PolygonLayer\n",
748+
"# from matplotlib.colors import Normalize\n",
749+
"\n",
750+
"# gdf = (\n",
751+
"# uxds[\"areaCell\"]\n",
752+
"# .to_geodataframe(engine=\"geopandas\", periodic_elements=\"exclude\")\n",
753+
"# .set_crs(\"EPSG:4326\")\n",
754+
"# )\n",
755+
"\n",
756+
"# arr = gdf.areaCell\n",
757+
"# cmap = plt.get_cmap(\"gnuplot_r\")\n",
758+
"# norm = Normalize(vmin=arr.min(), vmax=arr.max())\n",
759+
"# colors = (cmap(norm(arr)) * 255).astype(\"uint8\")\n",
760+
"\n",
761+
"# layer = PolygonLayer.from_geopandas(\n",
762+
"# gdf,\n",
763+
"# get_fill_color=colors,\n",
764+
"# get_line_color=[0, 100, 100, 150],\n",
765+
"# line_width_min_pixels=1,\n",
766+
"# )\n",
767+
"# m = Map(layer)\n",
768+
"# m"
767769
]
768770
}
769771
],

0 commit comments

Comments
 (0)