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

EspalomaCharge toolkit wrapper generates np.float32 charges, but np.float64 are expected #7

Open
jchodera opened this issue Dec 27, 2022 · 1 comment

Comments

@jchodera
Copy link
Member

I'm tracking down an odd issue where it seems like the pint.Quantity wrapped np.float32 is causing problems when molecule.to_openeye() is called afterwards:

Traceback (most recent call last):
  File "/lila/data/chodera/chodera/espaloma_charge/scripts/hydration-free-energies/compare-models.py", line 265, in <module>
    cli()
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/lila/data/chodera/chodera/espaloma_charge/scripts/hydration-free-energies/compare-models.py", line 194, in errors
    oemol = charged_molecule.to_openeye()
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/openff/toolkit/topology/molecule.py", line 4791, in to_openeye
    return toolkit_registry.call(
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/openff/toolkit/utils/toolkit_registry.py", line 356, in call
    raise e
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/openff/toolkit/utils/toolkit_registry.py", line 352, in call
    return method(*args, **kwargs)
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/openff/toolkit/utils/openeye_wrapper.py", line 1504, in to_openeye
    oe_atom.SetPartialCharge(
  File "/lila/home/chodera/miniconda/envs/hydration/lib/python3.10/site-packages/openeye/oechem.py", line 13912, in SetPartialCharge
    return _oechem.OEAtomBase_SetPartialCharge(self, arg2)
TypeError: in method 'OEAtomBase_SetPartialCharge', argument 2 of type 'double'

but np.float64 generated by the other toolkit wrappers appears to be fine.

I'll try to create a minimal test case here once I figure out what is going on.

In the meantime, I'll make changes to follow this convention used in the toolkit in the hydration branch.

@mikemhenry
Copy link
Contributor

@jchodera did you ever track this down? or an easy reproducer we can add to our CI?

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

2 participants