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

Performance loading from .json file #1162

Closed
daico007 opened this issue Dec 15, 2023 · 0 comments
Closed

Performance loading from .json file #1162

daico007 opened this issue Dec 15, 2023 · 0 comments

Comments

@daico007
Copy link
Member

Bug summary
I bumped into a performance issue when trying to load from a json file, which is quite bad for bigger/nested system. This is due to the bond_graph.compose step when adding each particle/children into the main compound. We need to add in some workaround to speed this process up.

Code to reproduce the behavior

Please include a code snippet that can be used to reproduce this bug.

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 will take a minute. 
@daico007 daico007 mentioned this issue Dec 15, 2023
4 tasks
@daico007 daico007 closed this as completed Feb 5, 2024
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

1 participant