From c4ef4305e377d605ba58b35f734888526a327c1f Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:20:59 -0300 Subject: [PATCH 1/3] Improve exception handling in method to_iris - Realise data by creating placeholder variable '_' - Don't use CubeList for placeholder variable --- erddapy/erddapy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erddapy/erddapy.py b/erddapy/erddapy.py index ca1756da..96506956 100644 --- a/erddapy/erddapy.py +++ b/erddapy/erddapy.py @@ -386,7 +386,7 @@ def to_iris(self, **kw): try: cubes.realise_data() except ValueError: - iris.cube.CubeList([cube.data for cube in cubes]) + _ = [cube.data for cube in cubes] return cubes @functools.lru_cache(maxsize=None) From 29a59b380890cbcc8308edee9bd238b99ff6e316 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:55:09 -0300 Subject: [PATCH 2/3] Pin version of Iris - In environment.yaml, pin iris version as >=3.3.0 This prevents errors in the `to_iris` methods --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 31785115..68367936 100644 --- a/environment.yml +++ b/environment.yml @@ -5,7 +5,7 @@ dependencies: - python=3.9 - cartopy - erddapy - - iris + - iris>=3.3.0 - jupyter - pendulum>=2.0.1 - xarray From e65ce9f1cffa6dcf47501f293893e193dd3948eb Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Mon, 19 Sep 2022 14:06:40 -0300 Subject: [PATCH 3/3] Pin netCDF4 version - Pin older version of netCDF4 to avoid Unidata/netcdf4-python#1192 - See #268 for discussion --- environment.yml | 1 + requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 68367936..0c5d01a0 100644 --- a/environment.yml +++ b/environment.yml @@ -7,5 +7,6 @@ dependencies: - erddapy - iris>=3.3.0 - jupyter + - netcdf4<1.6.1 - pendulum>=2.0.1 - xarray diff --git a/requirements-dev.txt b/requirements-dev.txt index 04e42307..70317660 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -15,7 +15,7 @@ joblib jupyter mypy nbsphinx -netcdf4 +netcdf4<1.6.1 pendulum>=2.0.1 pooch pre-commit