Skip to content
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

Parametrize test for __setitem__ (for dask array) #5243

Merged
merged 8 commits into from
May 6, 2021

Conversation

andersy005
Copy link
Member

@andersy005 andersy005 commented May 2, 2021

Follow up PR for #5174

  • Tests added
  • Passes pre-commit run --all-files

@andersy005 andersy005 changed the title Parametrize test for setitem (for dask array) Parametrize test for __setitem__ (for dask array) May 2, 2021
Copy link
Collaborator

@max-sixty max-sixty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @andersy005.

We could avoid parametrizing the original array and the index value here — these examples have them all the same, and we don't need to test over multiple values.

As a principle I'd vote to parametrize the minimum amount needed (though no less 😀). At the extreme, we could put everything in some lisp-like data structure and the test just be func(input) == expected, but that's arguably harder to follow than more imperative code.

@andersy005
Copy link
Member Author

Thank you for the feedback, @max-sixty! I removed the redundant parameters... Let me know if there is anything else worth addressing...

Copy link
Collaborator

@max-sixty max-sixty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks a lot @andersy005 !

xarray/tests/test_dask.py Outdated Show resolved Hide resolved
@andersy005
Copy link
Member Author

This should be mergeable once the CI is passing

@andersy005
Copy link
Member Author

The flaky/failing test is due to an unstable OpenDAP server....

@mathause mathause merged commit c1aea94 into pydata:master May 6, 2021
@mathause
Copy link
Collaborator

mathause commented May 6, 2021

Thanks @andersy005!

@andersy005 andersy005 deleted the pull-5174-follow-up branch May 6, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants