Skip to content

Commit

Permalink
Test tide posts
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt authored Dec 20, 2024
1 parent 3a5d4a9 commit 632815f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 0 additions & 6 deletions pyTMD.pyi

This file was deleted.

13 changes: 8 additions & 5 deletions tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 632815f

Please sign in to comment.