Skip to content

Fix parsing of connections where variables have the same name in different components - #1500

Merged
hsorby merged 6 commits into
cellml:mainfrom
hsorby:1499-non-strict-connections
Oct 15, 2026
Merged

hsorby merged 6 commits into
cellml:mainfrom
hsorby:1499-non-strict-connections

Conversation

@hsorby

@hsorby hsorby commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

@hsorby hsorby added the Bug label Oct 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused parser correction is consistent with component-relative mapping semantics and has appropriate regression coverage.

0 open findings

What changed in this PR

Fixes false duplicate-connection errors by preserving component-relative variable ordering.

Changes:

  • Removes alphabetical normalization of mapped variable pairs.
  • Adds CellML 1.1 and generated CellML 2.0 regression coverage.
  • Updates the expected duplicate diagnostic ordering.
File Description
src/​parser.cpp Preserves variable_1/variable_2 ordering.
tests/​connection/​connection.cpp Adds regression tests and updates expectations.
tests/​resources/​cellml1X/​connections.cellml Provides a two-way CellML 1.1 fixture.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@agarny

agarny commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Is this ready to be reviewed?

@hsorby
hsorby requested a review from agarny October 13, 2026 01:53

@agarny agarny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

@jmdowrick jmdowrick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch.

@hsorby
hsorby merged commit 16aed0b into cellml:main Oct 15, 2026
14 checks passed
@hsorby
hsorby deleted the 1499-non-strict-connections branch October 15, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connections from CellML 1.0/1.1 models are reported as an error when not unique

4 participants