From 8e9fe6aed71b28eea6e54753b969c775c1f0aa64 Mon Sep 17 00:00:00 2001 From: "Angeline G. Burrell" Date: Thu, 19 Oct 2023 14:34:17 -0400 Subject: [PATCH 1/4] TST: updated daily test date Updated the test date for the daily F10.7 data to work with the new pysat padding unit tests. --- pysatSpaceWeather/instruments/sw_f107.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysatSpaceWeather/instruments/sw_f107.py b/pysatSpaceWeather/instruments/sw_f107.py index e3ba89bf..9b26af4a 100644 --- a/pysatSpaceWeather/instruments/sw_f107.py +++ b/pysatSpaceWeather/instruments/sw_f107.py @@ -105,7 +105,7 @@ _test_dates = {'': {'historic': dt.datetime(2009, 1, 1), 'prelim': dt.datetime(2009, 1, 1), - 'daily': tomorrow, + 'daily': today, 'forecast': tomorrow, '45day': tomorrow}, 'obs': {'now': dt.datetime(2009, 1, 1)}, From 09560b970f7587f984431ff7d2ebc92943d97cff Mon Sep 17 00:00:00 2001 From: "Angeline G. Burrell" Date: Thu, 19 Oct 2023 14:34:54 -0400 Subject: [PATCH 2/4] BUG: fixed LISIRD download Updated LISIRD downloads to match the new behaviour when no data is available. Will also work with prior behaviour, should they decide to switch back. --- .../instruments/methods/lisird.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pysatSpaceWeather/instruments/methods/lisird.py b/pysatSpaceWeather/instruments/methods/lisird.py index 17c55d06..60598cf4 100644 --- a/pysatSpaceWeather/instruments/methods/lisird.py +++ b/pysatSpaceWeather/instruments/methods/lisird.py @@ -148,8 +148,11 @@ def download(date_array, data_path, local_file_prefix, local_date_fmt, raise IOError(''.join(['Gateway timeout when requesting ', 'file using command: ', url])) - if req.ok: - raw_dict = json.loads(req.text)[lisird_data_name] + # Load the dict if text was retrieved + json_dict = json.loads(req.text) if req.ok else {'': {}} + + if lisird_data_name in json_dict.keys(): + raw_dict = json_dict[lisird_data_name] data = pds.DataFrame.from_dict(raw_dict['samples']) if data.empty: pysat.logger.warning("no data for {:}".format(dl_date)) @@ -176,8 +179,12 @@ def download(date_array, data_path, local_file_prefix, local_date_fmt, # Create a local CSV file data.to_csv(local_file, header=True) else: - pysat.logger.info("".join(["Data not downloaded for ", - dl_date.strftime("%d %b %Y"), - ", date may be out of range ", - "for the database."])) + if len(json_dict.keys()) == 1 and '' in json_dict.keys(): + pysat.logger.info("".join(["Data not downloaded for ", + dl_date.strftime("%d %b %Y"), + ", date may be out of range ", + "for the database."])) + else: + raise IOError(''.join(['Returned unexpectedly formatted ', + 'data using command: ', url])) return From 1aaf2832cf58f3059d513d4f810ecada57d7cfea Mon Sep 17 00:00:00 2001 From: "Angeline G. Burrell" Date: Thu, 19 Oct 2023 14:35:09 -0400 Subject: [PATCH 3/4] DOC: fixed docstring Added a missing line to a test docstring. --- pysatSpaceWeather/tests/test_instruments.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pysatSpaceWeather/tests/test_instruments.py b/pysatSpaceWeather/tests/test_instruments.py index 737e2abf..b1e98a23 100644 --- a/pysatSpaceWeather/tests/test_instruments.py +++ b/pysatSpaceWeather/tests/test_instruments.py @@ -34,6 +34,7 @@ class TestInstruments(clslib.InstLibTests): ---- All standard tests, setup, and teardown inherited from the core pysat instrument test class. + """ From e0d5bc2ae84268c1e541b38da5e2222d771d83e3 Mon Sep 17 00:00:00 2001 From: "Angeline G. Burrell" Date: Thu, 19 Oct 2023 14:35:23 -0400 Subject: [PATCH 4/4] DOC: updated changelog Added a summary of the changes to the changelog. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94b24ef9..7b99b3ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ This project adheres to [Semantic Versioning](https://semver.org/). * Created a general download routine for the GFZ and LASP data * Added new examples to the documentation * Added new test attributes for clean messages to the ACE instruments +* Maintenance + * Updated the LISIRD download routine to reflect new behaviour + * Changed F10.7 daily test day to ensure new pysat padding tests work [0.0.10] - 2023-06-01 ---------------------