Skip to content

Add missing *AsString methods - #1442

Open
hsorby wants to merge 26 commits into
cellml:mainfrom
hsorby:issue1438
Open

hsorby wants to merge 26 commits into
cellml:mainfrom
hsorby:issue1438

Conversation

@hsorby

@hsorby hsorby commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Interestingly this picked up a couple of bugs with the enumeration mappings.

@hsorby hsorby added New feature Additional feature Miscellaneous labels Jun 16, 2026
@hsorby hsorby removed the New feature Additional feature label Sep 22, 2026
@hsorby
hsorby requested review from agarny and nickerso September 22, 2026 22:14

@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 fine overall, just a few minor requests for changes.

Comment thread src/api/libcellml/units.h Resolved
Comment thread src/api/libcellml/variable.h Resolved
Comment thread src/bindings/javascript/issue.cpp Resolved
Comment thread tests/as_string/tests.cmake Resolved
agarny
agarny previously approved these changes Sep 23, 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.

🟡 Changes recommended

ReferenceRule::UNDEFINED currently converts to an empty string, and several mappings remain untested.

5 open findings
What changed in this PR

Adds string conversion APIs for previously unsupported public enumerations across C++, Python, and JavaScript.

Changes:

  • Adds conversions for issue levels/rules, unit prefixes/standard units, and variable interfaces.
  • Completes enumeration bindings and mapping data.
  • Adds cross-language tests and adjusts coverage detection.
File Description
tests/​CMakeLists.txt Registers conversion tests.
tests/​as_string/​tests.cmake Configures the new test target.
tests/​as_string/​as_string.cpp Tests C++ conversions.
tests/​bindings/​python/​test_variable.py Tests Python variable conversion.
tests/​bindings/​python/​test_units.py Tests Python unit conversions.
tests/​bindings/​python/​test_issue.py Tests Python issue conversions.
tests/​bindings/​javascript/​variable.test.js Tests JavaScript variable conversion.
tests/​bindings/​javascript/​units.test.js Tests JavaScript unit conversions.
tests/​bindings/​javascript/​issue.test.js Tests JavaScript issue conversions.
src/​variable.cpp Implements interface conversion.
src/​units.cpp Implements unit conversions.
src/​issue.cpp Implements issue conversions and repairs mappings.
src/​bindings/​javascript/​variable.cpp Exposes variable conversion.
src/​bindings/​javascript/​units.cpp Exposes unit conversions.
src/​bindings/​javascript/​issue.cpp Completes issue enum bindings and conversions.
src/​bindings/​interface/​variable.i Documents Python variable conversion.
src/​bindings/​interface/​units.i Documents Python unit conversions.
src/​bindings/​interface/​types.i Corrects the issue enum range.
src/​bindings/​interface/​issue.i Documents Python issue conversions.
src/​api/​libcellml/​variable.h Declares variable conversion API.
src/​api/​libcellml/​units.h Declares unit conversion APIs.
src/​api/​libcellml/​issue.h Declares issue conversion APIs.
cmake/​environmentchecks.cmake Retries failed Python coverage detection.

🧠 Review effort: Balanced


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

Comment thread src/issue.cpp Resolved
Comment thread tests/as_string/as_string.cpp Resolved
Comment thread tests/as_string/as_string.cpp Resolved
Comment thread cmake/environmentchecks.cmake Resolved
Comment thread tests/bindings/javascript/issue.test.js Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@hsorby
hsorby requested review from agarny and a balanced review from Copilot October 13, 2026 08:27

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.

🟡 Changes recommended

The Python public ReferenceRule mapping still omits XML and all generator rules.

1 open finding
5 resolved since last review

🧠 Review effort: Balanced

Comment thread tests/bindings/python/test_issue.py Resolved

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 APIs, bindings, enum mappings, and comprehensive tests are complete and consistent.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide [enumeration name]AsString for all enumerations

3 participants