-
Notifications
You must be signed in to change notification settings - Fork 40
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
Purpose of testing np_deterministic and ufunc #248
Comments
In my opinion we would need a big PR checking that each standard keyword, I.e. (dim) skipna, weighted works as expected. I feel that we missed some combinations in the past. @raybellwaves just caught some. Are those all of them? This test can be done in either np_deterministic or deterministic.py, probably the later better to test for chunked and has nans for has zeros also. Testing both np_det and det.py seems redundant to be as xr.applyufunc just calls np_det function and carries xr properties. list of testing inputs possible:
|
slightly related comment at the top here (#247 (comment)) |
I'm in favor of well named test files which are clearly defined with and built with hierarchy. For example currently we have:
Aaron also mentioned the use of pytest-lazy-fixture (#247 (comment)). This seem very useful and is used in climpred e.g. https://github.com/pangeo-data/climpred/blob/fdec3af0aabac42de1787aecc0fcbef64a4800f7/climpred/tests/test_bootstrap.py#L227. It has the benefit of writing one test but parameterizing variables. as example is
Which saves writing the same test three times (if the code is the same)
But it's ideal not to mix and match these approaches within the same script. For example, there could be a small simple dask test file where the above code is applicable I think a good starting place is adding the possible inputs to https://github.com/xarray-contrib/xskillscore/blob/master/xskillscore/tests/conftest.py which Aaron recently added. I'm also happy for this issue convo to be like a scratch pad to discuss ideas/breaking down PRs etc. |
There's probably a bigger question about the purpose of the tests etc.
Originally posted by @raybellwaves in #247 (comment)
I would say that testing that ufunc (incl or excl dask) does the same as the np functions, is not required for xs. We don’t interfere there, do we? How should these tests break anyways? I am concerned about alleged security when these tests are present.
The text was updated successfully, but these errors were encountered: