-
Notifications
You must be signed in to change notification settings - Fork 168
Adding unit tests #2113
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
Adding unit tests #2113
Conversation
Where tau could return a DataArray (instead of a float)
And also moving mesh interpolation test into separate test-file
Because the dataset itself can cause issues when changed in a pytest
And also moving BiLinear interpolation to interpolation.py
But can't finsih until we have ParticleFile implemented
|
This PR does not yet contain the full suite of all unit tests from v3, but I think would be good to merge into v4-dev already, just to avoid too large PRs |
| if len(arr) < 2: | ||
| return 0, 0.0 |
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.
Do you know which test required this change? (I assume something to do with 2d fields?)
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, every test that had 1D depth fields. E.g. pytest tests/v4/test_diffusion.py -k "test_fieldKh_Brownian[flat]"
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.
Ok. I'm not sure what it means to have a 1 length dimension with a coordinate for that dimension (shown in tests/v4/test_advection.py::test_length1dimensions). I don't think the coordinate matters.
This might be something to either deal with earlier on, or be something to make a bit more explicit internally. Let's keep this for now so that it can be revisited later with refactored tests. Leaving a TODO comment.
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.
To be clear (also for future reference), I'm a bit concerned here that we're assuming that the 0D dimension has a coordinate assigned to it, when really it doesn't matter if it does. We need to make sure (and test) that we aren't implicitly assuming a coordinate for this dim.
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.
OK, you can check the code in test_diffusion.py/test_fieldKh_Brownian for where this warning was raised. Perhaps I created the dataset and/or fieldset wrongly?
|
Can we merge this tomorrow morning (with or without feedback implemented). I would like to make sweeping changes to |
As suggested by @VeckoTheGecko
Co-authored-by: Nick Hodgskin <36369090+VeckoTheGecko@users.noreply.github.com>
Co-authored-by: Nick Hodgskin <36369090+VeckoTheGecko@users.noreply.github.com>
…arcels into adding_unit_tests
for more information, see https://pre-commit.ci
…arcels into adding_unit_tests
This PR moves and updates unit tests from the v3-testsuite to v4
mainfor v3 changes,v4-devfor v4 changes)