From a375082472ecf611ef7659ab61a8af5d97781601 Mon Sep 17 00:00:00 2001 From: Nora Loose Date: Tue, 12 Nov 2024 16:52:48 -0700 Subject: [PATCH] Add test that would have previously failed --- tests/test_filter.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_filter.py b/tests/test_filter.py index dd5c271..3ca9f81 100644 --- a/tests/test_filter.py +++ b/tests/test_filter.py @@ -7,7 +7,7 @@ import xarray as xr from gcm_filters import Filter, FilterShape, GridType -from gcm_filters.filter import FilterSpec +from gcm_filters.filter import FilterSpec, _compute_n_steps_default def _check_equal_filter_spec(spec1, spec2): @@ -85,6 +85,13 @@ def test_filter_spec(filter_args, expected_filter_spec): # TODO: check other properties of filter_spec? +def test_default_n_steps_larger_equal_3(): + n_steps_default = _compute_n_steps_default(2, FilterShape.GAUSSIAN, 1.5, 1, np.pi) + + # Assert that the number of steps is greater than or equal to 3 + assert n_steps_default >= 3 + + #################### Diffusion-based filter tests ######################################## area_weighted_regular_grids = [ GridType.REGULAR_AREA_WEIGHTED,