From 62039c25ada619db57e2d23ca872e387d85d66a2 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 19 Feb 2024 15:21:09 +0000 Subject: [PATCH] Use execTime for fido search (#326) --- changelog/326.feature.rst | 1 + dkist/net/attr_walker.py | 4 ++-- dkist/net/tests/conftest.py | 2 +- dkist/net/tests/test_attr_walker.py | 12 ++++++------ 4 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 changelog/326.feature.rst diff --git a/changelog/326.feature.rst b/changelog/326.feature.rst new file mode 100644 index 00000000..a6cfb979 --- /dev/null +++ b/changelog/326.feature.rst @@ -0,0 +1 @@ +Use a new feature in the DKIST datasets API to search for all datasets which intersect the given time. diff --git a/dkist/net/attr_walker.py b/dkist/net/attr_walker.py index 6c9794b4..6ac55aa0 100644 --- a/dkist/net/attr_walker.py +++ b/dkist/net/attr_walker.py @@ -53,8 +53,8 @@ def iterate_over_and(wlk, tree, params): # SunPy Attrs @walker.add_applier(Time) def _(wlk, attr, params): - return params.update({'startTimeMin': attr.start.isot, - 'endTimeMax': attr.end.isot}) + return params.update({'execTimeMin': attr.start.isot, + 'execTimeMax': attr.end.isot}) @walker.add_applier(Instrument) diff --git a/dkist/net/tests/conftest.py b/dkist/net/tests/conftest.py index 9dc8b9ac..ca599b16 100644 --- a/dkist/net/tests/conftest.py +++ b/dkist/net/tests/conftest.py @@ -28,7 +28,7 @@ def api_param_names(): Excludes ones with input dependant query params """ return { - a.Time: ('startTimeMin', 'endTimeMax'), + a.Time: ('execTimeMin', 'execTimeMax'), a.Instrument: ('instrumentNames',), a.Wavelength: ('wavelengthRanges',), a.Physobs: ('hasAllStokes',), diff --git a/dkist/net/tests/test_attr_walker.py b/dkist/net/tests/test_attr_walker.py index 2ac29cf8..51dfcfcb 100644 --- a/dkist/net/tests/test_attr_walker.py +++ b/dkist/net/tests/test_attr_walker.py @@ -166,8 +166,8 @@ def test_and_simple(query_and_simple): assert out == [ { "instrumentNames": "VBI", - "startTimeMin": "2020-06-01T00:00:00.000", - "endTimeMax": "2020-06-02T00:00:00.000", + "execTimeMin": "2020-06-01T00:00:00.000", + "execTimeMax": "2020-06-02T00:00:00.000", } ] @@ -181,12 +181,12 @@ def test_or_instrument(query_or_instrument): assert out == [ { "instrumentNames": "VBI", - "startTimeMin": "2020-06-01T00:00:00.000", - "endTimeMax": "2020-06-02T00:00:00.000", + "execTimeMin": "2020-06-01T00:00:00.000", + "execTimeMax": "2020-06-02T00:00:00.000", }, { "instrumentNames": "VISP", - "startTimeMin": "2020-06-01T00:00:00.000", - "endTimeMax": "2020-06-02T00:00:00.000", + "execTimeMin": "2020-06-01T00:00:00.000", + "execTimeMax": "2020-06-02T00:00:00.000", } ]