From 739fcba26a62290c5dfee636970e695e630eb758 Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 22 Jul 2026 12:53:06 +0100 Subject: [PATCH 1/6] pop a test for globus files --- tests/test_real_https.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_real_https.py b/tests/test_real_https.py index bfe4bc11..8600cc15 100644 --- a/tests/test_real_https.py +++ b/tests/test_real_https.py @@ -53,6 +53,25 @@ def test_https(): assert result == np.array([220.3180694580078], dtype="float32") +def test_https_globus(): + """Test with a globus file instead.""" + test_file_uri = "https://g-52ba3.fd635.8443.data.globus.org/css03_data/CMIP6/CMIP/CCCma/CanESM5/historical/r1i1p1f1/Amon/tas/gn/v20190429/tas_Amon_CanESM5_historical_r1i1p1f1_gn_185001-201412.nc" + # perform a basic remote load test first + fh = load_from_https(test_file_uri) + ds = fh["tas"] + print("Dataset loaded from Globus:", ds) + + # now let's active storage it + active_storage_url = "https://reductionist.jasmin.ac.uk/" # Wacasoft new Reductionist + + # v1: all local + active = Active(test_file_uri, "ta") + active._version = 1 + result = active.min()[0:3, 4:6, 7:9] + print("Result is", result) + assert result == np.array([220.3180694580078], dtype="float32") + + def test_https_axis_1(): """Test https with axis 1.""" # FIXME fails frequently on CEDA NGINX: Reductionist: 400 Bad Request From daa58d437d538df83f74342bebc3a78c7b88bc60 Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 22 Jul 2026 13:00:37 +0100 Subject: [PATCH 2/6] run a active v2, test will fail we dont know the numerical result --- tests/test_real_https.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_real_https.py b/tests/test_real_https.py index 8600cc15..415cf4f0 100644 --- a/tests/test_real_https.py +++ b/tests/test_real_https.py @@ -63,10 +63,9 @@ def test_https_globus(): # now let's active storage it active_storage_url = "https://reductionist.jasmin.ac.uk/" # Wacasoft new Reductionist - - # v1: all local - active = Active(test_file_uri, "ta") - active._version = 1 + active = Active(test_file_uri, "tas", + active_storage_url=active_storage_url) + active._version = 2 result = active.min()[0:3, 4:6, 7:9] print("Result is", result) assert result == np.array([220.3180694580078], dtype="float32") From f9fc7ef4c3a22a4c9cdc2fbbdf6335c76c42c2ac Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 22 Jul 2026 13:11:37 +0100 Subject: [PATCH 3/6] repair test --- tests/test_real_https.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_real_https.py b/tests/test_real_https.py index 415cf4f0..3d7ec11f 100644 --- a/tests/test_real_https.py +++ b/tests/test_real_https.py @@ -68,7 +68,12 @@ def test_https_globus(): active._version = 2 result = active.min()[0:3, 4:6, 7:9] print("Result is", result) - assert result == np.array([220.3180694580078], dtype="float32") + # the returned element is a fully contained masked array + assert result == np.array(data=[[[215.90142822265625]]], + mask=[[[False]]], + fill_value=np.float64(1e+20), + dtype="float32") + def test_https_axis_1(): From f726181e8c663ee1d85d90a4e246e127f972f86e Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 22 Jul 2026 13:18:50 +0100 Subject: [PATCH 4/6] agh wrong kwarg --- tests/test_real_https.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test_real_https.py b/tests/test_real_https.py index 3d7ec11f..ae5d53d3 100644 --- a/tests/test_real_https.py +++ b/tests/test_real_https.py @@ -69,9 +69,7 @@ def test_https_globus(): result = active.min()[0:3, 4:6, 7:9] print("Result is", result) # the returned element is a fully contained masked array - assert result == np.array(data=[[[215.90142822265625]]], - mask=[[[False]]], - fill_value=np.float64(1e+20), + assert result == np.array([[[215.90142822265625]]], dtype="float32") From 3a9917951ca4ee78032f6935daff91e7b1a61e83 Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 22 Jul 2026 13:24:03 +0100 Subject: [PATCH 5/6] add info about storage backend --- tests/test_real_https.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_real_https.py b/tests/test_real_https.py index ae5d53d3..0b79a4fc 100644 --- a/tests/test_real_https.py +++ b/tests/test_real_https.py @@ -54,7 +54,12 @@ def test_https(): def test_https_globus(): - """Test with a globus file instead.""" + """ + Test with a globus file instead. + + The example below is Apache HTTP Server (httpd), + not NGINX, for a standard Globus Connect Server (GCS) HTTPS collection + """ test_file_uri = "https://g-52ba3.fd635.8443.data.globus.org/css03_data/CMIP6/CMIP/CCCma/CanESM5/historical/r1i1p1f1/Amon/tas/gn/v20190429/tas_Amon_CanESM5_historical_r1i1p1f1_gn_185001-201412.nc" # perform a basic remote load test first fh = load_from_https(test_file_uri) From 5f6836ab623d52b620b7f72efac43e77e921767f Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 22 Jul 2026 13:32:00 +0100 Subject: [PATCH 6/6] add more info in docstring --- tests/test_real_https.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_real_https.py b/tests/test_real_https.py index 0b79a4fc..0da87500 100644 --- a/tests/test_real_https.py +++ b/tests/test_real_https.py @@ -58,7 +58,9 @@ def test_https_globus(): Test with a globus file instead. The example below is Apache HTTP Server (httpd), - not NGINX, for a standard Globus Connect Server (GCS) HTTPS collection + not NGINX, for a standard Globus Connect Server (GCS) HTTPS collection. + The example is g-52ba3.fd635.8443.data.globus.org. 60 IN A 140.221.68.105 + which is a node hosted at Argonne National Lab, Chicago. """ test_file_uri = "https://g-52ba3.fd635.8443.data.globus.org/css03_data/CMIP6/CMIP/CCCma/CanESM5/historical/r1i1p1f1/Amon/tas/gn/v20190429/tas_Amon_CanESM5_historical_r1i1p1f1_gn_185001-201412.nc" # perform a basic remote load test first