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

Label Molecules breaks with plugin vsite handlers #1422

Open
jthorton opened this issue Oct 10, 2022 · 1 comment
Open

Label Molecules breaks with plugin vsite handlers #1422

jthorton opened this issue Oct 10, 2022 · 1 comment

Comments

@jthorton
Copy link
Collaborator

jthorton commented Oct 10, 2022

Describe the bug
When using a plugin vsite handler such as the one in qubekit the label molecules function in the force field fails due to a type check on the normal virtual site handler here which changes how the matches are dealt with. Ideally, we could use some check that does not explicitly depend on the class to check how to deal with the matches. Maybe a try-except would do the job like

try:
    for match in matches:
        parameter_matches[match] = matches[match].parameter_type
except: AttributeError:
    for match in matches:
        parameter_matches[match] = [m.parameter_type for m in matches[match]]

To Reproduce

Run the following with qubekit master installed

from openff.toolkit.typing.engines.smirnoff import ForceField
from openff.toolkit.topology import Molecule

methanol = Molecule.from_smiles("CO")
ff = ForceField("methanol.offxml", load_plugins=True)
ff.label_molecules(methanol.to_topology())

File ~/Documents/Projects/openff/plugins/water_test/software/openff-toolkit/openff/toolkit/typing/engines/smirnoff/forcefield.py:1518, in ForceField.label_molecules(self, topology)
1516 else:
1517 for match in matches:
-> 1518 parameter_matches[match] = matches[match].parameter_type
1520 current_molecule_labels[tag] = parameter_matches
1522 molecule_labels.append(current_molecule_labels)

AttributeError: 'list' object has no attribute 'parameter_type'

Methanol offxml attached as methanol.txt

Output

Computing environment (please complete the following information):

  • Operating system mac
  • Output of running conda list

Additional context

@mattwthompson
Copy link
Member

Which versions of the toolkit does this affect - just 0.10.6 vs earlier versions of 0.10.x?

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