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

np.cumproduct deprecated #8013

Closed
quantsnus opened this issue Jul 24, 2023 · 4 comments · Fixed by #8031
Closed

np.cumproduct deprecated #8013

quantsnus opened this issue Jul 24, 2023 · 4 comments · Fixed by #8031

Comments

@quantsnus
Copy link
Contributor

What is your issue?

Since numpy version 1.25.0 np.cumproduct is deprecated in favor of np.cumprod.

The coordinates to_index() method still uses it

cumprod_lengths = np.cumproduct(index_lengths)

which results in an unecessary DeprecationWarning.

@quantsnus quantsnus added the needs triage Issue that has not been reviewed by xarray team member label Jul 24, 2023
@dcherian dcherian added contrib-good-first-issue and removed needs triage Issue that has not been reviewed by xarray team member labels Jul 24, 2023
@dcherian
Copy link
Contributor

Thanks @quantsnus This should be a really easy Pull Request. Do you have time to fix it?

We have contributing instructions here: https://docs.xarray.dev/en/stable/contributing.html

@TomNicholas
Copy link
Member

TomNicholas commented Jul 24, 2023

In particular see the section of the contributing guide explaining how to add a deprecation warning

@keewis
Copy link
Collaborator

keewis commented Jul 25, 2023

no need for a deprecation cycle since the cumproduct call is internal

@quantsnus
Copy link
Contributor Author

Thanks @quantsnus This should be a really easy Pull Request. Do you have time to fix it?

I'll give it try. Will be my first contribution, but for a one-line change I guess it won't be too difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants