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

improve testing of Filter class #18

Open
rabernat opened this issue Feb 2, 2021 · 2 comments
Open

improve testing of Filter class #18

rabernat opened this issue Feb 2, 2021 · 2 comments
Labels

Comments

@rabernat
Copy link
Contributor

rabernat commented Feb 2, 2021

I implemented the filter class based on @iangrooms's original code. The filter class is responsible for picking the coefficients for the biharmonic and laplacian steps. It is tested in this file:

https://github.com/ocean-eddy-cpt/gcm-filters/blob/master/tests/test_filter.py

However, it would be best if someone who understands the procedure for defining the filter more deeply would help improve these tests. Right now I am just checking that a particular set of input parameters produces the same outputs I got in my own development environment, e.g.

"filter_args, expected_filter_spec",
[
(
dict(filter_scale=10.0, dx_min=1.0, n_steps=4),
FilterSpec(
n_lap_steps=4,
s_l=[2.36715983, 8.36124821, 15.17931706, 19.7392088],
n_bih_steps=0,
s_b=[],
),
),

Is this sensible? Or can we think of more fundamental ways to test this part of the code.

@rabernat
Copy link
Contributor Author

rabernat commented Feb 4, 2021

  • Check that filter weights give good approx of target polynomial
  • Check zero crossing

@rabernat
Copy link
Contributor Author

rabernat commented Feb 9, 2021

As discussed in #20, we have a small gap in test coverage for different values of ndim here: https://codecov.io/gh/ocean-eddy-cpt/gcm-filters/pull/20/src/gcm_filters/filter.py?before=gcm_filters/filter.py#L70...82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant