Skip to content

Commit

Permalink
Merge branch 'develop' into combine_data_bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
aburrell authored Aug 14, 2024
2 parents 9902b97 + af72bb5 commit c651bd1
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
* Implemented `iloc` in pandas Series and DataFrame index access
* Added `verify=False` to GFZ requests
* Updated documentation links and fixed intersphinx mapping
* Replaced `utcnow` with `now` and the UTC timezone
* Bugs
* Fixed errors introduced by assuming files will be present when combining
F10.7 or Kp data in `combine_f107` and `combine_kp` functions.
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/ace_epam.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
inst_ids = {inst_id: [tag for tag in tags.keys()] for inst_id in ['']}

# Define today's date
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# ----------------------------------------------------------------------------
# Instrument test attributes
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/ace_mag.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
inst_ids = {inst_id: [tag for tag in tags.keys()] for inst_id in ['']}

# Define today's date
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# ----------------------------------------------------------------------------
# Instrument test attributes
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/ace_sis.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
inst_ids = {inst_id: [tag for tag in tags.keys()] for inst_id in ['']}

# Define today's date
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# ----------------------------------------------------------------------------
# Instrument test attributes
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/ace_swepam.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
inst_ids = {inst_id: [tag for tag in tags.keys()] for inst_id in ['']}

# Define today's date
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# ----------------------------------------------------------------------------
# Instrument test attributes
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/methods/ace.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def download(date_array, name, tag='', inst_id='', data_path='', now=None,
"""
# Ensure now is up-to-date, if desired
if now is None:
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# Define the file information for each data type and check the
# date range
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
inst_ids = {'': list(tags.keys())}

# Generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)
tomorrow = today + dt.timedelta(days=1)

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_f107.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

# Dict keyed by inst_id that lists supported tags and a good day of test data
# generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)
tomorrow = today + dt.timedelta(days=1)

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_flare.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

# Dict keyed by inst_id that lists supported tags and a good day of test data
# generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)
tomorrow = today + dt.timedelta(days=1)

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_kp.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
inst_ids = {'': list(tags.keys())}

# Generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)

# ----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_mgii.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

# Dict keyed by inst_id that lists supported tags and a good day of test data
# generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)
tomorrow = today + pds.DateOffset(days=1)

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_polarcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
inst_ids = {'': list(tags.keys())}

# Generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)
tomorrow = today + dt.timedelta(days=1)

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_sbfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

# Dict keyed by inst_id that lists supported tags and a good day of test data
# generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)
tomorrow = today + pds.DateOffset(days=1)

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_ssn.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

# Dict keyed by inst_id that lists supported tags and a good day of test data
# generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)
tomorrow = today + pds.DateOffset(days=1)

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/sw_stormprob.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
inst_ids = {'': list(tags.keys())}

# Generate todays date to support loading forecast data
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)
today = dt.datetime(now.year, now.month, now.day)
tomorrow = today + dt.timedelta(days=1)

Expand Down
3 changes: 2 additions & 1 deletion pysatSpaceWeather/tests/test_methods_gfz.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def test_kp_ap_cp_download_bad_inst(self):
"""Test the download doesn't work for an incorrect Instrument."""
with pytest.raises(ValueError) as verr:
gfz.kp_ap_cp_download('platform', 'name', 'tag', 'inst_id',
[dt.datetime.utcnow()], 'data/path')
[dt.datetime.now(tz=dt.timezone.utc)],
'data/path')

assert str(verr).find('Unknown Instrument module') >= 0
return

0 comments on commit c651bd1

Please sign in to comment.