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

fix label handling during flatten #1208

Merged
merged 8 commits into from
Dec 6, 2024
Merged

Conversation

CalCraven
Copy link
Contributor

PR Summary: This code fixes a bug raised in #1206. This seems to be caused by the multiple hierarchies in this structure, which results in labels for each molecule. Then, after flattening, these compound labels refer to compounds not in the tree structure anymore, which get picked up after mb.clone is used on them, and causes errors in the particles themselves.

Need some feedback to suggest if just clearing out the labels is the correct approach for the flatten_hierarchy function. As you can see, that effects what you can access from the compound, but may be a limitation we're forced to accept.

PR Checklist


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

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.69%. Comparing base (a4c41c5) to head (0019940).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1208      +/-   ##
==========================================
- Coverage   85.73%   85.69%   -0.05%     
==========================================
  Files          53       53              
  Lines        4802     4795       -7     
==========================================
- Hits         4117     4109       -8     
- Misses        685      686       +1     

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

@chrisjonesBSU
Copy link
Contributor

Need some feedback to suggest if just clearing out the labels is the correct approach for the flatten_hierarchy function. As you can see, that effects what you can access from the compound, but may be a limitation we're forced to accept.

I think this is the correct approach, and is what I would expect after flattening the hierarchy.

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 tried this out with some similar applications discussed in the issue..I think the behavior now is what I would expect after calling flatten() on compound with children that had their own distinct labels.

CalCraven and others added 4 commits November 21, 2024 15:55
… lists with the format 'all-{name}s' for clarity
* update CI and precommit files

* add ruff changes

* remove gmso lines

* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci

* change error type in test

* raise the error that is created

* remove duplicate windows 3.12 test

* fix precommit errors

* fix import error

* fix CI error

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@CalCraven
Copy link
Contributor Author

Something sticky is happening with the labels on the Ubuntu tests. Will need to dig into this, as this PR needs to get merged to allow for the mBuild 1.0 GMSO PR to complete, which is holding up some GMSO PR's.

@CalCraven CalCraven merged commit d33ba07 into mosdef-hub:main Dec 6, 2024
15 of 16 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.

2 participants