mosdef-hub / mbuild

A hierarchical, component based molecule builder
https://mbuild.mosdef.org
Other
173 stars 81 forks source link

Speed up json loader #1163

Closed daico007 closed 9 months ago

daico007 commented 11 months ago

PR Summary:

Address #1162. Add some workaround to the ind particle bond graph before adding to the main compound and speed up the loader in general.


import mbuild as mb#
eth = mb.load("CC", smiles=True)
eth.name = "Ethane"
eth_box = mb.packing.fill_box(
    compound=eth,
    n_compounds=1000,
    box=[5, 5, 5]
)
eth_box.name = "EthaneBox"
eth_box.save("eth_box1000.json", overwrite=True)

comp = mb.load("eth_box1000.json") # This now takes a few second. 

PR Checklist


codecov[bot] commented 11 months ago

Codecov Report

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

Comparison is base (9d20e3d) 87.18% compared to head (0908345) 87.27%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1163 +/- ## ========================================== + Coverage 87.18% 87.27% +0.09% ========================================== Files 62 62 Lines 6492 6499 +7 ========================================== + Hits 5660 5672 +12 + Misses 832 827 -5 ```

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