Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better tests for today's date #119

Merged
merged 2 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Changelog
=========

2.X.X (2023-XX-XX)
2.0.1 (2023-XX-XX)
------------------
* Expanded installation instructions in the documenation
* Added unit tests for todays date, ensuring that `apex.dat` is current
* Added cron unit test to GitHub Actions CI
* Added a logo
* Correct indexing bug in Fortran source that was causing array overflow and
memory errors for extrapolated years beyond the latest formal IGRF fit.
memory errors for extrapolated years beyond the latest formal IGRF fit

2.0.0 (2022-12-09)
------------------
Expand Down
7 changes: 7 additions & 0 deletions apexpy/tests/test_Apex.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ def get_input_args(self, method_name, precision=0.0):

return in_args

def test_apex_conversion_today(self):
"""Test Apex class conversion with today's date."""
self.apex_out = apexpy.Apex(date=dt.datetime.utcnow(), refh=300)
assert not np.isnan(self.apex_out.geo2apex(self.in_lat, self.in_lon,
self.in_alt)).any()
return

@pytest.mark.parametrize("apex_method,fortran_method,fslice",
[("_geo2qd", "apxg2q", slice(0, 2, 1)),
("_geo2apex", "apxg2all", slice(2, 4, 1)),
Expand Down