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

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

Merged
merged 4 commits into from
Oct 22, 2023

Conversation

daico007
Copy link
Member

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


  • Includes appropriate unit test(s)
  • Appropriate docstring(s) are added/updated
  • Code is (approximately) PEP8 compliant
  • Issue(s) raised/addressed?

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1149   +/-   ##
=======================================
  Coverage   87.19%   87.19%           
=======================================
  Files          62       62           
  Lines        6490     6490           
=======================================
  Hits         5659     5659           
  Misses        831      831           
Files Coverage Δ
mbuild/compound.py 97.13% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daico007
Copy link
Member Author

Relate to #1150

Copy link
Contributor

@chrisjonesBSU chrisjonesBSU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I wonder if a more descriptive parameter name would make more sense here since verbose probably means different things to different people. It could be something like validate_box_size ?

@daico007
Copy link
Member Author

good call! I will change the var name.

@chrisjonesBSU chrisjonesBSU linked an issue Oct 19, 2023 that may be closed by this pull request
@daico007 daico007 changed the title Add verbose option for add method in Compound.add() Add check_box_size option for add method in Compound.add() Oct 22, 2023
@daico007 daico007 merged commit 022df2b into mosdef-hub:main Oct 22, 2023
15 checks passed
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

Successfully merging this pull request may close these issues.

Compound.add scale quite badly with big list
2 participants