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

fix np deprecation warnings for non-tuple sequence in multi-dim indexing #2876

Merged

Conversation

neutrinoceros
Copy link
Member

@neutrinoceros neutrinoceros commented Aug 17, 2020

PR Summary

in recent versions of numpy, this pattern is deprecated:

# let arr be a 3D array
arr[[slice(None) for _ in range(3)]]

and one gets this warning:

FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different

I discovered the places this pattern was used in yt by checking the logs on Travis.

Note that this is not a bug yet, but I'm still using the label since it will become an error.

PR Checklist

  • pass black --check yt/
  • pass isort . --check --diff
  • pass flake8 yt/
  • pass flynt yt/ --fail-on-change --dry-run -e yt/extern

@neutrinoceros neutrinoceros added bug refactor improve readability, maintainability, modularity labels Aug 17, 2020
@munkm munkm changed the title fix numpy deprecation warnings for non-tuple sequence in multi-dim in… fix np deprecation warnings for non-tuple sequence in multi-dim indexing Aug 17, 2020
@munkm munkm merged commit 0f2fafe into yt-project:master Aug 17, 2020
@neutrinoceros neutrinoceros deleted the fix_numpy_deprecation_warnings branch August 17, 2020 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug refactor improve readability, maintainability, modularity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants