-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add serialization for Topology #567
Add serialization for Topology #567
Conversation
Codecov Report
@@ Coverage Diff @@
## master #567 +/- ##
==========================================
+ Coverage 90.29% 90.49% +0.19%
==========================================
Files 54 56 +2
Lines 4205 4408 +203
==========================================
+ Hits 3797 3989 +192
- Misses 408 419 +11
Continue to review full report at Codecov.
|
This pull request introduces 1 alert when merging f26edf9 into 538049e - view on LGTM.com new alerts:
|
This PR also brings in the concept of Registries to save/load files. Only the |
The following gist contains simple test cases. |
Just tried this out but one thing i noticed is that the potential types are not being brought over in the json files. Is that expected? an example: from mbuild.lib.molecules import Ethane
from gmso.external import from_parmed
import foyer
oplsaa = foyer.forcefields.load_OPLSAA()
eth_typed = oplsaa.apply(Ethane())
topology_typed = from_parmed(topology_typed, refer_types=True)
topology_typed.save("eth.json", overwrite=True, indent=4) |
Yeah this is expected. You have to explicitly specify |
Very true! I forgot about that flag! Working well for me! |
After PR mosdef-hub#567, which brought in the addition of concept of Registries to save/load files; Only the json methods are currently using the registries but can be extended to other formats as well. This PR introduces the overhaul to the `xyz` file format, one of the simpler cases. So far, this seems to have worked quite well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New changes look good. When all checks pass LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it out locally, LGTM!
After PR mosdef-hub#567, which brought in the addition of concept of Registries to save/load files; Only the json methods are currently using the registries but can be extended to other formats as well. This PR introduces the overhaul to the `xyz` file format, one of the simpler cases. So far, this seems to have worked quite well.
* Convert xyz file I/O to use the load/save methods After PR #567, which brought in the addition of concept of Registries to save/load files; Only the json methods are currently using the registries but can be extended to other formats as well. This PR introduces the overhaul to the `xyz` file format, one of the simpler cases. So far, this seems to have worked quite well. * Overhaul write_gro and read_gro to use the new registry system. * Update top, gsd, mcf, lammps tests and writer/readers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use deepcopy of the topology when modifying the position for gro files * Support stacking loads_as, saves_as decorators for multiple file extensions * Use cheaper deepcopy alternative, simplify decorator for multiple file extensions Co-authored-by: Co Quach <[email protected]> Co-authored-by: Umesh Timalsina <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This PR attempts to implement a full serialization for topology. Two methods are available: