From f40311eb1f51cd0f589b3fb27c74a46c607e6e4d Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Mon, 11 Nov 2019 15:21:41 -0500 Subject: [PATCH] set temperature abstol to 0.01 --- matlab/datetimerange.m | 5 +++-- tests/test_module.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/matlab/datetimerange.m b/matlab/datetimerange.m index 50be5b6..bb0bd67 100644 --- a/matlab/datetimerange.m +++ b/matlab/datetimerange.m @@ -1,10 +1,11 @@ function times = datetimerange(t0, t1, ts) +narginchk(3,3) +validateattributes(ts, {'numeric'}, {'scalar', 'positive'}) % ts: seconds -narginchk(3,3) t0 = datenum(t0); t1 = datenum(t1); times = t0:ts/86400:t1; -end \ No newline at end of file +end diff --git a/tests/test_module.py b/tests/test_module.py index 963218a..1993f6e 100755 --- a/tests/test_module.py +++ b/tests/test_module.py @@ -18,7 +18,7 @@ def test_past(): try: atmos = msise00.run(t, altkm, glat, glon) except ConnectionError: - pytest.xfail("unable to download RecentIndices.txt") + pytest.skip("unable to download RecentIndices.txt") assert atmos["He"].ndim == 4 assert atmos["He"].size == 1 @@ -77,9 +77,9 @@ def test_forecast(): assert atmos.species == ["He", "O", "N2", "O2", "Ar", "Total", "H", "N", "AnomalousO"] - assert atmos["Tn"].item() == approx(671.513672) - assert atmos["Texo"].item() == approx(883.342529) + assert atmos["Tn"].item() == approx(671.513, abs=0.01) + assert atmos["Texo"].item() == approx(883.342, abs=0.01) if __name__ == "__main__": - pytest.main(["-v", __file__]) + pytest.main([__file__])