-
Notifications
You must be signed in to change notification settings - Fork 81
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1208 +/- ##
==========================================
- Coverage 85.73% 83.29% -2.45%
==========================================
Files 53 53
Lines 4802 4806 +4
==========================================
- Hits 4117 4003 -114
- Misses 685 803 +118 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
I think this is the correct approach, and is what I would expect after flattening the hierarchy. |
There was a problem hiding this 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.
… 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>
for more information, see https://pre-commit.ci
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