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

cannot import name 'product' from 'numpy' #106

Open
rflameiro opened this issue Sep 4, 2024 · 2 comments
Open

cannot import name 'product' from 'numpy' #106

rflameiro opened this issue Sep 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@rflameiro
Copy link

📖 Documentation

Found this error when using transformer = MoleculeTransformer(featurizer='mordred', dtype=float)
Apparently product was removed in numpy 2.0: astropy/astropy#16062
Downgrading numpy 2.1.0 to 1.22.0 solved it. I am now at my local machine and can confirm that in numpy 1.24.4 it also works.

@rflameiro rflameiro added the enhancement New feature or request label Sep 4, 2024
@joushvak17
Copy link

I'm also facing a similar issue when using the following import: from molfeat.trans.pretrained.hf_transformers import PretrainedHFTransformer.

Tracing back to the root of the problem, it seems that molfeat is using the mordred repository, which, according to the comments on their issues, is no longer being maintained. However, there is a fork of this repository, mordred-community, which seems to address necessary updates.

The mordred library has an import statement from numpy import product, which should be from numpy import prod. I found the files on my local machine where this error occurs within the mordred library, such as their MolecularDistanceEdge class, and changed the statement in line 2.

Will molfeat continue using the original mordred library, or will there be an update to use the community version?

Thank you!

@mcasademont9
Copy link

joushvak17 thanks for your comment! It worked for me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants