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

fixing rolling_window issue with cupy #7938

Merged
merged 1 commit into from
Jun 23, 2023
Merged

Conversation

negin513
Copy link
Contributor

@negin513 negin513 commented Jun 23, 2023

@welcome
Copy link

welcome bot commented Jun 23, 2023

Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
If you have questions, some answers may be found in our contributing guidelines.

@negin513
Copy link
Contributor Author

This PR fix a part of the issue we see when using rolling_window with cupy.
While numpy.normalize_axis_tuple can handle lists, therefore not complaining when using numpy-backed xarray objects, its cupy equivalent (cupy.core.internal._normalize_axis_indices) does not accept lists and only accept tuples. This PR change the data type for dims to tuple so we can make rolling_window to work for both numpy and cupy.

@dcherian
Copy link
Contributor

Thanks @negin513 ! LGTM. Welcome to Xarray!

@TomNicholas TomNicholas merged commit cbc02e3 into pydata:main Jun 23, 2023
@welcome
Copy link

welcome bot commented Jun 23, 2023

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

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.

xarray.rolling_window Converts dims Argument from Tuple to List Causing Issues for Cupy-Xarray
3 participants