mosdef-hub / gmso

Flexible storage of chemical topology for molecular simulation
https://gmso.mosdef.org
MIT License
53 stars 32 forks source link

Add `to_xml` method to Topology #782

Closed chrisjonesBSU closed 7 months ago

chrisjonesBSU commented 8 months ago

This is a small PR that simplifies the workflow of saving a topology specific xml file by adding a to_xml method to Topology. This method just calls both Toplogy.get_forcefield and gmso.core.forcefield.to_xml, so the unit tests don't check for things like consistency of the new XML file since that is already tested in test_forcefield.py.

I think it it will be helpful to have this functionality work as a single step at the Topology level.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (b20472c) 92.78% compared to head (e54e18f) 92.81%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #782 +/- ## ========================================== + Coverage 92.78% 92.81% +0.03% ========================================== Files 66 66 Lines 6859 6862 +3 ========================================== + Hits 6364 6369 +5 + Misses 495 493 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

chrisjonesBSU commented 7 months ago

It looks like the tests in test_gro.py are failing with unyt v3. If I downgrade to 2.9.5 they pass for me

daico007 commented 7 months ago

Yeah, I fixed that unyt issue in this PR https://github.com/mosdef-hub/gmso/pull/770 (https://github.com/mosdef-hub/gmso/pull/770/commits/6a674cec4f8bda5466159f8dae7fa2d7b21bc72e). That PR is just merged, so if you update the branch to main that should be fixed.