Skip to content

Commit

Permalink
Merge pull request #669 from British-Oceanographic-Data-Centre/bug/za…
Browse files Browse the repository at this point in the history
…rr-notebooks

correct zarr installation on workflows
  • Loading branch information
soutobias authored Dec 11, 2023
2 parents f4bf9d4 + 8d84563 commit 4998416
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/markdown-general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: British-Oceanographic-Data-Centre/COAsT
ref: develop
ref: bug/zarr-notebooks
path: external

- name: Prepare environment
Expand All @@ -42,5 +42,7 @@ jobs:
sudo apt-get install -y libgeos-dev
pip install cartopy==0.21.0
pip install zarr
pip install xarray[complete]
pip install aiohttp requests
mv config ./example_scripts/notebook_tutorials/runnable_notebooks/general/config
bash notebook_to_md.sh general
1 change: 1 addition & 0 deletions .github/workflows/unit_test_contents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y libgeos-dev
pip install cartopy==0.21.0
pip install zarr
python unit_testing/generate_unit_test_contents.py
- name: Commit changes
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ jobs:
sudo apt-get update
sudo apt-get install -y libgeos-dev
pip install cartopy==0.21.0
pip install zarr
pytest tests
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"id": "761fde27-8ef4-4805-887c-d795da34902e",
"metadata": {},
"source": [
"`pip install zarr`"
"`pip install zarr xarray[complete] aiohttp requests`"
]
},
{
Expand Down Expand Up @@ -73,16 +73,26 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 1,
"id": "582e5ae5-e61d-409d-aa33-206f6ff3c0bd",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/mnt/code/.pyenv/versions/3.10.12/envs/coast-10/lib/python3.10/site-packages/utide/harmonics.py:16: RuntimeWarning: invalid value encountered in cast\n",
"/mnt/code/.pyenv/versions/3.10.12/envs/coast-10/lib/python3.10/site-packages/utide/harmonics.py:17: RuntimeWarning: invalid value encountered in cast\n"
]
}
],
"source": [
"import coast\n",
"import matplotlib.pyplot as plt\n",
"import datetime\n",
"import numpy as np\n",
"import xarray as xr\n",
"import zarr\n",
"\n",
"root = \"./\"\n",
"fn_config_t_grid = root + \"./config/example_nemo_monthly_climate.json\"\n",
Expand Down Expand Up @@ -114,10 +124,21 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 2,
"id": "289bbdfd-991c-41ed-9acd-7e9bb35f157c",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_221474/396929176.py:1: RuntimeWarning: Failed to open Zarr store with consolidated metadata, but successfully read with non-consolidated metadata. This is typically much slower for opening a dataset. To silence this warning, consider:\n",
"1. Consolidating metadata in this existing store with zarr.consolidate_metadata().\n",
"2. Explicitly setting consolidated=False, to avoid trying to read consolidate metadata, or\n",
"3. Explicitly setting consolidated=True, to raise an error in this case instead of falling back to try reading non-consolidated metadata.\n"
]
}
],
"source": [
"dom = xr.open_zarr(fn_nemo_dom_mask)\n",
"mesh_zgr = xr.open_zarr(fn_nemo_dom_mesh_zgr)\n",
Expand All @@ -126,7 +147,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 3,
"id": "e1f12c20-4076-4ae0-9135-c95218347805",
"metadata": {},
"outputs": [],
Expand All @@ -139,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 4,
"id": "50b2cbb7-a1ad-4ebc-aebb-42a1b8286e58",
"metadata": {},
"outputs": [],
Expand Down

0 comments on commit 4998416

Please sign in to comment.