BUG: combine cmaps when merging Universes (Issue #3672)#5415
Conversation
Merge() only remapped bonds/angles/dihedrals/impropers, so a Universe carrying cmaps fell through to the plain-array path and raised a TypeError. Add cmaps to that set so it's merged like the other connection groups.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5415 +/- ##
========================================
Coverage 93.85% 93.85%
========================================
Files 182 182
Lines 22509 22509
Branches 3202 3202
========================================
Hits 21125 21125
Misses 922 922
Partials 462 462 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
orbeckst
left a comment
There was a problem hiding this comment.
Code and tests look good.
Can you please check the formatting? The linter seems unhappy. Once that passes, I'm happy to merge.
The read the docs failure is not due to your PR.
Can you please raise an issue for UB's? Then make a separate PR addressing that issue separately. Thanks! |
|
Your first contribution has been merged @apoorva-01 🎉 ! Thank you! |
Fixes #3672
Changes made in this Pull Request:
Merge()remaps the connection attributes (bonds, angles, dihedrals, impropers) onto the merged Universe and concatenates everything else as a plain array.cmapsis a connection attribute too, but it wasn't in that set, so merging a Universe that carries cmaps raisedTypeError: Encountered unexpected topology attribute of type ...TopologyGroup. This addscmapsto the set so it's combined the same way as the others, with a regression test that fails without the change.UreyBradleysis another_Connectionmissing from that set, so it has the same latent bug. I kept this PR to justcmaps, but I'm happy to generalise it (derive the set from the_Connectionsubclasses) or do a follow-up if you'd rather.LLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: no
PR Checklist
package/CHANGELOGfile updated?package/AUTHORS?Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.