From 632815fa188c33281f86130470724edb8ff4d1bd Mon Sep 17 00:00:00 2001 From: Robbi Bishop-Taylor Date: Fri, 20 Dec 2024 06:54:59 +0000 Subject: [PATCH] Test tide posts --- pyTMD.pyi | 6 ------ tests/test_stats.py | 13 ++++++++----- 2 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 pyTMD.pyi diff --git a/pyTMD.pyi b/pyTMD.pyi deleted file mode 100644 index b5b8d9e..0000000 --- a/pyTMD.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from typing import List, Union - -import numpy as np - -# Add any type stubs needed to override the problematic ones -coefficients: Union[List, np.ndarray] diff --git a/tests/test_stats.py b/tests/test_stats.py index 2a591d0..04cde0a 100644 --- a/tests/test_stats.py +++ b/tests/test_stats.py @@ -10,17 +10,20 @@ # Run test for multiple modelled frequencies @pytest.mark.parametrize( - "modelled_freq", + "modelled_freq, tidepost_lon, tidepost_lat", [ - ("2h"), # Model tides every two hours - ("120min"), # Model tides every 120 minutes + ("2h", None, None), # Model tides every two hours + ("120min", None, None), # Model tides every 120 minutes + ("2h", 122.218, -18.001), # Custom tidepost ], ) -def test_tidal_stats(satellite_ds, modelled_freq): +def test_tidal_stats(satellite_ds, modelled_freq, tidepost_lon, tidepost_lat): # Calculate tidal stats tidal_stats_df = tide_stats( satellite_ds, modelled_freq=modelled_freq, + tidepost_lon=tidepost_lon, + tidepost_lat=tidepost_lat, ) # Compare outputs to expected results (within 2% or 0.02 m) @@ -39,7 +42,7 @@ def test_tidal_stats(satellite_ds, modelled_freq): "x": 122.218, "y": -18.001, }) - assert np.allclose(tidal_stats_df, expected_results, atol=0.01) + assert np.allclose(tidal_stats_df, expected_results, atol=0.02) # Run test for one or multiple model inputs