Skip to content

Add support for CellML imports - #638

Merged
agarny merged 8 commits into
opencor:mainfrom
agarny:issue541
Nov 11, 2026
Merged

agarny merged 8 commits into
opencor:mainfrom
agarny:issue541

Conversation

@agarny

@agarny agarny commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #541.

Copilot AI lite review requested due to automatic review settings November 11, 2026 06:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A moderate active defect remains in pathFromUrl(), which can miscompute relative-import paths when a URI query or fragment contains a slash.

1 open issue
What changed in this PR

Adds support for resolving CellML imports across local files, remote URLs, in-memory files, nested imports, cyclic dependencies, and COMBINE archives.

Changes:

  • Added recursive CellML import retrieval, parsing, caching, cycle handling, and error propagation.
  • Added shared URI and file-location resolution utilities for CellML and SED-ML processing.
  • Expanded C++, Python, and JavaScript test coverage with imported-model fixtures and error cases.
File Description
VERSION.txt Updates the project version.
tests/​support/​cellml/​basictests.cpp Adds tests for local, remote, nested, in-memory, invalid, and cyclic CellML imports.
tests/​res/​support/​cellml/​model_with_various_imports/​other_component.cellml Provides an imported component fixture with a nested units import.
tests/​res/​support/​cellml/​model_with_various_imports/​model.cellml Provides a fixture exercising multiple import paths and URL forms.
tests/​res/​support/​cellml/​model_with_unsupported_scheme_import.cellml Provides a fixture containing an import with an unsupported URI scheme.
tests/​res/​support/​cellml/​model_with_null_character_import.cellml Provides a fixture testing rejection of a percent-encoded null character in an import path.
tests/​res/​support/​cellml/​model_with_nested_imports/​units.cellml Provides units for nested import tests.
tests/​res/​support/​cellml/​model_with_nested_imports/​model.cellml Provides the root model for nested import tests.
tests/​res/​support/​cellml/​model_with_nested_imports/​components/​component.cellml Provides a component with its own units import.
tests/​res/​support/​cellml/​model_with_invalid_xml_import.cellml Provides a fixture testing imports that point to invalid XML.
tests/​res/​support/​cellml/​model_with_invalid_cellml_import/​units.cellml Provides an invalid CellML import target.
tests/​res/​support/​cellml/​model_with_invalid_cellml_import/​model.cellml Provides a model that imports invalid CellML.
tests/​res/​support/​cellml/​model_with_import_cycle/​b.cellml Defines one side of an import cycle fixture.
tests/​res/​support/​cellml/​model_with_import_cycle/​a.cellml Defines the other side of an import cycle fixture.
tests/​bindings/​python/​test_sed_instance.py Adds Python integration tests for executing simulations using imported CellML models.
tests/​bindings/​javascript/​sed.instance.test.js Adds JavaScript integration tests for executing simulations using imported CellML models.
tests/​api/​sed/​instancetests.cpp Adds C++ API integration tests for imported CellML models and COMBINE archives.
src/​support/​sedml/​sedmlfile.cpp Uses shared URI resolution when locating SED-ML model sources.
src/​support/​sedml/​sedmlfile_p.h Stores shared file-location metadata for SED-ML files.
src/​support/​combine/​combinearchive.cpp Defers archive child type detection until all child contents are available.
src/​support/​cellml/​cellmlfile.cpp Implements recursive CellML import retrieval, caching, parsing, registration, and resolution.
src/​support/​cellml/​cellmlfile_p.h Declares CellML import-resolution support.
src/​misc/​utils.h Declares shared file-location and URI-resolution utilities.
src/​misc/​utils.cpp Implements shared file-location construction and URI-reference resolution.

Review effort: Lite

Comment thread src/support/cellml/cellmlfile.cpp Resolved
@agarny
agarny merged commit f4dd912 into opencor:main Nov 11, 2026
26 checks passed
@agarny
agarny deleted the issue541 branch November 11, 2026 07:12
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.

Add support for CellML imports

2 participants