-
Notifications
You must be signed in to change notification settings - Fork 72
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
Handling of provenance attributes in apply-mask and add-depth, especially for testing #930
Conversation
…apply_mask, specify in docstring that an Sv variable is expected and in _variable_prov_attrs test for dask array in addition to xr array
@emiliom a couple of comments:
|
To be clear, what I meant elsewhere as "general" or "generic" was that the docstring did not clearly say that an Sv type of variable was the target for
I like that, thanks. I'll push a commit to this PR. |
@emiliom The original code (i.e. that produced in #905) was created such that it does not expect
Great! |
@emiliom: I think the edits you made captures the intended case captures what I intended, so let's roll with it. I noted above a commented out assertion -- see how you want to handle it, but it doesn't seem a good idea to just not test for anything. Otherwise, feel free to merge this PR. Thanks! |
…ity. Also remove testing for dask array type in that function, for consistency with apply_mask
Codecov Report
@@ Coverage Diff @@
## dev #930 +/- ##
==========================================
- Coverage 79.16% 77.22% -1.94%
==========================================
Files 58 5 -53
Lines 5504 303 -5201
==========================================
- Hits 4357 234 -4123
+ Misses 1147 69 -1078
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Done. In doing so, I added type hints for |
Thanks @leewujung . See my comments. I prefer to leave the I'll wait for you to take another look before merging this PR. |
Note about the pre-commit.ci build error: The error involves the Jupyter Book build:
I don't know if this is a new, lower limit or if it's been happening if the error has been happening for a while. But it's not related to this PR per se. |
Sounds good -- let's make sure to follow through on this! Feel free to merge. For the Jupyter Book build error: yes it is in all PRs, but I haven't had a chance to look into what that is. Perhaps @lsetiawan has some insight here? |
Thanks! See the new issue I've created, #933, to track attribute testing. I'll go ahead and merge the PR |
…ally for testing (OSOceanAcoustics#930) * Ensure chanA & chanB in frequency_differencing are set to string. In apply_mask, specify in docstring that an Sv variable is expected and in _variable_prov_attrs test for dask array in addition to xr array * Modify test_mask::test_apply_mask to ignore attributes in the dataarray comparison * In test_consolidate::test_add_depth, comment out check-attributes test * Move _variable_prov_attrs in mask.api.apy out of apply_mask, for clarity. Also remove testing for dask array type in that function, for consistency with apply_mask
Addresses errors in
test_mask.py::test_apply_mask
discussed in #926 (comment). These errors stemmed from the addition of provenance attributes (PR #918). The solution at this time was to avoid making dataarray comparisons that also compare attributes, replacingdataarray.identical
withdataarray.equals
.Also modified
mask.api.frequency_differencing
to ensure chanA & chanB in are set to string type; andmask.api.apply_mask
to test for dask array in addition to xr array (in_variable_prov_attrs
), and to specify in the docstring that an Sv variable is expected.After #929, the consolidate tests are now running by default. This exposed an error in
test_consolidate.py::test_add_depth
of the same type as the attribute testing error intest_mask.py::test_apply_mask
. I "fixed" it by commenting out theassert
statement that specifically tested for attributes.