├── tests ├── resources │ ├── importer │ │ ├── not_even_proper.xml │ │ ├── source_units.cellml │ │ ├── diamond_point.cellml │ │ ├── NotCircularReference.cellml │ │ ├── layer1 │ │ │ ├── layer2 │ │ │ │ ├── layer3 │ │ │ │ │ └── model.cellml │ │ │ │ └── model.cellml │ │ │ ├── model.cellml │ │ │ ├── layer1 │ │ │ │ └── importing_bad_design_z_import_hierarchy.cellml │ │ │ ├── import_from_component_library.cellml │ │ │ ├── importing_bad_design_z_import_hierarchy.cellml │ │ │ └── component_library.cellml │ │ ├── units_source.cellml │ │ ├── units_concrete.cellml │ │ ├── model_with_components_2.cellml │ │ ├── components_source.cellml │ │ ├── component_that_is_invalid.cellml │ │ ├── components_concrete.cellml │ │ ├── model2.cellml │ │ ├── source.cellml │ │ ├── triangle_units_base.cellml │ │ ├── thingsThatGrowOnBranches.cellml │ │ ├── simple_model_2.cellml │ │ ├── component_importer.cellml │ │ ├── model.cellml │ │ ├── referenced_units_missing.cellml │ │ ├── component_importer_unresolved.cellml │ │ ├── diamond_left.cellml │ │ ├── diamond_right.cellml │ │ ├── import_invalid_xml.cellml │ │ ├── import_invalid_units.cellml │ │ ├── invalid_import_url.cellml │ │ ├── ImportCircularReferences.cellml │ │ ├── import_invalid_component.cellml │ │ ├── CircularReference.cellml │ │ ├── CircularReference2.cellml │ │ ├── importing_component_with_missing_units.cellml │ │ ├── importing_units_with_present_children.cellml │ │ ├── importing_units_with_missing_children.cellml │ │ ├── importing_component_with_missing_children.cellml │ │ ├── importing_units_with_unresolved_children.cellml │ │ ├── circularUnits_2.cellml │ │ ├── prong.cellml │ │ ├── circularUnits_3.cellml │ │ ├── importing_units_with_child_units_missing_model.cellml │ │ ├── circularImport_2.cellml │ │ ├── circularImport_3.cellml │ │ ├── importing_component_with_imported_units_missing_model.cellml │ │ ├── importing_a_component_that_is_invalid.cellml │ │ ├── mediumbondgraph │ │ │ ├── cpp_coupling_parameters.cellml │ │ │ └── cpp_coupling_modules.cellml │ │ ├── simplebondgraph │ │ │ ├── cpp_coupling_parameters.cellml │ │ │ ├── cpp_coupling.cellml │ │ │ └── cpp_coupling_modules.cellml │ │ ├── triangle_units_opposite.cellml │ │ ├── master2.cellml │ │ ├── master_units.cellml │ │ ├── importing_a_component_that_is_not_there.cellml │ │ ├── main_referenced_units_missing.cellml │ │ ├── master1.cellml │ │ ├── master_units_unresolved.cellml │ │ ├── importing_bad_design_z_offset_import_hierarchy.cellml │ │ ├── nested_units.cellml │ │ ├── triangle_units_opposite_I.cellml │ │ ├── circularUnits_1.cellml │ │ ├── circularUnits_1_duplicated_name.cellml │ │ ├── model1.cellml │ │ ├── circularImport_1.cellml │ │ ├── missingImport_1.cellml │ │ ├── circularImport_1_duplicated_name.cellml │ │ ├── units │ │ │ ├── left_model.cellml │ │ │ ├── units_definitions.cellml │ │ │ ├── main.cellml │ │ │ ├── right_model.cellml │ │ │ ├── base_model.cellml │ │ │ └── base_model_illdefined.cellml │ │ ├── diamond.cellml │ │ ├── units_imported.cellml │ │ ├── importing_bad_design_z_import_hierarchy.cellml │ │ ├── import_invalid_import_url.cellml │ │ ├── importing_nonexistent_items.cellml │ │ ├── units_definition_level_1.cellml │ │ ├── units_library.cellml │ │ ├── periodicstimulus │ │ │ ├── components │ │ │ │ ├── units.xml │ │ │ │ └── INa.xml │ │ │ └── experiments │ │ │ │ └── periodic-stimulus.xml │ │ ├── units_definition_level_1_child.cellml │ │ ├── components_imported.cellml │ │ ├── units_definition_level_1_unresolved.cellml │ │ ├── forkedImport.cellml │ │ ├── import_units_that_are_invalid.cellml │ │ ├── import_units_that_are_not_there.cellml │ │ ├── model_cascaded_units.cellml │ │ ├── simple_model.cellml │ │ ├── import_units_that_have_unknown_children.cellml │ │ ├── nested_components.cellml │ │ ├── triangle_units_point.cellml │ │ ├── triangle_units_point_I.cellml │ │ ├── trunk.cellml │ │ ├── complicated.cellml │ │ ├── component_library.cellml │ │ ├── components_missing_children.cellml │ │ ├── generic.cellml │ │ ├── model_with_components_1.cellml │ │ ├── model_with_components_1_unresolved.cellml │ │ ├── generic_no_source.cellml │ │ ├── importing_bad_design_c_shape_import_hierarchy.cellml │ │ ├── units_children.cellml │ │ ├── components_missing_units.cellml │ │ ├── bondgraph │ │ │ └── cpp_coupling_parameters.cellml │ │ ├── complexbondgraph │ │ │ └── cpp_coupling_parameters.cellml │ │ └── common_units_import_1.xml │ ├── invalid_cellml_2.0.xml │ ├── coverage │ │ ├── non_model_root.xml │ │ ├── cmeta_id_cellml2.xml │ │ ├── cellml1x_import_component.xml │ │ ├── invalidxmlids.cellml │ │ └── converttoint.cellml │ ├── modelflattening │ │ ├── basic_membrane_model.cellml │ │ ├── basic_sodium_channel.cellml │ │ ├── circularImport1.cellml │ │ ├── circularImport2.cellml │ │ ├── importExample2b.cellml │ │ ├── circularImport2units.cellml │ │ ├── unitsdefinedinimportedmodel.xml │ │ ├── importExampleUnits.cellml │ │ ├── importedcomponentusingimportedcomponent.xml │ │ ├── circularImport1units.cellml │ │ ├── import_for_importedcomponentusingimportedcomponent.xml │ │ ├── import_for_importedunitswithnameclashes.xml │ │ ├── import_for_unitsdefinedinimportedmodel.xml │ │ ├── import_for_importedcomponentswithnameclashes.xml │ │ ├── user_ex_01 │ │ │ ├── child.cellml │ │ │ └── parent.cellml │ │ ├── imported_hierarchy_model.cellml │ │ ├── repeatedimportofsameunitsviadifferentcomponents.xml │ │ ├── importedunitswithnameclashes.xml │ │ ├── importedcomponentswithnameclashes.xml │ │ ├── import_for_repeatedimportofsameunitsviadifferentcomponents.xml │ │ ├── internalequivalentvariables.xml │ │ ├── outsidecomponentequivalentvariables.xml │ │ └── equivalentimportedvariable.xml │ ├── analyser │ │ ├── underconstrained.cellml │ │ ├── units │ │ │ └── rhs.cellml │ │ ├── undefined_variables.cellml │ │ ├── not_equality_statement.cellml │ │ ├── unsuitably_constrained.cellml │ │ ├── overconstrained.cellml │ │ ├── non_initialised_state.cellml │ │ ├── variable_initialised_using_a_non_existing_variable.cellml │ │ └── initialised_variable_of_integration.cellml │ ├── import_units_model.cellml │ ├── sine_approximations_import_simple.xml │ ├── units_definitions.cellml │ ├── generator │ │ ├── cellml_slc_example │ │ │ └── slc_model_units_only.cellml │ │ ├── algebraic_eqn_constant_on_rhs │ │ │ ├── model.cellml │ │ │ ├── model.py │ │ │ └── model.h │ │ ├── algebraic_eqn_const_var_on_rhs │ │ │ ├── model.cellml │ │ │ └── model.h │ │ ├── algebraic_eqn_computed_var_on_rhs │ │ │ ├── model.cellml │ │ │ └── model.h │ │ ├── algebraic_unknown_var_on_rhs │ │ │ ├── model.cellml │ │ │ └── model.h │ │ ├── ode_constant_on_rhs_one_component │ │ │ └── model.cellml │ │ ├── ode_const_var_on_rhs_one_component │ │ │ └── model.cellml │ │ ├── cell_geometry_model │ │ │ └── model.h │ │ ├── cellml_unit_scaling_constant │ │ │ └── model.h │ │ ├── algebraic_eqn_with_one_non_isolated_unknown │ │ │ └── model.h │ │ ├── algebraic_system_with_three_linked_unknowns │ │ │ └── model.h │ │ └── algebraic_system_with_various_dependencies │ │ │ ├── model.ordered.h │ │ │ └── model.not.ordered.h │ ├── requires_imports.cellml │ ├── dirty_model.cellml │ ├── import-requirements │ │ ├── complicatedExample.cellml │ │ ├── importExample1.cellml │ │ └── importExample2.cellml │ ├── units_in_cn.cellml │ ├── importingModel.cellml │ ├── sin.xml │ ├── importingModelChildComponent.cellml │ ├── importingModelParentComponent.cellml │ ├── dirty_encapsulated_model.cellml │ ├── complex_encapsulation.xml │ ├── multiplecellmlnamespaces.cellml │ ├── printer │ │ └── component_with_multiple_math.cellml │ ├── deriv_approx_sin.xml │ ├── importedModelWithMaps.cellml │ ├── cellml1X │ │ ├── cardiac_constant_simplified_alternative.cellml │ │ └── cardiac_constant_simplified.cellml │ ├── level1-3.xml │ └── level2.xml ├── bindings │ ├── python │ │ ├── requirements.txt │ │ ├── test_resources.cmake │ │ ├── test_resources.in.py │ │ ├── test_printer.py │ │ ├── test_version.py │ │ ├── test_import_requirement.py │ │ ├── runner.py │ │ ├── test_analyser_equation_ast.py │ │ └── test_validator.py │ ├── javascript │ │ ├── issue.test.js │ │ ├── version.test.js │ │ └── enums.test.js │ └── CMakeLists.txt ├── gcovr-4.1.1.zip ├── version │ ├── tests.cmake │ └── version.cpp ├── test_resources.cmake ├── analyser │ └── tests.cmake ├── generator │ └── tests.cmake ├── equality │ └── tests.cmake ├── isolated │ └── tests.cmake ├── libxml2issues.2.9.13.h ├── math │ └── tests.cmake ├── libxml2issues.2.9.10.h ├── clone │ └── tests.cmake ├── units │ └── tests.cmake ├── connection │ └── tests.cmake ├── variable │ └── tests.cmake ├── import_source │ └── tests.cmake ├── annotator │ └── tests.cmake ├── printer │ └── tests.cmake ├── reset │ └── tests.cmake ├── validator │ └── tests.cmake ├── component │ └── tests.cmake ├── coverage │ └── tests.cmake ├── api_headers │ ├── tests.cmake │ ├── api_header_test.in.cmake │ └── api_header_test.in.cpp ├── test_template.cmake ├── libxml2issues.2.9.11.h ├── libxml2issues.2.9.4.h ├── model │ └── tests.cmake ├── test_resources.in.h ├── importer │ └── tests.cmake └── parser │ └── tests.cmake ├── src ├── bindings │ ├── javascript │ │ ├── .npmrc │ │ ├── vue-app-with-libcellml.png │ │ ├── strict.impl │ │ ├── version.cpp │ │ ├── strict.cpp │ │ ├── printer.cpp │ │ ├── validator.cpp │ │ ├── namedentity.cpp │ │ └── entity.cpp │ ├── python │ │ ├── pyproject.toml │ │ ├── README.rst │ │ └── wheel_dependencies │ │ │ └── CMakeLists.txt │ ├── interface │ │ ├── printer.i │ │ ├── strict.i │ │ ├── version.i │ │ ├── validator.i │ │ ├── namedentity.i │ │ ├── entity.i │ │ └── parser.i │ └── CMakeLists.txt ├── mathmldtd.h ├── configure │ ├── mathmldtd.in.h │ ├── mathmldtd.in.cpp │ ├── generatorprofilesha1values.in.h │ └── versionconfig.in.h ├── version.cpp ├── entity_p.h ├── api │ └── libcellml │ │ └── undefines.h ├── generatorprofilesha1values.h └── namedentity_p.h ├── docs ├── theme │ ├── theme.conf │ └── static │ │ └── theme.css ├── images │ ├── abi.png │ ├── vpr.png │ ├── libCellMLBuilding-dllNotFound.png │ ├── libCellMLProcesses-GitBranching.png │ ├── libCellMLProcesses-GitHubRepos.png │ ├── libCellMLRoughObjectModel-Entities.png │ ├── libCellMLRoughObjectModel-IOError.png │ ├── libCellMLRoughObjectModel-Overview.png │ ├── libCellMLBuilding-CMakeOptionsInRed.png │ ├── libCellMLBuilding-PolicyCMP0086Error.png │ ├── libCellMLBuilding-PythonDebugLibrary.png │ ├── libCellMLBuilding-WindowsRunAsAdmin.png │ ├── libCellMLProcesses-DevelopmentProcess.png │ ├── libCellMLProcesses-GitHubForkButton.png │ ├── release_process │ │ ├── set_version_builder.png │ │ ├── create_release_builder.png │ │ ├── prepare_release_builder.png │ │ ├── finalise_release_builder.png │ │ ├── release_branch_chooser_example.png │ │ ├── set_version_builder_interface.png │ │ ├── create_release_builder_interface.png │ │ ├── prepare_release_builder_interface.png │ │ ├── finalise_release_builder_interface.png │ │ ├── end_to_end_database_tag_chooser_example.png │ │ └── end_to_end_framework_tag_chooser_example.png │ ├── libCellMLBuilding-CMakeGUISourceBuildDirs.png │ ├── libCellMLBuilding-CMakeWindowsLibXml2DirSet.png │ ├── libCellMLBuilding-CMakeWindowsConfigurationError.png │ └── libCellMLBuilding-CMakeWindowsLibXml2DIRNotFound.png ├── masters │ └── readme.txt ├── mainpage.dox ├── versions.rst ├── changelogs │ ├── index.rst │ ├── changelog_v0.6.2.rst │ ├── changelog_v0.3.101.rst │ ├── changelog_v0.3.104.rst │ ├── changelog_v0.3.100.rst │ ├── changelog_v0.3.102.rst │ ├── changelog_v0.3.103.rst │ └── changelog_v0.6.1.rst ├── coverage_statistics.rst └── object_model.rst ├── cmake ├── libcellml-config.cmake ├── packaging │ └── distrib │ │ ├── windows │ │ ├── libcellml.ico │ │ ├── libcellml_banner_hori.bmp │ │ └── libcellml_banner_vert.bmp │ │ ├── macos │ │ └── welcome.txt │ │ └── description.txt ├── finalise_python_package.in.cmake ├── FindSphinx.cmake ├── python_package_check.py ├── utils │ └── compress.in.h ├── generateprofilesha1header.cmake ├── macros.cmake └── checkfordebugheaderusage.cmake ├── .gitignore └── .github └── workflows └── spell-check.yml /tests/resources/importer/not_even_proper.xml: -------------------------------------------------------------------------------- 1 | This is rubbish xml. 2 | -------------------------------------------------------------------------------- /tests/resources/invalid_cellml_2.0.xml: -------------------------------------------------------------------------------- 1 | This is not a CellML file. 2 | -------------------------------------------------------------------------------- /src/bindings/javascript/.npmrc: -------------------------------------------------------------------------------- 1 | //registry.npmjs.org/:_authToken=${NPM_TOKEN} 2 | -------------------------------------------------------------------------------- /tests/bindings/python/requirements.txt: -------------------------------------------------------------------------------- 1 | 2 | exclude-until-coverage-plugin 3 | 4 | -------------------------------------------------------------------------------- /docs/theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = alabaster 3 | stylesheet = theme.css 4 | -------------------------------------------------------------------------------- /docs/images/abi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/abi.png -------------------------------------------------------------------------------- /docs/images/vpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/vpr.png -------------------------------------------------------------------------------- /docs/masters/readme.txt: -------------------------------------------------------------------------------- 1 | libCellMLProcesses.vdx is edited using https://www.lucidchart.com/. 2 | -------------------------------------------------------------------------------- /tests/gcovr-4.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/tests/gcovr-4.1.1.zip -------------------------------------------------------------------------------- /tests/bindings/python/test_resources.cmake: -------------------------------------------------------------------------------- 1 | 2 | configure_file(test_resources.in.py test_resources.py) 3 | -------------------------------------------------------------------------------- /cmake/libcellml-config.cmake: -------------------------------------------------------------------------------- 1 | @LIBXML2_CONFIG_MODE_INFORMATION@ 2 | include("${CMAKE_CURRENT_LIST_DIR}/libcellml-targets.cmake") 3 | -------------------------------------------------------------------------------- /docs/theme/static/theme.css: -------------------------------------------------------------------------------- 1 | @import url("alabaster.css"); 2 | 3 | div.figure a.image-reference { 4 | border: none; 5 | } 6 | -------------------------------------------------------------------------------- /cmake/packaging/distrib/windows/libcellml.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/cmake/packaging/distrib/windows/libcellml.ico -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-dllNotFound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-dllNotFound.png -------------------------------------------------------------------------------- /docs/images/libCellMLProcesses-GitBranching.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLProcesses-GitBranching.png -------------------------------------------------------------------------------- /docs/images/libCellMLProcesses-GitHubRepos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLProcesses-GitHubRepos.png -------------------------------------------------------------------------------- /docs/images/libCellMLRoughObjectModel-Entities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLRoughObjectModel-Entities.png -------------------------------------------------------------------------------- /docs/images/libCellMLRoughObjectModel-IOError.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLRoughObjectModel-IOError.png -------------------------------------------------------------------------------- /docs/images/libCellMLRoughObjectModel-Overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLRoughObjectModel-Overview.png -------------------------------------------------------------------------------- /src/bindings/javascript/vue-app-with-libcellml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/src/bindings/javascript/vue-app-with-libcellml.png -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-CMakeOptionsInRed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-CMakeOptionsInRed.png -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-PolicyCMP0086Error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-PolicyCMP0086Error.png -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-PythonDebugLibrary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-PythonDebugLibrary.png -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-WindowsRunAsAdmin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-WindowsRunAsAdmin.png -------------------------------------------------------------------------------- /docs/images/libCellMLProcesses-DevelopmentProcess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLProcesses-DevelopmentProcess.png -------------------------------------------------------------------------------- /docs/images/libCellMLProcesses-GitHubForkButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLProcesses-GitHubForkButton.png -------------------------------------------------------------------------------- /docs/images/release_process/set_version_builder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/set_version_builder.png -------------------------------------------------------------------------------- /docs/images/release_process/create_release_builder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/create_release_builder.png -------------------------------------------------------------------------------- /docs/images/release_process/prepare_release_builder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/prepare_release_builder.png -------------------------------------------------------------------------------- /cmake/packaging/distrib/windows/libcellml_banner_hori.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/cmake/packaging/distrib/windows/libcellml_banner_hori.bmp -------------------------------------------------------------------------------- /cmake/packaging/distrib/windows/libcellml_banner_vert.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/cmake/packaging/distrib/windows/libcellml_banner_vert.bmp -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-CMakeGUISourceBuildDirs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-CMakeGUISourceBuildDirs.png -------------------------------------------------------------------------------- /docs/images/release_process/finalise_release_builder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/finalise_release_builder.png -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-CMakeWindowsLibXml2DirSet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-CMakeWindowsLibXml2DirSet.png -------------------------------------------------------------------------------- /docs/images/release_process/release_branch_chooser_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/release_branch_chooser_example.png -------------------------------------------------------------------------------- /docs/images/release_process/set_version_builder_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/set_version_builder_interface.png -------------------------------------------------------------------------------- /tests/resources/coverage/non_model_root.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-CMakeWindowsConfigurationError.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-CMakeWindowsConfigurationError.png -------------------------------------------------------------------------------- /docs/images/libCellMLBuilding-CMakeWindowsLibXml2DIRNotFound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/libCellMLBuilding-CMakeWindowsLibXml2DIRNotFound.png -------------------------------------------------------------------------------- /docs/images/release_process/create_release_builder_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/create_release_builder_interface.png -------------------------------------------------------------------------------- /docs/images/release_process/prepare_release_builder_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/prepare_release_builder_interface.png -------------------------------------------------------------------------------- /docs/mainpage.dox: -------------------------------------------------------------------------------- 1 | 2 | /// @mainpage libCellML 3 | 4 | libCellML Code Documentation 5 | ============================ 6 | 7 | This is the documentation for the source code. 8 | 9 | -------------------------------------------------------------------------------- /docs/images/release_process/finalise_release_builder_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/finalise_release_builder_interface.png -------------------------------------------------------------------------------- /tests/resources/importer/source_units.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/images/release_process/end_to_end_database_tag_chooser_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/end_to_end_database_tag_chooser_example.png -------------------------------------------------------------------------------- /docs/images/release_process/end_to_end_framework_tag_chooser_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cellml/libcellml/HEAD/docs/images/release_process/end_to_end_framework_tag_chooser_example.png -------------------------------------------------------------------------------- /tests/resources/importer/diamond_point.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/resources/importer/NotCircularReference.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/resources/importer/layer1/layer2/layer3/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/resources/importer/units_source.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/version/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | set(CURRENT_TEST version) 3 | set(${CURRENT_TEST}_CATEGORY api) 4 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 5 | set(${CURRENT_TEST}_SRCS 6 | ${CMAKE_CURRENT_LIST_DIR}/version.cpp 7 | ) 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/units_concrete.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cmake/packaging/distrib/macos/welcome.txt: -------------------------------------------------------------------------------- 1 | This installer will guide you through the installation of libCellML on your machine. It will install the libCellML library and API header files. 2 | 3 | Thanks and enjoy, the libCellML developers. 4 | -------------------------------------------------------------------------------- /src/bindings/python/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | 'setuptools', 4 | 'wheel', 5 | 'scikit-build>=0.12', 6 | 'cmake', 7 | 'ninja', 8 | ] 9 | build-backend = 'setuptools.build_meta' 10 | 11 | -------------------------------------------------------------------------------- /cmake/packaging/distrib/description.txt: -------------------------------------------------------------------------------- 1 | 2 | libCellML Library 3 | ================= 4 | 5 | The libCellML library is a library that supports the creation, modification, printing, parsing, validation, and code generation of CellML 2.0 models. 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/model_with_components_2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/coverage/cmeta_id_cellml2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/resources/importer/components_source.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/basic_membrane_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/bindings/python/README.rst: -------------------------------------------------------------------------------- 1 | libCellML Python Package 2 | ======================== 3 | 4 | libCellML is a library for the creation, printing, parsing, and manipulation of CellML 2.0 models. 5 | 6 | Visit https://libcellml.org for help on getting started. 7 | -------------------------------------------------------------------------------- /tests/resources/importer/component_that_is_invalid.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/resources/importer/components_concrete.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/resources/importer/model2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/basic_sodium_channel.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/resources/importer/source.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/resources/importer/triangle_units_base.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/test_resources.cmake: -------------------------------------------------------------------------------- 1 | 2 | set(TESTS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/resources) 3 | 4 | set(TEST_RESOURCE_HEADER ${CMAKE_CURRENT_BINARY_DIR}/test_resources.h) 5 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_resources.in.h ${TEST_RESOURCE_HEADER}) 6 | -------------------------------------------------------------------------------- /tests/resources/importer/thingsThatGrowOnBranches.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/coverage/cellml1x_import_component.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/resources/importer/simple_model_2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/versions.rst: -------------------------------------------------------------------------------- 1 | .. _versions: 2 | 3 | ===================================== 4 | Dependency versions and compatibility 5 | ===================================== 6 | 7 | This document outlines the versions of packages which libCellML requires. 8 | 9 | **TODO** 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/resources/importer/component_importer.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /cmake/finalise_python_package.in.cmake: -------------------------------------------------------------------------------- 1 | configure_file(@CMAKE_CURRENT_SOURCE_DIR@/__init__.py ${LIBCELLML_PYTHON_PACKAGE_DIR}/__init__.py) 2 | configure_file(@CMAKE_CURRENT_SOURCE_DIR@/README.rst ${LIBCELLML_PYTHON_PACKAGE_DIR}/../README.rst) 3 | configure_file(@SETUP_PRE_GEN_PY_FILE@ ${LIBCELLML_PYTHON_PACKAGE_DIR}/../setup.py) 4 | -------------------------------------------------------------------------------- /tests/resources/importer/layer1/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/referenced_units_missing.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/layer1/layer2/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/analyser/underconstrained.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/import_units_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/component_importer_unresolved.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/diamond_left.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/diamond_right.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/import_invalid_xml.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/import_invalid_units.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/invalid_import_url.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/layer1/layer1/importing_bad_design_z_import_hierarchy.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/version/version.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | #include 4 | 5 | TEST(Version, versionMatch) 6 | { 7 | unsigned int version = libcellml::version(); 8 | EXPECT_EQ(0x000603U, version); 9 | 10 | std::string versionString = libcellml::versionString(); 11 | EXPECT_EQ("0.6.3", versionString); 12 | } 13 | -------------------------------------------------------------------------------- /tests/analyser/tests.cmake: -------------------------------------------------------------------------------- 1 | set(CURRENT_TEST analyser) 2 | set(${CURRENT_TEST}_CATEGORY utils) 3 | 4 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 5 | 6 | set(${CURRENT_TEST}_SRCS 7 | ${CMAKE_CURRENT_LIST_DIR}/analyser.cpp 8 | ${CMAKE_CURRENT_LIST_DIR}/analyserexternalvariable.cpp 9 | ${CMAKE_CURRENT_LIST_DIR}/analyserunits.cpp 10 | ) 11 | -------------------------------------------------------------------------------- /tests/resources/importer/ImportCircularReferences.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/import_invalid_component.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/circularImport1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/circularImport2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/importExample2b.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/generator/tests.cmake: -------------------------------------------------------------------------------- 1 | set(CURRENT_TEST generator) 2 | set(${CURRENT_TEST}_CATEGORY io) 3 | 4 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 5 | 6 | set(${CURRENT_TEST}_SRCS 7 | ${CMAKE_CURRENT_LIST_DIR}/generator.cpp 8 | ${CMAKE_CURRENT_LIST_DIR}/generatorprofile.cpp 9 | ${CMAKE_CURRENT_LIST_DIR}/generatorvariabletracker.cpp 10 | ) 11 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/circularImport2units.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/CircularReference.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/CircularReference2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_component_with_missing_units.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_units_with_present_children.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_units_with_missing_children.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_component_with_missing_children.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_units_with_unresolved_children.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/circularUnits_2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/prong.cellml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/circularUnits_3.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_units_with_child_units_missing_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/circularImport_2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/circularImport_3.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_component_with_imported_units_missing_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # macOS hidden system files 2 | .DS_Store 3 | 4 | # Ignore the build directory 5 | build/ 6 | 7 | # Debugging files 8 | *.profraw 9 | 10 | # Eclipse project files 11 | .project 12 | .pydevproject 13 | .settings/ 14 | 15 | # Qt Creator generated files 16 | CMakeLists.txt.user 17 | *.autosave 18 | 19 | # PyCharm generated files 20 | .idea/ 21 | 22 | # VS Code system files 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_a_component_that_is_invalid.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/mediumbondgraph/cpp_coupling_parameters.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/simplebondgraph/cpp_coupling_parameters.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/triangle_units_opposite.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/resources/importer/master2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/master_units.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/bindings/python/test_resources.in.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | TESTS_RESOURCE_LOCATION = "${TESTS_RESOURCE_LOCATION}" 4 | 5 | 6 | def resource_path(relative_path=''): 7 | return TESTS_RESOURCE_LOCATION + '/' + relative_path 8 | 9 | 10 | def file_contents(file_name): 11 | with open(os.path.join(TESTS_RESOURCE_LOCATION, file_name)) as f: 12 | content = f.read() 13 | 14 | return content 15 | -------------------------------------------------------------------------------- /tests/resources/sine_approximations_import_simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_a_component_that_is_not_there.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/main_referenced_units_missing.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/master1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/units_definitions.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /cmake/FindSphinx.cmake: -------------------------------------------------------------------------------- 1 | 2 | find_program(SPHINX_EXECUTABLE NAMES ${SPHINX_PREFERRED_NAMES} sphinx-build sphinx-build2 3 | HINTS 4 | $ENV{SPHINX_DIR} 5 | PATH_SUFFIXES bin 6 | DOC "Sphinx documentation generator" 7 | ) 8 | 9 | include(FindPackageHandleStandardArgs) 10 | 11 | find_package_handle_standard_args(Sphinx DEFAULT_MSG 12 | SPHINX_EXECUTABLE 13 | ) 14 | 15 | mark_as_advanced(SPHINX_EXECUTABLE) 16 | 17 | -------------------------------------------------------------------------------- /tests/resources/importer/master_units_unresolved.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_bad_design_z_offset_import_hierarchy.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/unitsdefinedinimportedmodel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/changelogs/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Changelogs 3 | ========== 4 | 5 | .. toctree:: 6 | 7 | changelog_v0.6.3 8 | changelog_v0.6.2 9 | changelog_v0.6.1 10 | changelog_v0.6.0 11 | changelog_v0.5.0 12 | changelog_v0.4.0 13 | changelog_v0.3.104 14 | changelog_v0.3.103 15 | changelog_v0.3.102 16 | changelog_v0.3.101 17 | changelog_v0.3.100 18 | changelog_v0.3.99 19 | changelog_v0.2.0 20 | changelog_v0.1.0 21 | 22 | -------------------------------------------------------------------------------- /tests/resources/importer/nested_units.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/resources/importer/triangle_units_opposite_I.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/resources/generator/cellml_slc_example/slc_model_units_only.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/importer/circularUnits_1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/circularUnits_1_duplicated_name.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/model1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/resources/importer/circularImport_1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/missingImport_1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/importExampleUnits.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/importedcomponentusingimportedcomponent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/circularImport_1_duplicated_name.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/circularImport1units.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /cmake/python_package_check.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import sys 3 | 4 | reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'list']) 5 | 6 | output_lines = reqs.splitlines() 7 | # Remove two header lines from pip list output. 8 | output_lines = output_lines[2:] 9 | 10 | installed_packages = [r.decode().split()[0] for r in output_lines] 11 | 12 | check_package = sys.argv[1] 13 | result = 0 if check_package in installed_packages else 1 14 | 15 | sys.exit(result) 16 | -------------------------------------------------------------------------------- /docs/changelogs/changelog_v0.6.2.rst: -------------------------------------------------------------------------------- 1 | libCellML v0.6.2 Changelog 2 | ========================== 3 | 4 | Infrastructure 5 | -------------- 6 | 7 | * Fix publishing of PyPI wheels by `@hsorby `_ [`#1284 `_]. 8 | 9 | Contributors 10 | ------------ 11 | 12 | .. image:: https://avatars.githubusercontent.com/u/778048?v=4 13 | :target: https://github.com/hsorby 14 | :height: 32 15 | :width: 32 16 | -------------------------------------------------------------------------------- /tests/resources/importer/units/left_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/changelogs/changelog_v0.3.101.rst: -------------------------------------------------------------------------------- 1 | libCellML v0.3.101 Changelog 2 | ============================ 3 | 4 | Infrastructure 5 | -------------- 6 | 7 | * Fixing the manylinux tag name by `@hsorby `_ [`#1029 `_]. 8 | 9 | Contributors 10 | ------------ 11 | 12 | .. image:: https://avatars.githubusercontent.com/u/778048?v=4 13 | :target: https://github.com/hsorby 14 | :height: 32 15 | :width: 32 16 | -------------------------------------------------------------------------------- /tests/resources/requires_imports.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/resources/importer/diamond.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/layer1/import_from_component_library.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/import_for_importedcomponentusingimportedcomponent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/resources/importer/units_imported.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/changelogs/changelog_v0.3.104.rst: -------------------------------------------------------------------------------- 1 | libCellML v0.3.104 Changelog 2 | ============================ 3 | 4 | Python bindings 5 | --------------- 6 | 7 | * Shift to use dynamic lookup for undefined symbols in shared libraries by `@hsorby `_ [`#1040 `_]. 8 | 9 | Contributors 10 | ------------ 11 | 12 | .. image:: https://avatars.githubusercontent.com/u/778048?v=4 13 | :target: https://github.com/hsorby 14 | :height: 32 15 | :width: 32 16 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_bad_design_z_import_hierarchy.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/dirty_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/resources/importer/layer1/importing_bad_design_z_import_hierarchy.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/import_invalid_import_url.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_nonexistent_items.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/import-requirements/complicatedExample.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/units_definition_level_1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/units_library.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/resources/importer/periodicstimulus/components/units.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/resources/importer/units_definition_level_1_child.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/import_for_importedunitswithnameclashes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/import_for_unitsdefinedinimportedmodel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/components_imported.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/units_definition_level_1_unresolved.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/forkedImport.cellml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/equality/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST equality) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY misc) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/equality.cpp 14 | ) 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/isolated/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST isolated_generator) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY io) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/generator.cpp 14 | ) 15 | 16 | -------------------------------------------------------------------------------- /tests/libxml2issues.2.9.13.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "string" 4 | #include "vector" 5 | 6 | // Version 2.9.13 of LibXml2 reports the following errors. 7 | const std::vector expectedLibXml2Issues = { 8 | "LibXml2 error: Opening and ending tag mismatch: ci line 6 and apply.", 9 | "LibXml2 error: Opening and ending tag mismatch: ci line 6 and math.", 10 | "LibXml2 error: Opening and ending tag mismatch: apply line 3 and math_wrap_as_single_root_element.", 11 | "LibXml2 error: Premature end of data in tag math line 2.", 12 | }; 13 | -------------------------------------------------------------------------------- /tests/resources/importer/import_units_that_are_invalid.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/math/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST math) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY entities) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/math.cpp 14 | ) 15 | set(${CURRENT_TEST}_HDRS 16 | ) 17 | -------------------------------------------------------------------------------- /tests/resources/importer/import_units_that_are_not_there.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/resources/importer/periodicstimulus/experiments/periodic-stimulus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/resources/importer/units/units_definitions.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/libxml2issues.2.9.10.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "string" 4 | #include "vector" 5 | 6 | // Version 2.9.10 of LibXml2 reports the following errors, 7 | // used on Windows CI machines. 8 | const std::vector expectedLibXml2Issues = { 9 | "LibXml2 error: Opening and ending tag mismatch: ci line 6 and apply.", 10 | "LibXml2 error: Opening and ending tag mismatch: ci line 6 and math.", 11 | "LibXml2 error: Opening and ending tag mismatch: apply line 6 and math_wrap_as_single_root_element.", 12 | "LibXml2 error: EndTag: ' 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/resources/importer/simple_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/resources/importer/units/main.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/clone/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST clone) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY utils) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/clone.cpp 14 | ) 15 | set(${CURRENT_TEST}_HDRS 16 | ) 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/resources/importer/import_units_that_have_unknown_children.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/resources/importer/periodicstimulus/components/INa.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/units/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST units) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY entities) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/units.cpp 14 | ) 15 | set(${CURRENT_TEST}_HDRS 16 | ) 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/connection/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST connection) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY entities) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/connection.cpp 14 | ) 15 | set(${CURRENT_TEST}_HDRS 16 | ) 17 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/import_for_importedcomponentswithnameclashes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/user_ex_01/child.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/resources/importer/nested_components.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/variable/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST variable) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY entities) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/variable.cpp 14 | ) 15 | set(${CURRENT_TEST}_HDRS 16 | ) 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/bindings/python/test_printer.py: -------------------------------------------------------------------------------- 1 | # 2 | # Tests the Printer class bindings 3 | # 4 | import unittest 5 | 6 | 7 | class PrinterTestCase(unittest.TestCase): 8 | 9 | def test_create_destroy(self): 10 | from libcellml import Printer 11 | 12 | x = Printer() 13 | del x 14 | 15 | def test_print_model(self): 16 | from libcellml import Printer, Model 17 | 18 | # std::string printModel(ModelPtr model) 19 | p = Printer() 20 | self.assertIsInstance(p.printModel(Model()), str) 21 | 22 | 23 | if __name__ == '__main__': 24 | unittest.main() 25 | -------------------------------------------------------------------------------- /tests/import_source/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST import_source) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY entities) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/import_source.cpp 14 | ) 15 | set(${CURRENT_TEST}_HDRS 16 | ) 17 | -------------------------------------------------------------------------------- /tests/resources/importer/triangle_units_point.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/resources/importer/triangle_units_point_I.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/imported_hierarchy_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/resources/units_in_cn.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | a 13 | 1 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/resources/importingModel.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/annotator/tests.cmake: -------------------------------------------------------------------------------- 1 | # Set the test name, 'test_' will be prepended to the 2 | # name set here 3 | set(CURRENT_TEST annotator) 4 | # Set a category name to enable running commands like: 5 | # ctest -R 6 | # which will run the tests matching this category-label. 7 | # Can be left empty (or just not set) 8 | set(${CURRENT_TEST}_CATEGORY utils) 9 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 10 | # Using absolute path relative to this file 11 | set(${CURRENT_TEST}_SRCS 12 | ${CMAKE_CURRENT_LIST_DIR}/annotator.cpp 13 | ) 14 | #set(${CURRENT_TEST}_HDRS 15 | # ${CMAKE_CURRENT_LIST_DIR}/ 16 | #) 17 | -------------------------------------------------------------------------------- /tests/bindings/python/test_version.py: -------------------------------------------------------------------------------- 1 | # 2 | # Tests the version function bindings 3 | # 4 | import unittest 5 | 6 | 7 | class VersionTestCase(unittest.TestCase): 8 | 9 | def test_version(self): 10 | import libcellml 11 | 12 | # unsigned int version() 13 | self.assertIsInstance(libcellml.version(), int) 14 | self.assertGreater(libcellml.version(), 0) 15 | 16 | # const std::string versionString() 17 | self.assertIsInstance(libcellml.versionString(), str) 18 | self.assertNotEqual(libcellml.versionString(), '') 19 | 20 | 21 | if __name__ == '__main__': 22 | unittest.main() 23 | -------------------------------------------------------------------------------- /tests/printer/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST printer) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY io) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/printer.cpp 14 | ) 15 | #set(${CURRENT_TEST}_HDRS 16 | # ${CMAKE_CURRENT_LIST_DIR}/ 17 | #) 18 | 19 | -------------------------------------------------------------------------------- /tests/reset/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST reset) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY entities) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/reset.cpp 14 | ) 15 | #set(${CURRENT_TEST}_HDRS 16 | # ${CMAKE_CURRENT_LIST_DIR}/ 17 | #) 18 | 19 | -------------------------------------------------------------------------------- /tests/resources/importer/units/right_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/validator/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST validator) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY io) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/validator.cpp 14 | ) 15 | #set(${CURRENT_TEST}_HDRS 16 | # ${CMAKE_CURRENT_LIST_DIR}/ 17 | #) 18 | -------------------------------------------------------------------------------- /tests/resources/analyser/units/rhs.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 12 | a 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/component/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST component) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY entities) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/component.cpp 14 | ${CMAKE_CURRENT_LIST_DIR}/encapsulation.cpp 15 | ) 16 | set(${CURRENT_TEST}_HDRS 17 | ) 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/coverage/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST coverage) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY misc) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/coverage.cpp 14 | ) 15 | #set(${CURRENT_TEST}_HDRS 16 | # ${CMAKE_CURRENT_LIST_DIR}/ 17 | #) 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/bindings/javascript/issue.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /src/bindings/interface/printer.i: -------------------------------------------------------------------------------- 1 | %module(package="libcellml") printer 2 | 3 | #define LIBCELLML_EXPORT 4 | 5 | %include 6 | 7 | %import "createconstructor.i" 8 | %import "logger.i" 9 | %import "types.i" 10 | 11 | %feature("docstring") libcellml::Printer 12 | "Prints CellML models to an XML string."; 13 | 14 | %feature("docstring") libcellml::Printer::printModel 15 | "Serialises the given :class:`Model` to an XML string."; 16 | 17 | %{ 18 | #include "libcellml/printer.h" 19 | %} 20 | 21 | %pythoncode %{ 22 | # libCellML generated wrapper code starts here. 23 | %} 24 | 25 | %create_constructor(Printer) 26 | 27 | %include "libcellml/printer.h" 28 | -------------------------------------------------------------------------------- /tests/resources/sin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | sin 10 | 11 | x 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/changelogs/changelog_v0.3.100.rst: -------------------------------------------------------------------------------- 1 | libCellML v0.3.100 Changelog 2 | ============================ 3 | 4 | Infrastructure 5 | -------------- 6 | 7 | * Fix for the deployment of wheels to PyPI by `@hsorby `_ [`#1020 `_]. 8 | 9 | Miscellaneous 10 | ------------- 11 | 12 | * Make template names consistent by `@hsorby `_ [`#1021 `_]. 13 | 14 | Contributors 15 | ------------ 16 | 17 | .. image:: https://avatars.githubusercontent.com/u/778048?v=4 18 | :target: https://github.com/hsorby 19 | :height: 32 20 | :width: 32 21 | -------------------------------------------------------------------------------- /docs/changelogs/changelog_v0.3.102.rst: -------------------------------------------------------------------------------- 1 | libCellML v0.3.102 Changelog 2 | ============================ 3 | 4 | Documentation 5 | ------------- 6 | 7 | * Update changelog_v0.3.101.rst by `@hsorby `_ [`#1032 `_]. 8 | 9 | Infrastructure 10 | -------------- 11 | 12 | * Adding support for Python 3.8 macOS wheels by `@hsorby `_ [`#1034 `_]. 13 | 14 | Contributors 15 | ------------ 16 | 17 | .. image:: https://avatars.githubusercontent.com/u/778048?v=4 18 | :target: https://github.com/hsorby 19 | :height: 32 20 | :width: 32 21 | -------------------------------------------------------------------------------- /tests/api_headers/tests.cmake: -------------------------------------------------------------------------------- 1 | foreach(_API_HEADER_FILE ${API_HEADER_FILES}) 2 | get_filename_component(TEST_HEADER_NAME ${_API_HEADER_FILE} NAME_WE) 3 | get_filename_component(TEST_HEADER ${_API_HEADER_FILE} NAME) 4 | set(CURRENT_TEST test_api_headers_${TEST_HEADER_NAME}) 5 | 6 | set(TEST_SRC ${CMAKE_CURRENT_BINARY_DIR}/api_headers/api_header_${TEST_HEADER_NAME}.cpp) 7 | set(TEST_CMAKE_FILE ${CMAKE_CURRENT_BINARY_DIR}/api_headers/api_header_${TEST_HEADER_NAME}.cmake) 8 | configure_file(api_headers/api_header_test.in.cpp ${TEST_SRC}) 9 | configure_file(api_headers/api_header_test.in.cmake ${TEST_CMAKE_FILE}) 10 | include(${TEST_CMAKE_FILE}) 11 | endforeach() 12 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_eqn_constant_on_rhs/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | x 11 | 1 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/resources/importingModelChildComponent.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/resources/importingModelParentComponent.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/test_template.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST ) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY ) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/ 14 | ) 15 | set(${CURRENT_TEST}_HDRS 16 | ${CMAKE_CURRENT_LIST_DIR}/ 17 | ) 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/resources/importer/trunk.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/changelogs/changelog_v0.3.103.rst: -------------------------------------------------------------------------------- 1 | libCellML v0.3.103 Changelog 2 | ============================ 3 | 4 | Bug 5 | --- 6 | 7 | * Fix segfault when printing complete MathML document by `@hsorby `_ [`#1026 `_]. 8 | 9 | Python bindings 10 | --------------- 11 | 12 | * Add more search paths for macOS python bindings by `@hsorby `_ [`#1037 `_]. 13 | 14 | Contributors 15 | ------------ 16 | 17 | .. image:: https://avatars.githubusercontent.com/u/778048?v=4 18 | :target: https://github.com/hsorby 19 | :height: 32 20 | :width: 32 21 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | x 12 | a 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/repeatedimportofsameunitsviadifferentcomponents.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/libxml2issues.2.9.11.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "string" 4 | #include "vector" 5 | 6 | // Version 2.9.11 of LibXml2 reports the following errors, 7 | // used on macOS 13 machines. 8 | const std::vector expectedLibXml2Issues = { 9 | "LibXml2 error: Opening and ending tag mismatch: ci line 6 and apply.", 10 | "LibXml2 error: Opening and ending tag mismatch: ci line 6 and math.", 11 | "LibXml2 error: Opening and ending tag mismatch: apply line 3 and math_wrap_as_single_root_element.", 12 | "LibXml2 error: Premature end of data in tag math line 2.", 13 | "LibXml2 error: Premature end of data in tag math_wrap_as_single_root_element line 1.", 14 | }; 15 | -------------------------------------------------------------------------------- /tests/libxml2issues.2.9.4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "string" 4 | #include "vector" 5 | 6 | // Version 2.9.4 of LibXml2 reports the following errors, 7 | // used on Windows CI machines. 8 | const std::vector expectedLibXml2Issues = { 9 | "LibXml2 error: Opening and ending tag mismatch: ci line 6 and apply.", 10 | "LibXml2 error: Opening and ending tag mismatch: ci line 6 and math.", 11 | "LibXml2 error: Opening and ending tag mismatch: apply line 3 and math_wrap_as_single_root_element.", 12 | "LibXml2 error: Premature end of data in tag math line 2.", 13 | "LibXml2 error: Premature end of data in tag math_wrap_as_single_root_element line 1.", 14 | }; 15 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/importedunitswithnameclashes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/resources/dirty_encapsulated_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/importedcomponentswithnameclashes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/resources/import-requirements/importExample1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/resources/importer/units/base_model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | P 15 | 3.0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/bindings/interface/strict.i: -------------------------------------------------------------------------------- 1 | %module(package="libcellml") strict 2 | 3 | #define LIBCELLML_EXPORT 4 | 5 | %import "types.i" 6 | 7 | %feature("docstring") libcellml::Strict 8 | "Abstract base class for entities that can be strict."; 9 | 10 | %feature("docstring") libcellml::Strict::isStrict 11 | "Returns True if the entity is strict, else False."; 12 | 13 | %feature("docstring") libcellml::Strict::setStrict 14 | "Set the entity as strict or not strict."; 15 | 16 | %{ 17 | #include "libcellml/types.h" 18 | #include "libcellml/strict.h" 19 | %} 20 | 21 | %pythoncode %{ 22 | # libCellML generated wrapper code starts here. 23 | %} 24 | 25 | %ignore libcellml::Strict::Strict(); 26 | 27 | %include "libcellml/strict.h" 28 | -------------------------------------------------------------------------------- /tests/resources/importer/complicated.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /cmake/utils/compress.in.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | const char INPUT_FILE[] = "${MATHML_DTD_LOCATION}"; 20 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/import_for_repeatedimportofsameunitsviadifferentcomponents.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/bindings/interface/version.i: -------------------------------------------------------------------------------- 1 | %module(package="libcellml") version 2 | 3 | #define LIBCELLML_EXPORT 4 | 5 | %include 6 | 7 | %feature("docstring") libcellml::version 8 | "Returns the version of the library as a number."; 9 | 10 | %feature("docstring") libcellml::versionString 11 | "Returns the libcellml version string. 12 | 13 | The version string is in the format x.y.z, where the '.'s are literal, and x, y 14 | and z represent counting numbers, in which case x is the major version, y the 15 | minor version, and z the patch level."; 16 | 17 | %{ 18 | #include "libcellml/version.h" 19 | %} 20 | 21 | %pythoncode %{ 22 | # libCellML generated wrapper code starts here. 23 | %} 24 | 25 | %include "libcellml/version.h" 26 | -------------------------------------------------------------------------------- /tests/bindings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright libCellML Contributors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | if(LIBCELLML_BINDINGS_PYTHON) 16 | add_subdirectory(python) 17 | endif() 18 | -------------------------------------------------------------------------------- /tests/model/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST model) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY entities) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/component_import.cpp 14 | ${CMAKE_CURRENT_LIST_DIR}/import_requirement.cpp 15 | ${CMAKE_CURRENT_LIST_DIR}/model.cpp 16 | ${CMAKE_CURRENT_LIST_DIR}/units_import.cpp 17 | ) 18 | set(${CURRENT_TEST}_HDRS 19 | ) 20 | -------------------------------------------------------------------------------- /docs/coverage_statistics.rst: -------------------------------------------------------------------------------- 1 | .. _coverage_statistics: 2 | 3 | =================== 4 | Coverage Statistics 5 | =================== 6 | 7 | **TODO** 8 | The output from the coverage testing using gcov is available TODO. 9 | 10 | .. note:: 11 | 12 | The coverage test sometimes (this behaviour has been observed on macOS using Clang) reports single lines containing only a closing curly brace as not covered. 13 | This is currently being treated as a false positive. 14 | This can be seen in the 'Missing' column of the test report where only single lines are reported. 15 | For the case discussed here, the reported line should only contain a single closing curly brace. 16 | In this situation, we will accept the missed coverage report. 17 | -------------------------------------------------------------------------------- /tests/resources/importer/component_library.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/resources/importer/components_missing_children.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/resources/importer/generic.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/resources/importer/layer1/component_library.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/bindings/interface/validator.i: -------------------------------------------------------------------------------- 1 | %module(package="libcellml") validator 2 | 3 | #define LIBCELLML_EXPORT 4 | 5 | %import "createconstructor.i" 6 | %import "logger.i" 7 | %import "types.i" 8 | 9 | %feature("docstring") libcellml::Validator 10 | "Validates CellML objects."; 11 | 12 | %feature("docstring") libcellml::Validator::validateModel 13 | "Validate the given `model` and its encapsulated entities using the CellML 2.0 14 | Specification. Any errors will be logged in the `Validator`."; 15 | 16 | %{ 17 | #include "libcellml/validator.h" 18 | %} 19 | 20 | %pythoncode %{ 21 | # libCellML generated wrapper code starts here. 22 | %} 23 | 24 | %create_constructor(Validator) 25 | 26 | %include "libcellml/types.h" 27 | %include "libcellml/validator.h" 28 | -------------------------------------------------------------------------------- /tests/resources/analyser/undefined_variables.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | x 10 | a 11 | 12 | 13 | 14 | y 15 | b 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/resources/importer/model_with_components_1.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/api_headers/api_header_test.in.cmake: -------------------------------------------------------------------------------- 1 | 2 | add_executable(${CURRENT_TEST} ${TEST_SRC}) 3 | target_link_libraries(${CURRENT_TEST} cellml gtest_main) 4 | 5 | set_target_properties(${CURRENT_TEST} PROPERTIES 6 | CXX_STANDARD 11 7 | CXX_STANDARD_REQUIRED ON 8 | FOLDER tests) 9 | 10 | add_test(NAME api_header_inclusion_${CURRENT_TEST} COMMAND ${CURRENT_TEST}) 11 | 12 | if(MSVC) 13 | # The libxml2 DLL and zlib DLL must be on the path otherwise the tests will not be able to run. 14 | set_tests_properties(api_header_inclusion_${CURRENT_TEST} 15 | PROPERTIES ENVIRONMENT "PATH=$\;$${GEN_EXP_XML2_TARGET_FILE_DIR}${GEN_EXP_ZLIB_TARGET_FILE_DIR}") 16 | endif() 17 | 18 | list(APPEND TEST_LIST ${CURRENT_TEST}) 19 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/user_ex_01/parent.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/resources/analyser/not_equality_statement.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | x 13 | y 14 | z 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/resources/importer/model_with_components_1_unresolved.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/test_resources.in.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | const std::string TESTS_RESOURCE_LOCATION = "@TESTS_RESOURCE_LOCATION@"; 22 | -------------------------------------------------------------------------------- /tests/resources/importer/generic_no_source.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/resources/importer/simplebondgraph/cpp_coupling.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/importer/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST importer) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY object) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/cellml_1_1.cpp 14 | ${CMAKE_CURRENT_LIST_DIR}/file_parser.cpp 15 | ${CMAKE_CURRENT_LIST_DIR}/importer.cpp 16 | ${CMAKE_CURRENT_LIST_DIR}/model_flattening.cpp 17 | ) 18 | #set(${CURRENT_TEST}_HDRS 19 | # ${CMAKE_CURRENT_LIST_DIR}/ 20 | #) 21 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/internalequivalentvariables.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.github/workflows/spell-check.yml: -------------------------------------------------------------------------------- 1 | # GitHub Action to automate the identification of common misspellings in text files. 2 | # https://github.com/codespell-project/actions-codespell 3 | # https://github.com/codespell-project/codespell 4 | name: codespell 5 | on: [pull_request] 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | codespell: 12 | if: github.repository == 'cellml/libcellml' 13 | name: Check for spelling errors 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: codespell-project/actions-codespell@v2 18 | with: 19 | check_filenames: true 20 | skip: ./.git,./tests/gtest/include/gtest/gtest.h,./tests/gtest/src/gtest-all.cc,./src/dtds/mathml2/* 21 | exclude_file: .codespellexclude 22 | -------------------------------------------------------------------------------- /tests/resources/importer/simplebondgraph/cpp_coupling_modules.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | R_v 10 | 11 | 12 | 0.01 13 | C 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/outsidecomponentequivalentvariables.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/resources/analyser/unsuitably_constrained.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | y 10 | 1 11 | 12 | 13 | 14 | y 15 | 3 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/resources/complex_encapsulation.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/resources/importer/importing_bad_design_c_shape_import_hierarchy.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/resources/importer/units/base_model_illdefined.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | P 16 | 3.0 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/bindings/javascript/strict.impl: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | bool isStrict() const 18 | { 19 | return Strict::isStrict(); 20 | } 21 | 22 | void setStrict(bool strict) 23 | { 24 | Strict::setStrict(strict); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /tests/resources/analyser/overconstrained.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | x 12 | 1 13 | 14 | 15 | 16 | x 17 | 3 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/resources/importer/units_children.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/resources/multiplecellmlnamespaces.cellml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | a 10 | 10 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/bindings/interface/namedentity.i: -------------------------------------------------------------------------------- 1 | %module(package="libcellml") namedentity 2 | 3 | #define LIBCELLML_EXPORT 4 | 5 | %import "parentedentity.i" 6 | %import "types.i" 7 | 8 | %feature("docstring") libcellml::NamedEntity 9 | "Abstract base class for all nameable libCellML classes."; 10 | 11 | %feature("docstring") libcellml::NamedEntity::name 12 | "Returns this entity's name (empty string if not set)."; 13 | 14 | %feature("docstring") libcellml::NamedEntity::setName 15 | "Sets this entity's name (empty string to unset)."; 16 | 17 | %feature("docstring") libcellml::NamedEntity::removeName 18 | "Remove this entity's name."; 19 | 20 | %{ 21 | #include "libcellml/namedentity.h" 22 | %} 23 | 24 | %pythoncode %{ 25 | # libCellML generated wrapper code starts here. 26 | %} 27 | 28 | %ignore libcellml::NamedEntity::NamedEntity(); 29 | 30 | %include "libcellml/namedentity.h" 31 | -------------------------------------------------------------------------------- /tests/resources/importer/mediumbondgraph/cpp_coupling_modules.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | R_v 11 | 12 | 13 | 0.01 14 | C 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/bindings/interface/entity.i: -------------------------------------------------------------------------------- 1 | %module(package="libcellml") entity 2 | 3 | #define LIBCELLML_EXPORT 4 | 5 | %include 6 | 7 | %import "types.i" 8 | 9 | %feature("docstring") libcellml::Entity 10 | "Abstract base class for all libCellML core classes." 11 | 12 | %feature("docstring") libcellml::Entity::id 13 | "Returns the `id` document identifier for this entity, or an empty string if 14 | not set."; 15 | 16 | %feature("docstring") libcellml::Entity::setId 17 | "Sets the `id` document identifier for this entity."; 18 | 19 | %feature("docstring") libcellml::Entity::removeId 20 | "Removes the `id` document identifier set for this entity."; 21 | 22 | %{ 23 | #include "libcellml/entity.h" 24 | %} 25 | 26 | %pythoncode %{ 27 | # libCellML generated wrapper code starts here. 28 | %} 29 | 30 | %ignore libcellml::Entity::Entity(); 31 | 32 | %include "libcellml/entity.h" 33 | -------------------------------------------------------------------------------- /tests/resources/importer/components_missing_units.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | a 12 | 1 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/resources/printer/component_with_multiple_math.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | nK_stim 10 | 0.3 11 | 12 | 13 | 14 | 15 | 16 | stimPeriod 17 | 42.6 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | x 13 | a 14 | 15 | 16 | 17 | a 18 | 1 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/bindings/python/test_import_requirement.py: -------------------------------------------------------------------------------- 1 | # 2 | # Tests for the ImportRequirement class. 3 | # 4 | import unittest 5 | 6 | from test_resources import file_contents 7 | 8 | 9 | class ImportRequirementTestCase(unittest.TestCase): 10 | 11 | def test_requirements(self): 12 | from libcellml import Parser, Importer 13 | keys = [ 14 | 'complicatedComponents.cellml', 15 | 'complicatedUnits.cellml', 16 | ] 17 | 18 | parser = Parser() 19 | model = parser.parseModel(file_contents('import-requirements/complicatedExample.cellml')) 20 | self.assertEqual(0, parser.issueCount()) 21 | 22 | requirements = model.importRequirements() 23 | 24 | i = 0 25 | for r in requirements: 26 | self.assertEqual(keys[i], r) 27 | i += 1 28 | 29 | 30 | if __name__ == '__main__': 31 | unittest.main() 32 | -------------------------------------------------------------------------------- /cmake/generateprofilesha1header.cmake: -------------------------------------------------------------------------------- 1 | # Copyright libCellML Contributors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License.cmake_minimum_required (VERSION 3.1) 14 | 15 | include("generatorprofilesha1values.cmake") 16 | configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/configure/generatorprofilesha1values.in.h" "${CMAKE_CURRENT_LIST_DIR}/../src/generatorprofilesha1values.h") 17 | -------------------------------------------------------------------------------- /tests/resources/deriv_approx_sin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | x 12 | sin 13 | 14 | 15 | x 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/resources/importedModelWithMaps.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/bindings/interface/parser.i: -------------------------------------------------------------------------------- 1 | %module(package="libcellml") parser 2 | 3 | #define LIBCELLML_EXPORT 4 | 5 | %include 6 | 7 | %import "createconstructor.i" 8 | %import "logger.i" 9 | %import "strict.i" 10 | %import "types.i" 11 | 12 | %feature("docstring") libcellml::Parser 13 | "Can parse Models encoded as XML strings."; 14 | 15 | %feature("docstring") libcellml::Parser::parseModel 16 | "Parses a string and returns a :class:`Model`."; 17 | 18 | %{ 19 | #include "libcellml/parser.h" 20 | %} 21 | 22 | %pythoncode %{ 23 | # libCellML generated wrapper code starts here. 24 | %} 25 | 26 | %create_constructor(Parser) 27 | %extend libcellml::Parser { 28 | Parser(bool strict) { 29 | auto ptr = new std::shared_ptr< libcellml::Parser >(libcellml::Parser::create(strict)); 30 | return reinterpret_cast(ptr); 31 | } 32 | } 33 | 34 | %include "libcellml/parser.h" 35 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_unknown_var_on_rhs/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 1 13 | x 14 | 15 | 16 | 17 | x 18 | y 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/resources/coverage/invalidxmlids.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/object_model.rst: -------------------------------------------------------------------------------- 1 | .. _libCellMLObjectModel: 2 | 3 | ====================== 4 | libCellML Object Model 5 | ====================== 6 | 7 | Introduction 8 | ============ 9 | 10 | The object model described by this document is a very high level conceptual design. 11 | This document is organic and is expected to change in accordance with community decisions/discussion. 12 | 13 | Overview of Object Model 14 | ======================== 15 | 16 | .. figure:: ./images/libCellMLRoughObjectModel-Overview.png 17 | :alt: libCellML Overview Object Model. 18 | :name: overview_of_libcellml_objects 19 | 20 | Showing the inheritance structure between libCellML items within the model. 21 | 22 | Detailed 23 | ======== 24 | 25 | .. figure:: ./images/libCellMLRoughObjectModel-Entities.png 26 | :alt: libCellML Object Model. 27 | 28 | .. figure:: ./images/libCellMLRoughObjectModel-IOError.png 29 | :alt: libCellML Object Model. 30 | -------------------------------------------------------------------------------- /tests/resources/import-requirements/importExample2.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/bindings/javascript/version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "libcellml/version.h" 20 | 21 | using namespace emscripten; 22 | 23 | EMSCRIPTEN_BINDINGS(libcellml_version) { 24 | function("versionString", &libcellml::versionString); 25 | function("version", &libcellml::version); 26 | } 27 | -------------------------------------------------------------------------------- /src/mathmldtd.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | namespace libcellml { 23 | 24 | static const size_t MATHML_DTD_LEN = 391336; 25 | static const size_t COMPRESSED_MATHML_DTD_LEN = 67752; 26 | 27 | const unsigned char *compressedMathMLDTD(); 28 | 29 | } // namespace libcellml 30 | -------------------------------------------------------------------------------- /tests/bindings/python/runner.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | import coverage 6 | 7 | args = sys.argv[:] 8 | args.pop(0) # Remove program name. 9 | 10 | configuration = "" 11 | if len(args): 12 | configuration = args.pop(0) 13 | 14 | arg1 = "" 15 | if len(args): 16 | arg1 = args.pop(0) 17 | 18 | cov = coverage.Coverage(source=["libcellml"]) 19 | cov.set_option("run:plugins", ["exclude_until_coverage_plugin"]) 20 | cov.set_option("exclude_until_coverage_plugin:marker", "# libCellML generated wrapper code starts here.") 21 | 22 | os.chdir(os.path.join("@PYTHON_COVERAGE_WORKING_DIRECTORY@", configuration)) 23 | 24 | cov.start() 25 | 26 | suite = unittest.TestLoader().discover("@CMAKE_CURRENT_BINARY_DIR@") 27 | unittest.TextTestRunner(verbosity=1).run(suite) 28 | 29 | cov.stop() 30 | cov.save() 31 | 32 | if arg1 == "html": 33 | cov.html_report(directory='coverage_report') 34 | else: 35 | cov.report() 36 | -------------------------------------------------------------------------------- /tests/api_headers/api_header_test.in.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Copyright libCellML Contributors 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | #include "gtest/gtest.h" 21 | 22 | /* 23 | * Generated test to ensure header files can be included independently. 24 | */ 25 | TEST(APIHeader, @TEST_HEADER_NAME@) 26 | { 27 | EXPECT_TRUE(size_t(4) == size_t(4)); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /tests/bindings/python/test_analyser_equation_ast.py: -------------------------------------------------------------------------------- 1 | # 2 | # Tests the AnalyserEquationAst class bindings 3 | # 4 | import unittest 5 | 6 | 7 | class AnalyserEquationAstTestCase(unittest.TestCase): 8 | 9 | def test_create_destroy(self): 10 | from libcellml import AnalyserEquationAst 11 | 12 | x = AnalyserEquationAst() 13 | del x 14 | 15 | def test_analyser_equation_ast(self): 16 | from libcellml import AnalyserEquationAst 17 | 18 | # Create an equation AST and check its default settings. 19 | ast = AnalyserEquationAst() 20 | self.assertEqual(AnalyserEquationAst.Type.EQUALITY, ast.type()) 21 | self.assertEqual('', ast.value()) 22 | self.assertIsNone(ast.variable()) 23 | self.assertIsNone(ast.parent()) 24 | self.assertIsNone(ast.leftChild()) 25 | self.assertIsNone(ast.rightChild()) 26 | 27 | 28 | if __name__ == '__main__': 29 | unittest.main() 30 | -------------------------------------------------------------------------------- /tests/resources/importer/bondgraph/cpp_coupling_parameters.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/resources/importer/complexbondgraph/cpp_coupling_parameters.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/configure/mathmldtd.in.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace libcellml { 22 | 23 | static const size_t MATHML_DTD_LEN = ${MATHML_DTD_LEN}; 24 | static const size_t COMPRESSED_MATHML_DTD_LEN = ${COMPRESSED_MATHML_DTD_LEN}; 25 | 26 | const unsigned char *compressedMathMLDTD(); 27 | 28 | } // namespace libcellml 29 | -------------------------------------------------------------------------------- /tests/resources/analyser/non_initialised_state.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | time 16 | 17 | x 18 | 19 | 1 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/resources/modelflattening/equivalentimportedvariable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/resources/analyser/variable_initialised_using_a_non_existing_variable.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | t 14 | 15 | x 16 | 17 | 1.23 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/resources/cellml1X/cardiac_constant_simplified_alternative.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 9 | 10 | 11 | nK_stim 12 | 0.3 13 | 14 | 15 | 16 | 18 | 19 | 20 | stimPeriod 21 | 42.6 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/resources/importer/common_units_import_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/bindings/python/wheel_dependencies/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(prepare_dependencies) 4 | 5 | #include(FetchContent) 6 | include(ExternalProject) 7 | 8 | ExternalProject_Add(zlib_library 9 | GIT_REPOSITORY "https://github.com/OpenCMISS-Dependencies/zlib" 10 | GIT_TAG "9f3d4d3" 11 | CMAKE_GENERATOR Ninja 12 | CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_BUILD_TYPE=Release 13 | ) 14 | 15 | set(ZLIB_DIR_DEFINE "-DZLIB_DIR=C:/Program Files (x86)/ZLIB/ZLIB-1.2.3/CMake/") 16 | ExternalProject_Add(libxml2_library 17 | GIT_REPOSITORY "https://github.com/OpenCMISS-Dependencies/libxml2" 18 | GIT_TAG "ba37145" 19 | CMAKE_GENERATOR Ninja 20 | CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release \\"-DZLIB_DIR=C:/Program Files (x86)/ZLIB/ZLIB-1.2.3/CMake/\\" -DBUILD_SHARED_LIBS=OFF -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_TESTS=OFF -DLIBXML2_WITH_PROGRAMS=OFF 21 | DEPENDS zlib_library 22 | ) 23 | 24 | -------------------------------------------------------------------------------- /docs/changelogs/changelog_v0.6.1.rst: -------------------------------------------------------------------------------- 1 | libCellML v0.6.1 Changelog 2 | ========================== 3 | 4 | Infrastructure 5 | -------------- 6 | 7 | * Fix error with Windows paths in deployment script using GitHub actions by `@hsorby `_ [`#1280 `_]. 8 | * Fix location of permissions flag in deploy-on-release.yml by `@hsorby `_ [`#1277 `_]. 9 | * Add a test to check what type is used in the LibXml2 structuredErrorCallback function by `@hsorby `_ [`#1274 `_]. 10 | * Deploy updates by `@hsorby `_ [`#1273 `_]. 11 | 12 | Contributors 13 | ------------ 14 | 15 | .. image:: https://avatars.githubusercontent.com/u/778048?v=4 16 | :target: https://github.com/hsorby 17 | :height: 32 18 | :width: 32 19 | -------------------------------------------------------------------------------- /src/version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "libcellml/version.h" 18 | 19 | #include 20 | 21 | #include "versionconfig.h" 22 | 23 | namespace libcellml { 24 | 25 | unsigned int version() 26 | { 27 | return LIBCELLML_LIBRARY_VERSION; 28 | } 29 | 30 | std::string versionString() 31 | { 32 | return LIBCELLML_LIBRARY_VERSION_STRING; 33 | } 34 | 35 | } // namespace libcellml 36 | -------------------------------------------------------------------------------- /tests/resources/cellml1X/cardiac_constant_simplified.cellml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 9 | 10 | 11 | nK_stim 12 | 0.3 13 | 14 | 15 | 16 | 18 | 19 | 20 | stimPeriod 21 | 42.6 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/bindings/javascript/version.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | const libCellMLModule = require('libcellml.js/libcellml.common') 18 | let libcellml = null 19 | 20 | describe("Version tests", () => { 21 | beforeAll(async () => { 22 | libcellml = await libCellMLModule(); 23 | }); 24 | test('Checking version string.', () => { 25 | expect(libcellml.versionString()).toBe('0.6.3'); 26 | }); 27 | }) 28 | -------------------------------------------------------------------------------- /tests/resources/analyser/initialised_variable_of_integration.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | time 16 | 17 | x 18 | 19 | 1 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/configure/mathmldtd.in.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "mathmldtd.h" 18 | 19 | #include 20 | 21 | namespace libcellml { 22 | 23 | static const std::array COMPRESSED_MATHML_DTD = ${COMPRESSED_MATHML_DTD_DATA}; 24 | 25 | const unsigned char *compressedMathMLDTD() 26 | { 27 | return &COMPRESSED_MATHML_DTD[0]; 28 | } 29 | 30 | } // namespace libcellml 31 | -------------------------------------------------------------------------------- /tests/parser/tests.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set the test name, 'test_' will be prepended to the 3 | # name set here 4 | set(CURRENT_TEST parser) 5 | # Set a category name to enable running commands like: 6 | # ctest -R 7 | # which will run the tests matching this category-label. 8 | # Can be left empty (or just not set) 9 | set(${CURRENT_TEST}_CATEGORY io) 10 | list(APPEND LIBCELLML_TESTS ${CURRENT_TEST}) 11 | # Using absolute path relative to this file 12 | set(${CURRENT_TEST}_SRCS 13 | ${CMAKE_CURRENT_LIST_DIR}/cellml_1_0.cpp 14 | ${CMAKE_CURRENT_LIST_DIR}/cellml_1_1.cpp 15 | ${CMAKE_CURRENT_LIST_DIR}/file_parser.cpp 16 | ${CMAKE_CURRENT_LIST_DIR}/libxml_user.cpp 17 | ${CMAKE_CURRENT_LIST_DIR}/parser.cpp 18 | ) 19 | #set(${CURRENT_TEST}_HDRS 20 | # ${CMAKE_CURRENT_LIST_DIR}/ 21 | #) 22 | 23 | set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/libxml_user.cpp PROPERTIES 24 | COMPILE_DEFINITIONS XML_ERROR_CALLBACK_ARGUMENT_TYPE=${CONST_ERROR_STRUCTURED_ERROR_CALLBACK_TYPE}) 25 | -------------------------------------------------------------------------------- /src/bindings/javascript/strict.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "libcellml/importedentity.h" 20 | 21 | using namespace emscripten; 22 | 23 | EMSCRIPTEN_BINDINGS(libcellml_strict) { 24 | 25 | class_("Strict") 26 | .function("isStrict", &libcellml::Strict::isStrict) 27 | .function("setStrict", &libcellml::Strict::setStrict) 28 | ; 29 | } 30 | -------------------------------------------------------------------------------- /src/entity_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "libcellml/entity.h" 20 | 21 | namespace libcellml { 22 | 23 | /** 24 | * @brief The Entity::EntityImpl class. 25 | * 26 | * The private implementation for the Entity class. 27 | */ 28 | class Entity::EntityImpl 29 | { 30 | public: 31 | std::string mId; /**< String document identifier for this entity. */ 32 | }; 33 | 34 | } // namespace libcellml 35 | -------------------------------------------------------------------------------- /tests/resources/level1-3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/bindings/javascript/printer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "libcellml/printer.h" 20 | 21 | using namespace emscripten; 22 | 23 | EMSCRIPTEN_BINDINGS(libcellml_printer) { 24 | 25 | class_("Printer") 26 | .smart_ptr_constructor("Printer", &libcellml::Printer::create) 27 | .function("printModel", &libcellml::Printer::printModel) 28 | ; 29 | } 30 | -------------------------------------------------------------------------------- /tests/resources/generator/ode_constant_on_rhs_one_component/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | t 19 | 20 | x 21 | 22 | 1 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/resources/generator/ode_const_var_on_rhs_one_component/model.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | t 20 | 21 | x 22 | 23 | a 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/bindings/python/test_validator.py: -------------------------------------------------------------------------------- 1 | # 2 | # Tests the Validator class bindings 3 | # 4 | import unittest 5 | 6 | 7 | class ValidatorTestCase(unittest.TestCase): 8 | 9 | def test_create_destroy(self): 10 | from libcellml import Validator 11 | 12 | x = Validator() 13 | del x 14 | 15 | def test_inheritance(self): 16 | import libcellml 17 | from libcellml import Validator 18 | 19 | # Test inheritance 20 | x = Validator() 21 | self.assertIsInstance(x, libcellml.logger.Logger) 22 | 23 | # Test access to inherited methods 24 | self.assertIsNone(x.issue(0)) 25 | self.assertIsNone(x.issue(-1)) 26 | self.assertEqual(x.issueCount(), 0) 27 | 28 | def test_validate_model(self): 29 | import libcellml 30 | from libcellml import Validator 31 | 32 | # void validateModel(const ModelPtr &model) 33 | v = Validator() 34 | v.validateModel(libcellml.Model()) 35 | 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /src/api/libcellml/undefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Note that: 18 | // 1) this header file MUST NOT start with #pragma once; and that 19 | // 2) this header file MUST be included LAST by a .cpp/.h file. 20 | // 21 | // This ensures that TRUE, FALSE, and NAN can be safely used in AnalyserEquationAst::Type. 22 | 23 | #ifdef TRUE 24 | # undef TRUE 25 | #endif 26 | 27 | #ifdef FALSE 28 | # undef FALSE 29 | #endif 30 | 31 | #ifdef NAN 32 | # undef NAN 33 | #endif 34 | -------------------------------------------------------------------------------- /src/bindings/javascript/validator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "libcellml/validator.h" 20 | 21 | using namespace emscripten; 22 | 23 | EMSCRIPTEN_BINDINGS(libcellml_validator) { 24 | 25 | class_>("Validator") 26 | .smart_ptr_constructor("Validator", &libcellml::Validator::create) 27 | .function("validateModel", &libcellml::Validator::validateModel) 28 | ; 29 | } 30 | -------------------------------------------------------------------------------- /src/bindings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright libCellML Contributors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | if(LIBCELLML_BINDINGS_PYTHON) # Or any other bindings that use SWIG. 16 | include(${SWIG_USE_FILE}) 17 | endif() 18 | 19 | if(LIBCELLML_BINDINGS_PYTHON) 20 | if(NOT LIBCELLML_BUILD_SHARED) 21 | message(WARNING "It is **not** recommended to build the Python bindings with static libraries.") 22 | endif() 23 | add_subdirectory(python) 24 | endif() 25 | 26 | if (EMSCRIPTEN) 27 | add_subdirectory(javascript) 28 | endif () 29 | -------------------------------------------------------------------------------- /tests/resources/level2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | time 11 | cosine 12 | 13 | 14 | 15 | parameter 16 | time 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/bindings/javascript/enums.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | const loadLibCellML = require('libcellml.js/libcellml.common') 18 | 19 | let libcellml = null 20 | 21 | describe("Enums tests", () => { 22 | beforeAll(async () => { 23 | libcellml = await loadLibCellML() 24 | }); 25 | test("Checking cellmlElementTypeAsString.", () => { 26 | expect(libcellml.cellmlElementTypeAsString(libcellml.CellmlElementType.ENCAPSULATION)).toBe("encapsulation") 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /cmake/macros.cmake: -------------------------------------------------------------------------------- 1 | macro(apply_compiler_cache_settings) 2 | # Use compiler cache. 3 | if(BUILDCACHE_EXE) 4 | set(CMAKE_CXX_COMPILER_LAUNCHER ${BUILDCACHE_EXE}) 5 | elseif(CLCACHE_EXE) 6 | set(CLCACHEWRAPPER ${CMAKE_CURRENT_BINARY_DIR}/clcachewrapper) 7 | execute_process(COMMAND ${CMAKE_C_COMPILER} /O2 /Fe${CLCACHEWRAPPER} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/clcachewrapper.c 8 | RESULT_VARIABLE RESULT OUTPUT_QUIET ERROR_QUIET) 9 | if(RESULT EQUAL 0) 10 | set(CMAKE_CXX_COMPILER_LAUNCHER ${CLCACHEWRAPPER}) 11 | endif() 12 | else() 13 | set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXE}) 14 | endif() 15 | 16 | # On Windows, if we are using MSVC then replace some compiler flags. 17 | if(MSVC) 18 | # Replace the /Zi option (i.e. enable debugging information), if present, 19 | # with the /Z7 option (i.e. enable old-style debugging information) 20 | # otherwise caching (be it with buildcache or clcache) won't work. 21 | if(BUILDCACHE_EXE OR CLCACHE_EXE) 22 | replace_compiler_flag("/Zi" "/Z7") 23 | endif() 24 | endif() 25 | endmacro() 26 | -------------------------------------------------------------------------------- /tests/resources/coverage/converttoint.cellml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/configure/generatorprofilesha1values.in.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace libcellml { 22 | 23 | /** 24 | * The content of this file is generated, do not edit this file directly. 25 | * See docs/dev_utilities.rst for further information. 26 | */ 27 | static const char C_GENERATOR_PROFILE_SHA1[] = "${C_GENERATOR_PROFILE_SHA1_VALUE}"; 28 | static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "${PYTHON_GENERATOR_PROFILE_SHA1_VALUE}"; 29 | 30 | } // namespace libcellml 31 | -------------------------------------------------------------------------------- /src/generatorprofilesha1values.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace libcellml { 22 | 23 | /** 24 | * The content of this file is generated, do not edit this file directly. 25 | * See docs/dev_utilities.rst for further information. 26 | */ 27 | static const char C_GENERATOR_PROFILE_SHA1[] = "24b7a2f82510d2f79aeaee509a1b1b04ea1d749b"; 28 | static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "b117a2500aae147f477127f0bfb0e2c9e242c6c8"; 29 | 30 | } // namespace libcellml 31 | -------------------------------------------------------------------------------- /src/namedentity_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "libcellml/namedentity.h" 20 | 21 | #include "parentedentity_p.h" 22 | 23 | namespace libcellml { 24 | 25 | /** 26 | * @brief The NamedEntity::NamedEntityImpl class. 27 | * 28 | * The private implementation for the NamedEntity class. 29 | */ 30 | class NamedEntity::NamedEntityImpl: public ParentedEntityImpl 31 | { 32 | public: 33 | std::string mName; /**< Entity name represented as a std::string. */ 34 | }; 35 | 36 | } // namespace libcellml 37 | -------------------------------------------------------------------------------- /src/bindings/javascript/namedentity.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "libcellml/namedentity.h" 20 | 21 | using namespace emscripten; 22 | 23 | EMSCRIPTEN_BINDINGS(libcellml_namedentity) { 24 | 25 | class_>("NamedEntity") 26 | .function("setName", &libcellml::NamedEntity::setName) 27 | .function("name", &libcellml::NamedEntity::name) 28 | .function("removeName", &libcellml::NamedEntity::removeName) 29 | ; 30 | } 31 | -------------------------------------------------------------------------------- /cmake/checkfordebugheaderusage.cmake: -------------------------------------------------------------------------------- 1 | # Copyright libCellML Contributors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | foreach(_INDEX RANGE 3 ${CMAKE_ARGC}) 16 | set(_FILE ${CMAKE_ARGV${_INDEX}}) 17 | if (EXISTS ${_FILE}) 18 | file(STRINGS ${_FILE} _FILE_MATCHING_CONTENT REGEX "^[ \\t\\r\\n]*#[ \\t\\r\\n]*include[ \\t\\r\\n]+\"debug\\.h\"") 19 | string(LENGTH "${_FILE_MATCHING_CONTENT}" _LENGTH) 20 | if(${_LENGTH} GREATER 0) 21 | message(FATAL_ERROR "Detected a source file that uses the debug.h header file '${_FILE}'.") 22 | endif() 23 | endif() 24 | endforeach() 25 | 26 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py: -------------------------------------------------------------------------------- 1 | # The content of this file was generated using the Python profile of libCellML 0.6.3. 2 | 3 | from enum import Enum 4 | from math import * 5 | 6 | 7 | __version__ = "0.6.0" 8 | LIBCELLML_VERSION = "0.6.3" 9 | 10 | CONSTANT_COUNT = 0 11 | COMPUTED_CONSTANT_COUNT = 1 12 | ALGEBRAIC_VARIABLE_COUNT = 0 13 | 14 | CONSTANT_INFO = [ 15 | ] 16 | 17 | COMPUTED_CONSTANT_INFO = [ 18 | {"name": "x", "units": "dimensionless", "component": "my_component"} 19 | ] 20 | 21 | ALGEBRAIC_INFO = [ 22 | ] 23 | 24 | 25 | def create_constants_array(): 26 | return [nan]*CONSTANT_COUNT 27 | 28 | 29 | def create_computed_constants_array(): 30 | return [nan]*COMPUTED_CONSTANT_COUNT 31 | 32 | 33 | def create_algebraic_variables_array(): 34 | return [nan]*ALGEBRAIC_VARIABLE_COUNT 35 | 36 | 37 | def initialise_arrays(constants, computed_constants, algebraic_variables): 38 | computed_constants[0] = 1.0 39 | 40 | 41 | def compute_computed_constants(constants, computed_constants, algebraic): 42 | pass 43 | 44 | 45 | def compute_variables(constants, computed_constants, algebraic_variables): 46 | pass 47 | -------------------------------------------------------------------------------- /tests/resources/generator/cell_geometry_model/model.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[6]; 16 | char units[11]; 17 | char component[14]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_unknown_var_on_rhs/model.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[2]; 16 | char units[14]; 17 | char component[13]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /tests/resources/generator/cellml_unit_scaling_constant/model.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[14]; 16 | char units[3]; 17 | char component[16]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[2]; 16 | char units[14]; 17 | char component[17]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[2]; 16 | char units[14]; 17 | char component[17]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_eqn_constant_on_rhs/model.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[2]; 16 | char units[14]; 17 | char component[13]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /src/bindings/javascript/entity.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "libcellml/entity.h" 20 | 21 | using namespace emscripten; 22 | 23 | EMSCRIPTEN_BINDINGS(libcellml_entity) { 24 | 25 | class_("Entity") 26 | .smart_ptr>("EntityPtr") 27 | .function("setId", &libcellml::Entity::setId) 28 | .function("id", &libcellml::Entity::id) 29 | .function("removeId", &libcellml::Entity::removeId) 30 | .function("equals", &libcellml::Entity::equals) 31 | ; 32 | } 33 | -------------------------------------------------------------------------------- /src/configure/versionconfig.in.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright libCellML Contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace libcellml { 22 | 23 | // clang-format off 24 | #define LIBCELLML_VERSION_MAJOR @libCellML_VERSION_MAJOR@ 25 | #define LIBCELLML_VERSION_MINOR @libCellML_VERSION_MINOR@ 26 | #define LIBCELLML_VERSION_PATCH @libCellML_VERSION_PATCH@ 27 | 28 | static unsigned int LIBCELLML_LIBRARY_VERSION = @LIBCELLML_LIBRARY_VERSION@; 29 | // clang-format on 30 | static const std::string LIBCELLML_LIBRARY_VERSION_STRING = "@LIBCELLML_LIBRARY_VERSION_STRING@"; 31 | 32 | } // namespace libcellml 33 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[2]; 16 | char units[14]; 17 | char component[17]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[2]; 16 | char units[14]; 17 | char component[20]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[2]; 16 | char units[14]; 17 | char component[20]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | -------------------------------------------------------------------------------- /tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.h: -------------------------------------------------------------------------------- 1 | /* The content of this file was generated using the C profile of libCellML 0.6.3. */ 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | extern const char VERSION[]; 8 | extern const char LIBCELLML_VERSION[]; 9 | 10 | extern const size_t CONSTANT_COUNT; 11 | extern const size_t COMPUTED_CONSTANT_COUNT; 12 | extern const size_t ALGEBRAIC_VARIABLE_COUNT; 13 | 14 | typedef struct { 15 | char name[2]; 16 | char units[14]; 17 | char component[20]; 18 | } VariableInfo; 19 | 20 | extern const VariableInfo CONSTANT_INFO[]; 21 | extern const VariableInfo COMPUTED_CONSTANT_INFO[]; 22 | extern const VariableInfo ALGEBRAIC_INFO[]; 23 | 24 | double * createConstantsArray(); 25 | double * createComputedConstantsArray(); 26 | double * createAlgebraicVariablesArray(); 27 | 28 | void deleteArray(double *array); 29 | 30 | void initialiseArrays(double *constants, double *computedConstants, double *algebraicVariables); 31 | void computeComputedConstants(double *constants, double *computedConstants, double *algebraic); 32 | void computeVariables(double *constants, double *computedConstants, double *algebraicVariables); 33 | --------------------------------------------------------------------------------