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

JSON handling for parameterized topologies #795

Closed
CalCraven opened this issue Dec 21, 2023 · 5 comments
Closed

JSON handling for parameterized topologies #795

CalCraven opened this issue Dec 21, 2023 · 5 comments

Comments

@CalCraven
Copy link
Contributor

Seems like there's an issue saving the JSON state of a topology, where the parameters aren't stored at all. Maybe this is a good place to discuss if that's a feature we would want to have.

import gmso
from gmso.parameterization import apply
top = gmso.Topology.load("ethane.json")
assert not top.is_typed()
ff = gmso.ForceField("ethane.xml")
ptop = apply(top, ff, identify_connections=True)
assert ptop.is_typed()
ptop.save("ethane-typed.json")
newtop = gmso.Topology("ethane-typed.json")
print(newtop.is_typed("topology"))

output

False
@daico007
Copy link
Member

I think this is already supported, likely need to change the default options and clarify the documentation for this method (https://github.com/mosdef-hub/gmso/blob/main/gmso/formats/json.py#L24-L42)

@CalCraven
Copy link
Contributor Author

You're right. However, maybe we should make this clear at the topology.save() documentation, because that's the standard way to write things out and it's easy to miss that only a partial topology was saved without the keyword.

@daico007
Copy link
Member

Yes, totally support changing the default to True (for saving out a typed structure)

@daico007
Copy link
Member

This has been updated in the latest commit in #794

@daico007
Copy link
Member

Addressed in #794

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