From 7ea76055b7e1856ad3e5d255bfbc3724e6224db5 Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Wed, 10 Jul 2024 06:50:37 +0000 Subject: [PATCH] more examples --- pyproject.toml | 6 ++++++ tests/xarray/test_zarr.py | 32 +++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7c8328c8..ac27a52c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ dependencies = [ ] optional-dependencies.all = [ + "aiohttp", "boto3", "earthkit-data[mars]>=0.9", "earthkit-geo>=0.2", @@ -69,6 +70,7 @@ optional-dependencies.all = [ "kerchunk", "pyproj", "requests", + "s3fs", ] optional-dependencies.create = [ @@ -81,6 +83,7 @@ optional-dependencies.create = [ ] optional-dependencies.dev = [ + "aiohttp", "boto3", "earthkit-data[mars]>=0.9", "earthkit-geo>=0.2", @@ -94,6 +97,7 @@ optional-dependencies.dev = [ "pyproj", "pytest", "requests", + "s3fs", "sphinx", "sphinx-rtd-theme", ] @@ -106,8 +110,10 @@ optional-dependencies.docs = [ ] optional-dependencies.remote = [ + "aiohttp", "boto3", "requests", + "s3fs", ] optional-dependencies.tests = [ diff --git a/tests/xarray/test_zarr.py b/tests/xarray/test_zarr.py index 61cf8b4c..73f7c475 100644 --- a/tests/xarray/test_zarr.py +++ b/tests/xarray/test_zarr.py @@ -41,5 +41,35 @@ def test_weatherbench(): assert len(fs) == 2430240 +def test_dynamical(): + ds = xr.open_zarr("https://data.dynamical.org/noaa/gfs/analysis-hourly/latest.zarr") + fs = XarrayFieldList.from_xarray(ds) + print(len(fs)) + for i, f in enumerate(fs): + print(f) + if i > 10: + break + + +def test_coop_gfs(): + ds = xr.open_zarr("https://data.source.coop/aldenks/gfs-dynamical/analysis/v0.1.0.zarr") + fs = XarrayFieldList.from_xarray(ds) + print(len(fs)) + for i, f in enumerate(fs): + print(f) + if i > 10: + break + + +def test_coop_ifs(): + ds = xr.open_zarr("https://data.source.coop/aldenks/ifs-dynamical/analysis/v0.1.0.zarr") + fs = XarrayFieldList.from_xarray(ds) + print(len(fs)) + for i, f in enumerate(fs): + print(f) + if i > 10: + break + + if __name__ == "__main__": - test_weatherbench() + test_coop_ifs()