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

issues with depreciated numpy.product #605

Open
lou2606 opened this issue Oct 6, 2024 · 0 comments
Open

issues with depreciated numpy.product #605

lou2606 opened this issue Oct 6, 2024 · 0 comments

Comments

@lou2606
Copy link

lou2606 commented Oct 6, 2024

It seems there is a problem with the snsynth/mwem.py script. When running it, I encountered the following error:

574 if any([a > 0 for a in mins_data]):
    575     warnings.warn("Data should be preprocessed to have 0 based indices.")
--> 576 dimensionality = np.product(dims_sizes)
    577 if dimensionality > 1e8:
    578     warnings.warn(f"Dimensionality of histogram is {dimensionality:,}, consider using splits.")

File /opt/conda/lib/python3.12/site-packages/numpy/__init__.py:414, in __getattr__(attr)
    411     import numpy.char as char
    412     return char.chararray
--> 414 raise AttributeError("module {!r} has no attribute "
    415                      "{!r}".format(__name__, attr))
AttributeError: module 'numpy' has no attribute 'product' 

This error occurs because numpy.product has been deprecated in NumPy version 1.25.0.
The fix is straightforward—simply change np.product on line 576 to np.prod.

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

No branches or pull requests

1 participant