-
Notifications
You must be signed in to change notification settings - Fork 24
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
Filter verification tests #153
Filter verification tests #153
Conversation
- in the old version, grid scale and filter scale were chosen as equal; filtering does not really do anything in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this look like a great improvement! Big 👍 to PRs that remove code! 😄
I just have one question to make sure I understand what is happening here.
da_v = xr.DataArray(data_v, dims=["y", "x"]) | ||
|
||
return grid_type, da_u, da_v, grid_vars, geolat_u | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just help me understand why all this code is being removed? Is it redundant with the code in conftest.py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. The only two differences between the removed code and the code in conftest.py
were:
conftest.py
created numpy array test data (specific totest_kernels.py
), whereas the removed code created xarray DataArray test data (specific totest_filter.py
). The new fixturesgrid_type_and_input_ds
andvector_grid_type_and_input_ds
inconftest.py
take care of the numpy array--> xarray DataArray conversion, but without all the redundancy.- The random number generator for the test data. Using the explicit constant seed for the random number generator in
conftest.py
ensures that we are always testing on the same data - a pre-requisite for the filter verification tests, exactly as done in Refactor kernel tests #79.
@rabernat do you agree that we can merge this PR? |
Thanks for the ping Nora! Yes, absolutely, I will do it now. |
This PR adds verification tests for the filter algorithm, in preparation for the refactor in #149, which replaces the filter algorithm with a new one.
This PR essentially mirrors #79, but here the verification tests are associated with the
test_filter.py
module (rather than thetest_kernels.py
module as in #79). The main changes are:tests/test_filter.py
totests/conftest.py
and, in the process, got rid off a lot of redundant code.test_filter_validation.py
.