From fc1745f6d543ee81fc662b11ec33aa304b9e150b Mon Sep 17 00:00:00 2001 From: Javier Vegas-Regidor Date: Thu, 23 Jul 2020 13:45:47 +0200 Subject: [PATCH 1/3] Update version number --- VERSION | 2 +- doc/source/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 1545d966..d5c0c991 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.0 +3.5.1 diff --git a/doc/source/conf.py b/doc/source/conf.py index 17ef04e5..e939abc0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -65,7 +65,7 @@ copyright = u"2020, BSC-CNS Earth Sciences Department" # The short X.Y version. version = "3.5" # The full version, including alpha/beta/rc tags. -release = "3.5.0" +release = "3.5.1" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- GitLab From 134866978bc449e8d3ae8c6a463edc8a43271ab3 Mon Sep 17 00:00:00 2001 From: Javier Vegas-Regidor Date: Thu, 23 Jul 2020 13:49:36 +0200 Subject: [PATCH 2/3] Force diagonals >= 0.3.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4fab770a..6ce49394 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ REQUIREMENTS = { "cdo>=1.3.4", "cfgrib", "dask[array]", - "diagonals>=0.3", + "diagonals>=0.3.1", "netCDF4", "nco>=0.0.3", "numba", -- GitLab From 0f875683129161376cff30a3f8dfc4a3c5615ad1 Mon Sep 17 00:00:00 2001 From: sloosvel Date: Thu, 23 Jul 2020 14:14:43 +0200 Subject: [PATCH 3/3] Use masked array routines --- earthdiagnostics/ocean/regionmean.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/earthdiagnostics/ocean/regionmean.py b/earthdiagnostics/ocean/regionmean.py index b1a48300..c3850228 100644 --- a/earthdiagnostics/ocean/regionmean.py +++ b/earthdiagnostics/ocean/regionmean.py @@ -216,6 +216,20 @@ class RegionMean(Diagnostic): ) e3 = e3.extract(depth_constraint) data = data.extract(depth_constraint) + if self.box.min_depth is -1 and self.box.max_depth is not -1: + self.box.min_depth = 0 + depth_constraint = iris.Constraint( + depth=lambda c: self.box.min_depth <= c <= self.box.max_depth + ) + e3 = e3.extract(depth_constraint) + data = data.extract(depth_constraint) + if self.box.min_depth is not -1 and self.box.max_depth is -1: + self.box.max_depth = 6000 + depth_constraint = iris.Constraint( + depth=lambda c: self.box.min_depth <= c <= self.box.max_depth + ) + e3 = e3.extract(depth_constraint) + data = data.extract(depth_constraint) volcello = areacello * e3.data.astype(np.float32) mean = regmean.compute_regmean_3d(data.data, masks, volcello) self._save_result_2d("mean", mean, data) -- GitLab