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

Upcoming deprecation of np.product #2241

Closed
1 task done
alexander-held opened this issue Jul 4, 2023 · 0 comments · Fixed by #2242
Closed
1 task done

Upcoming deprecation of np.product #2241

alexander-held opened this issue Jul 4, 2023 · 0 comments · Fixed by #2242
Labels
bug Something isn't working

Comments

@alexander-held
Copy link
Member

Summary

Both paramview and pdf cause deprecation warnings due to the use of np.product instead of np.prod when using numpy 1.25 or above. This is not flagged in CI, which uses an older version of numpy, presumably due to other dependencies capping it still.

OS / Environment

n/a

Steps to Reproduce

run e.g. pytest tests/test_pdf.py in an environment with numpy 1.25

File Upload (optional)

No response

Expected Results

no deprecation warnings

Actual Results

[...]/pyhf/src/pyhf/parameters/paramview.py:65: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    fullsize = default_backend.product(default_backend.astensor(shape))

  [...]/pyhf/src/pyhf/pdf.py:709: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    newbysample = tensorlib.product(allfac, axis=0)

pyhf Version

HEAD

Code of Conduct

  • I agree to follow the Code of Conduct
@alexander-held alexander-held added bug Something isn't working needs-triage Needs a maintainer to categorize and assign labels Jul 4, 2023
@matthewfeickert matthewfeickert removed the needs-triage Needs a maintainer to categorize and assign label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants