choderalab / espaloma_charge

Standalone charge assignment from Espaloma framework.
MIT License
38 stars 5 forks source link

Toolkit wrapper should not issue `IncorrectNumConformersWarning` #20

Open jchodera opened 1 year ago

jchodera commented 1 year ago

From #19:

By the way, also the warning Espaloma gives (for which I'm deleting here the conformer) seems a bit excessive. It feels to me like it could just silently ignore the existence of conformers in the molecule.

IncorrectNumConformersWarning: Molecule 'Molecule with name 'BEN_pH7_4.sdf' and SMILES '[H][c]1[c]([H])[c]([H])[c]([C]([N]([H])[H])=[N+]([H])[H])[c]([H])[c]1[H]'' has 1 conformers, but charge method 'espaloma-am1bcc' expects exactly 0
mikemhenry commented 1 year ago

This warning should be easy enough to ignore with a context manager filtering warnings, do we think that there is any case where this warning could be useful?

jchodera commented 1 year ago

Nope!

Instead of suppressing the warning, should there be a way to tell ToolkitWrapper there is no need to check this?

j-wags commented 1 year ago

Ah, this is happening because mol_copy in the wrapper isn't bring updated with the user-defined confs (which defaults to None). You can fix this by putting mol_copy._conformers = use_conformers here.