Skip to content

BUG: combine cmaps when merging Universes (Issue #3672)#5415

Open
apoorva-01 wants to merge 1 commit into
MDAnalysis:developfrom
apoorva-01:bugfix/3672-cmaps-merge
Open

BUG: combine cmaps when merging Universes (Issue #3672)#5415
apoorva-01 wants to merge 1 commit into
MDAnalysis:developfrom
apoorva-01:bugfix/3672-cmaps-merge

Conversation

@apoorva-01

@apoorva-01 apoorva-01 commented Jul 2, 2026

Copy link
Copy Markdown

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. cmaps is a connection attribute too, but it wasn't in that set, so merging a Universe that carries cmaps raised TypeError: Encountered unexpected topology attribute of type ...TopologyGroup. This adds cmaps to the set so it's combined the same way as the others, with a regression test that fails without the change.

UreyBradleys is another _Connection missing from that set, so it has the same latent bug. I kept this PR to just cmaps, but I'm happy to generalise it (derive the set from the _Connection subclasses) 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

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added? (bug fix, no API change)
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS?
  • LLM/AI disclosure was updated.

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.

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

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.85%. Comparing base (32b7808) to head (94ac5b6).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

cmaps are not correctly merged with Merge()

1 participant