-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Optional tolerance feature to isin per issue #5587 #5862
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
base: main
Are you sure you want to change the base?
Conversation
Hello @shazelquist! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-10-23 00:24:37 UTC |
xarray/tests/test_duck_array_ops.py
Outdated
|
||
@pytest.mark.parametrize("shape", [(200, 1), (10, 10, 2), (4, 50)]) | ||
@pytest.mark.parametrize("tolerance", [1e-2, 1e-4, 1e-6]) | ||
def test_isin_tolerance(shape, tolerance): |
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 we add a test with dask arrays as well?
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.
Sure! Does the implementation in commit b79620a cover dask arrays?
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.
You have to change the expected value as well. Because if I input a dask array I would expect to get a dask array out as well from a duckarray operation.
There's also a assert_duckarray_equal
that you maybe can use instead of numpys version:
Line 215 in b79620a
def assert_duckarray_equal(x, y, err_msg="", verbose=True): |
I'm probably missing something but it is kind of surprising it hasn't already been imported in this test module.
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.
Oh yeah, that makes sense. Thanks for the clarification!
ebe3e32
to
b2e32aa
Compare
da.isin()
? #5587pre-commit run --all-files
whats-new.rst
New functions/methods are listed indoesn't appear to be necessaryapi.rst
This implementation is similar to suggested vectorized solution 1, but acts more according to the issue specifications.
I'm pretty this pull fails checks 4 and 5, but they may not be relevant to expanding functions from the
apply_ufunc
dispatcher?I will write an update if this is the case or any other changes are required.