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

Convert pubchem_mass to float #9

Merged

Conversation

dianacarvalho1
Copy link
Contributor

When trying to call pubchem_metadata_lookup(), the following error is being raised:


            pubchem_mass = results_pubchem[0].exact_mass
>           match_mass = (np.abs(pubchem_mass - parent_mass) <= mass_tolerance)
E           TypeError: unsupported operand type(s) for -: 'str' and 'float'

/Users/user/anaconda3/envs/omigami/lib/python3.7/site-packages/matchmsextras/pubchem_lookup.py:328: TypeError

This is happening because results_pubchem[0].exact_mass is a string and not a float.

Copy link
Contributor

@florian-huber florian-huber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR. Fix looks good to me!

@florian-huber florian-huber merged commit 06efaa7 into matchms:main Jul 15, 2021
@florian-huber
Copy link
Contributor

@dianacarvalho1 I merged your fix and will do a small new release (0.2.3).
Please feel free to add your name/orcid to the CITATION.cff file!

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.

None yet

2 participants