Run-time codes

Many of the classes in libCellML inherit a Logger class, which keeps track of things that may have gone wrong, as well as giving hints when the behaviour may not be as expected. This page keeps a list of the codes that are not related to CellML syntactic validation.

Issues related to validation are directed to the relevant section in the CellML 2.0 Normative Specification document instead, and are listed at the bottom of this page for completeness.

Analyser codes

ANALYSER_VARIABLE_INITIALISED_MORE_THAN_ONCE

ANALYSER_VARIABLE_NON_CONSTANT_INITIALISATION

ANALYSER_VOI_INITIALISED

ANALYSER_VOI_SEVERAL

ANALYSER_ODE_NOT_FIRST_ORDER

ANALYSER_VARIABLE_UNUSED

ANALYSER_STATE_NOT_INITIALISED

ANALYSER_VARIABLE_COMPUTED_MORE_THAN_ONCE

ANALYSER_EXTERNAL_VARIABLE_DIFFERENT_MODEL

ANALYSER_EXTERNAL_VARIABLE_VOI

ANALYSER_EXTERNAL_VARIABLE_USE_PRIMARY_VARIABLE

Annotator codes

ANNOTATOR_NO_MODEL

The Annotator class needs a Model item on which to operate. If you’re seeing an issue with this code, it’s because you need to use the setModel function to add it.

ANNOTATOR_NULL_MODEL

This code is generated when the Annotator is given a null pointer instead of a Model item.

ANNOTATOR_ID_NOT_FOUND

When the Model that was submitted to this Annotator does not have any item with the requested id string, a warning with this code is created.

API Annotator::item function (or any of the type-specific retrieval functions)

How-to Annotate a model

Tutorial Tutorial 5: Annotation

Common users Annotation tool developer

Please note that currently the Annotator class does not check for ids within MathML strings.

ANNOTATOR_ID_NOT_UNIQUE

While the Annotator is able to retrieve and manipulate collections of items with the same id, any XML document with duplicated ids is not valid. When non-unique id strings are encountered, a warning with this code is created.

ANNOTATOR_INCONSISTENT_TYPE

In contrast to all other classes in libCellML, the Annotator must be agnostic as to the type of item it deals with. It uses AnyItem type in order to be able to return items without specifying their type ahead of time. An error is issued when the information stored in an AnyItem item (the CellmlElementType of the item, and the item itself) are not consistent.

This issue is raised when attempting to use the automatic id feature of the Annotator, and can be rectified by checking that any manually created AnyItem items have the correct pairing of CellmlElementType and object. The expected pairings are shown below.

CellmlElementType

libCellML class

COMPONENT

Component

COMPONENT_REF

Component

CONNECTION

VariablePair

ENCAPSULATION

Model

IMPORT

ImportSource

MAP_VARIABLES

VariablePair

MODEL

Model

RESET

Reset

RESET_VALUE

Reset

TEST_VALUE

Reset

UNIT

Unit

UNITS

Units

VARIABLE

Variable

Importer codes

For complete descriptions of all aspects of the Importer, please see the tutorials and examples available at the Import debugger page.

IMPORTER_NULL_MODEL

When the Importer attempts to resolve the imports in a model for flattening, but encounters an ImportSource whose associated Model is missing, this code is returned. This situation can be caused by changing any of the import sources or their references after a model has been added to the importer.

IMPORTER_MISSING_FILE

The Importer will return this code if it cannot locate or open an imported file. You can check the specified locations using the ImportSource::url() function for the imported items in your model.

Be aware that since imports can have many generations, the error may not be in your first level model. The description returned with this error will identify the model of interest.

IMPORTER_MISSING_COMPONENT

The Importer will return this code if an import reference for an imported component is not found in the specified model. The issue’s description will note the URL of the model in question.

To debug:

IMPORTER_MISSING_UNITS

The Importer will return this code if an import reference for an imported units item is not found in the specified model. The issue’s description will note the URL of the model in question.

To debug:

Parser codes

All codes returned by the Parser are related to syntax, and covered in the section below.

Printer codes

At present, the Printer class does not return any issue codes.

Miscellaneous codes

INVALID_ARGUMENT

This is a general code used by the Importer and Validator classes when the argument given is null.