ocean-eddy-cpt / gcm-filters

Diffusion-based Spatial Filtering of Gridded Data
https://gcm-filters.readthedocs.io/
Other
37 stars 24 forks source link

improve testing of Filter class #18

Open rabernat opened 3 years ago

rabernat commented 3 years ago

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.

https://github.com/ocean-eddy-cpt/gcm-filters/blob/04ad83562a670db8d194d7ad672059d74197a109/tests/test_filter.py#L20-L30

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

rabernat commented 3 years ago
rabernat commented 3 years ago

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