From 00d629b2a126e501742010d37b200d79e8241973 Mon Sep 17 00:00:00 2001 From: hayesla Date: Mon, 11 Sep 2023 11:26:09 +0200 Subject: [PATCH 1/3] fixing conflict --- sunpy_soar/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sunpy_soar/client.py b/sunpy_soar/client.py index 8756610..8c06f4e 100644 --- a/sunpy_soar/client.py +++ b/sunpy_soar/client.py @@ -95,7 +95,7 @@ def _do_search(query): info["begin_time"] = parse_time(info["begin_time"]).iso info["end_time"] = parse_time(info["end_time"]).iso - return astropy.table.QTable( + result_table = astropy.table.QTable( { "Instrument": info["instrument"], "Data product": info["descriptor"], @@ -108,6 +108,8 @@ def _do_search(query): "SOOP Name": info["soop_name"], }, ) + result_table.sort("Start time") + return result_table def fetch(self, query_results, *, path, downloader, **kwargs): """ From 1a6e8c62e600493ef333fe1cfba061c7ac2f0457 Mon Sep 17 00:00:00 2001 From: hayesla Date: Mon, 11 Sep 2023 11:29:24 +0200 Subject: [PATCH 2/3] fixing conflict --- sunpy_soar/tests/test_sunpy_soar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sunpy_soar/tests/test_sunpy_soar.py b/sunpy_soar/tests/test_sunpy_soar.py index b18df58..c84afa7 100644 --- a/sunpy_soar/tests/test_sunpy_soar.py +++ b/sunpy_soar/tests/test_sunpy_soar.py @@ -19,7 +19,7 @@ def test_search(): res = Fido.search(instrument, time, level, product) assert len(res) == 1 assert len(res[0]) == 37 - assert u.allclose(res[0, 0]["Filesize"], 3.47 * u.Mbyte) + assert u.allclose(res[0, 0]["Filesize"], 3.45 * u.Mbyte) # check passing upper case descriptor product = a.soar.Product("EUI-FSI174-IMAGE") @@ -29,7 +29,9 @@ def test_search(): files = Fido.fetch(res[0, 0]) assert len(files) == 1 fname = files[0] + assert u.allclose(Path(fname).stat().st_size * u.byte, res[0, 0]["Filesize"], atol=1e-3 * u.Mbyte) + # Smoke test that we can read this into a map sunpy.map.Map(fname) From 2c7f40fc8013c84cbe095a3bc70223d72a4f6b1e Mon Sep 17 00:00:00 2001 From: hayesla Date: Mon, 11 Sep 2023 11:32:01 +0200 Subject: [PATCH 3/3] adding changelog --- changelog/96.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/96.feature.rst diff --git a/changelog/96.feature.rst b/changelog/96.feature.rst new file mode 100644 index 0000000..39b5454 --- /dev/null +++ b/changelog/96.feature.rst @@ -0,0 +1 @@ +Now query returns time sorted table of results.