-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pass cosmetic attrs through to Potential
objects
#917
Comments
My current hacky workaround: def to_interchange(ff, top):
inter = openff.interchange.Interchange.from_smirnoff(ff, top)
for col_k, col_v in inter.collections.items():
for pot_k, pot_v in col_v.potentials.items():
if " " not in pot_k.id:
handler = ff[pot_k.associated_handler]
param = handler[pot_k.id]
else:
smirks, lp, match = pot_k.id.split(" ")
handler = ff["VirtualSites"]
(param,) = handler.get_parameter(
{"smirks": smirks, "name": lp, "match": match}
)
if not hasattr(param, "_cosmetic_attribs"):
continue
for attr in param._cosmetic_attribs:
pot_v.parameters[attr] = getattr(param, f"_{attr}")
return inter |
Seems fair, I don't use cosmetic attributes so this never occurred to me. I figure the last loop in that block of code should do the trick, and having it turned on by default makes sense |
@SimonBoothroyd Looking at this more closely now - does it make sense to have it on the |
Description
Currently cosmetic attributes on force field parameters do not propagate through to a
Potential
objects parameters. Currently we need to re-look them up from the original force field.It would be great if these could be passed through.
The text was updated successfully, but these errors were encountered: