diff --git a/src/bindings/interface/component.i b/src/bindings/interface/component.i index e3d15fb01..65ee0f674 100644 --- a/src/bindings/interface/component.i +++ b/src/bindings/interface/component.i @@ -31,8 +31,8 @@ component in the `importSource`."; "Appends `math` to the existing math string for this component."; %feature("docstring") libcellml::Component::getMath -"Returns a math string if one has been appended for this component. Returns an -empty string if math has not been appended (or has been removed)."; +"Returns a math string if one has been created for this component (empty string +if not)."; %feature("docstring") libcellml::Component::setMath "Sets the math string for this component. @@ -42,17 +42,20 @@ If `math` is an empty string, math will be removed from the component."; "Adds variable `v` to this component."; %feature("docstring") libcellml::Component::getVariable -"Returns the variable at the given index `index`, or with the given`name`."; +"Returns a Variable from this component, specified by name or index."; %feature("docstring") libcellml::Component::hasVariable -"Tests if `variable` is in this component."; +"Tests if this component contains a given variable, specified by name or as +`Variable` object."; %feature("docstring") libcellml::Component::removeVariable -"Removes a variable from this component, specified either by name, by index, -or by passing in the variable object. +"Removes a variable from this component, specified by name, index, or +`Variable` object. If the variable to be removed is in a connection (is equivalent to another -variable), this component will not be serialised in the connection."; +variable), this component will not be serialised in the connection. + +Returns `True` on success."; %feature("docstring") libcellml::Component::removeAllVariables "Clears all variables that have been added to this component. diff --git a/src/bindings/interface/componententity.i b/src/bindings/interface/componententity.i index 4ee353ccc..b264b4b92 100644 --- a/src/bindings/interface/componententity.i +++ b/src/bindings/interface/componententity.i @@ -46,7 +46,7 @@ A second argument can be given to specify whether or not child components should be searched for the component to remove."; %feature("docstring") libcellml::ComponentEntity::getComponent -"Returns a component, specified by an index, name, or with a Component object. +"Returns a component, specified by an index or name. A second argument can be given to specify whether or not child components should be searched for the component to remove."; @@ -55,21 +55,24 @@ should be searched for the component to remove."; "Removes a component, specified by an index, name, or with a Component object. A second argument can be given to specify whether or not child components -should be searched for the component to remove."; +should be searched for the component to remove. + +Returns `True` on success."; %feature("docstring") libcellml::ComponentEntity::removeAllComponents "Removes all components that have been added to this entity."; %feature("docstring") libcellml::ComponentEntity::takeComponent -"Removes and returns a component, specified by an index, name or with a -Component object."; +"Removes and returns a component, specified by an index or name."; %feature("docstring") libcellml::ComponentEntity::replaceComponent "Removes a component, specified by an index, name, or with a Component object, and replaces it with the given component object (second argument). A third argument can be given to specify whether or not child components -should be searched for the component to remove."; +should be searched for the component to remove. + +Returns `True` on success."; %feature("docstring") libcellml::ComponentEntity::componentCount "Returns the number of components the component contains. "; diff --git a/src/bindings/interface/error.i b/src/bindings/interface/error.i index 6c9b9dcb7..2119dbfaa 100644 --- a/src/bindings/interface/error.i +++ b/src/bindings/interface/error.i @@ -6,6 +6,65 @@ %import "types.i" +%feature("docstring") libcellml::Error +"Base class for errors used with logger derived classes." + +%feature("docstring") libcellml::Error::getDescription +"Get a string description for why this error was raised."; + +%feature("docstring") libcellml::Error::setDescription +"Sets a string description for why this error was raised."; + +%feature("docstring") libcellml::Error::getKind +"Get the `kind` of this error. If no kind has been set for this error, will +return Kind::UNDEFINED."; + +%feature("docstring") libcellml::Error::isKind +"Tests if this error matches the given `kind`."; + +%feature("docstring") libcellml::Error::setKind +"Sets the `kind` of this error."; + +%feature("docstring") libcellml::Error::getRule +"Get the `SpecificationRule` of this error."; + +%feature("docstring") libcellml::Error::setRule +"Sets the `SpecificationRule` for this error."; + +%feature("docstring") libcellml::Error::getSpecificationHeading +"Returns the CellML 2.0 Specification heading associated with the +SpecificationRule for this error (empty string if not set)."; + +%feature("docstring") libcellml::Error::getComponent +"Returns the Component that this error is relevant to (or `None`)."; + +%feature("docstring") libcellml::Error::setComponent +"Sets the Component that this error is relevant to (`None` to unset)."; + +%feature("docstring") libcellml::Error::getImportSource +"Returns the ImportSource that this error is relevant to (or `None`)."; + +%feature("docstring") libcellml::Error::setImportSource +"Sets the ImportSource that this error is relevant to (`None` to unset)."; + +%feature("docstring") libcellml::Error::getModel +"Returns the Model that this error is relevant to (or `None`)."; + +%feature("docstring") libcellml::Error::setModel +"Sets the Model that this error is relevant to (`None` to unset)."; + +%feature("docstring") libcellml::Error::getUnits +"Get the Units that this error is relevant to (or `None`)."; + +%feature("docstring") libcellml::Error::setUnits +"Sets the Units that this error is relevant to (`None` to unset)."; + +%feature("docstring") libcellml::Error::getVariable +"Get the variable that this error is relevant to (or `None`)."; + +%feature("docstring") libcellml::Error::setVariable +"Sets the Variable that this error is relevant to (`None` to unset)."; + %{ #include "libcellml/error.h" %} diff --git a/src/bindings/interface/logger.i b/src/bindings/interface/logger.i index 868d04044..34b0a1090 100644 --- a/src/bindings/interface/logger.i +++ b/src/bindings/interface/logger.i @@ -14,6 +14,21 @@ } #endif +%feature("docstring") libcellml::Logger +"Base class for all serialisable libCellML classes."; + +%feature("docstring") libcellml::Logger::addError +"Adds an error to this logger."; + +%feature("docstring") libcellml::Logger::clearErrors +"Clears all errors from this logger."; + +%feature("docstring") libcellml::Logger::getError +"Returns the error at the specified `index`."; + +%feature("docstring") libcellml::Logger::errorCount +"Returns the number of errors currently stored in the logger."; + %{ #include "libcellml/logger.h" %} diff --git a/src/bindings/interface/model.i b/src/bindings/interface/model.i index c660db3cb..e60ee2664 100644 --- a/src/bindings/interface/model.i +++ b/src/bindings/interface/model.i @@ -27,6 +27,37 @@ } #endif +%feature("docstring") libcellml::Model +"Represents a CellML model."; + +%feature("docstring") libcellml::Model::addUnits +"Add a copy of the given Units to this model."; + +%feature("docstring") libcellml::Model::getUnits +"Returns a Units object from this Model, specified by index or name."; + +%feature("docstring") libcellml::Model::hasUnits +"Tests to see if this model has the given units, specified by name."; + +%feature("docstring") libcellml::Model::removeUnits +"Removes the Units specified by index, name or Units object. + +Returns `True` on success."; + +%feature("docstring") libcellml::Model::removeAllUnits +"Removes all units stored in this model."; + +%feature("docstring") libcellml::Model::replaceUnits +"Replaces a Units object, specified by index, name or Units object, by another +Units (second argument). + +Returns `True` on success."; + +%feature("docstring") libcellml::Model::takeUnits +"Removes and returns the Units specified by index or name."; + +%feature("docstring") libcellml::Model::unitsCount +"Returns the number of units this model contains."; %{ #include "libcellml/model.h"