From c30fa368c49e3b4f4943f85589f7f85b1a2b6cec Mon Sep 17 00:00:00 2001 From: Florian Pinault Date: Mon, 26 Feb 2024 10:47:26 +0000 Subject: [PATCH 1/4] qa --- tests/sources/test_constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sources/test_constants.py b/tests/sources/test_constants.py index 5f7161ed..f57b11f6 100644 --- a/tests/sources/test_constants.py +++ b/tests/sources/test_constants.py @@ -10,6 +10,7 @@ # import datetime + import numpy as np from climetlab import load_source From 057ee4c0635eabe3a5e699e50b665bc73a362377 Mon Sep 17 00:00:00 2001 From: Florian Pinault Date: Mon, 26 Feb 2024 10:51:20 +0000 Subject: [PATCH 2/4] clean test --- tests/sources/test_constants.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/sources/test_constants.py b/tests/sources/test_constants.py index f57b11f6..a617a811 100644 --- a/tests/sources/test_constants.py +++ b/tests/sources/test_constants.py @@ -93,19 +93,23 @@ def test_constant_3(): date = sample[0].datetime() date_plus_6h = date + datetime.timedelta(hours=6) - a = load_source("constants", sample, date=date_plus_6h, param="insolation") - b = load_source("constants", sample, date=date, param="insolation+6h") + a = load_source( + "constants", sample, date=date_plus_6h, param="cos_solar_zenith_angle" + ) + b = load_source("constants", sample, date=date, param="cos_solar_zenith_angle+6h") assert np.all(a.to_numpy() == b.to_numpy()) - assert a.unique_values("param")["param"] == ("insolation",) - assert b.unique_values("param")["param"] == ("insolation+6h",) + assert a[0].metadata("param") == "cos_solar_zenith_angle" + assert b[0].metadata("param") == "cos_solar_zenith_angle+6h" date = sample[0].datetime() date_minus_30d = date + datetime.timedelta(days=-30) - a = load_source("constants", sample, date=date_minus_30d, param="insolation") - b = load_source("constants", sample, date=date, param="insolation-30d") + a = load_source( + "constants", sample, date=date_minus_30d, param="cos_solar_zenith_angle" + ) + b = load_source("constants", sample, date=date, param="cos_solar_zenith_angle-30d") assert np.all(a.to_numpy() == b.to_numpy()) - assert a.unique_values("param")["param"] == ("insolation",) - assert b.unique_values("param")["param"] == ("insolation-30d",) + assert a[0].metadata("param") == "cos_solar_zenith_angle" + assert b[0].metadata("param") == "cos_solar_zenith_angle-30d" if __name__ == "__main__": From 6a30ae954995e1d3e0b456f2fe1b7d46ecf18bdf Mon Sep 17 00:00:00 2001 From: Florian Pinault Date: Mon, 26 Feb 2024 10:58:17 +0000 Subject: [PATCH 3/4] add dependency on earthkit-meteo --- setup.py | 1 + tests/sources/test_constants.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f9b9dee4..05f2939e 100644 --- a/setup.py +++ b/setup.py @@ -67,6 +67,7 @@ def read(fname): "cfgrib>=0.9.10.1", "cdsapi", "ecmwf-api-client>=1.6.1", + "earthkit-meteo", "multiurl>=0.1.0", "ecmwf-opendata>=0.1.2", "tqdm", diff --git a/tests/sources/test_constants.py b/tests/sources/test_constants.py index a617a811..4a2e00cd 100644 --- a/tests/sources/test_constants.py +++ b/tests/sources/test_constants.py @@ -36,7 +36,7 @@ def test_constant_1(): "cos_julian_day", "cos_local_time", "sin_julian_day", - "sin_local_time", + "cos_solar_zenith_angle", ] ds = load_source( @@ -71,7 +71,7 @@ def test_constant_2(): "cos_julian_day", "cos_local_time", "sin_julian_day", - "sin_local_time", + "cos_solar_zenith_angle", ] ntimes = 4 From 0320c5bbe5c9f58433140d38b8308d1c90458227 Mon Sep 17 00:00:00 2001 From: Florian Pinault Date: Mon, 26 Feb 2024 10:59:27 +0000 Subject: [PATCH 4/4] Bump version 0.21.2 --- climetlab/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/climetlab/version b/climetlab/version index a67cebaf..59dad104 100644 --- a/climetlab/version +++ b/climetlab/version @@ -1 +1 @@ -0.21.1 +0.21.2