mosdef-hub / mbuild

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

Add `check_box_size` option for `add` method in `Compound.add()` #1149

Closed daico007 closed 10 months ago

daico007 commented 10 months ago

PR Summary:

Add verbose option for add method in Compound.add(). When provided a list of compound to Compound, the method would recursively calling itself to add each compound. During this process, there is a final step to check if the new compound bounding box is bigger than the Compound.Box. The time for Compound.get_boundingbox(), however, would really add up in this process (scale up really badly if you get to the >10,000 range). Hence, I am adding an verbose option for this method to be able to turn it off when adding individual particle if a list/iterable is provided.

PR Checklist


codecov[bot] commented 10 months ago

Codecov Report

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

Comparison is base (c426c3a) 87.19% compared to head (33c7d76) 87.19%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1149 +/- ## ======================================= Coverage 87.19% 87.19% ======================================= Files 62 62 Lines 6490 6490 ======================================= Hits 5659 5659 Misses 831 831 ``` | [Files](https://app.codecov.io/gh/mosdef-hub/mbuild/pull/1149?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub) | Coverage Δ | | |---|---|---| | [mbuild/compound.py](https://app.codecov.io/gh/mosdef-hub/mbuild/pull/1149?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mosdef-hub#diff-bWJ1aWxkL2NvbXBvdW5kLnB5) | `97.13% <100.00%> (ø)` | |

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

daico007 commented 10 months ago

Relate to #1150

daico007 commented 10 months ago

good call! I will change the var name.