Class representing the MathML <root> operator.
Definition at line 5760 of file pycml.py.
def CellMLToNektar.pycml.mathml_root._set_in_units |
( |
|
self, |
|
|
|
units, |
|
|
|
no_act = False |
|
) |
| |
|
private |
Set the units of the application of this operator.
Set the degree to have units of dimensionless, and the operand to
have an arbitrary member of its possible units set.
Where these mean the <apply> doesn't have the given units, wrap it
in suitable units conversion mathematics.
Definition at line 5762 of file pycml.py.
5762 def _set_in_units(self, units, no_act=False):
5763 """Set the units of the application of this operator.
5765 Set the degree to have units of dimensionless, and the operand to
5766 have an arbitrary member of its possible units set.
5768 Where these mean the <apply> doesn't have the given units, wrap it
5769 in suitable units conversion mathematics.
5771 app = self.xml_parent
5772 defn_units_set = app.get_units()
5773 defn_units = defn_units_set.extract()
5774 app._add_units_conversion(app, defn_units, units, no_act)
5777 app._cml_units = defn_units
5779 if hasattr(app,
u'degree'):
5780 dimensionless = app.model.get_units_by_name(
'dimensionless')
5781 self._set_element_in_units(
_child1(app.degree), dimensionless, no_act)
5783 for src_units_set, src_units
in defn_units_set._get_sources(defn_units):
5784 expr = src_units_set.get_expression()
5785 self._set_element_in_units(expr, src_units, no_act)
References CellMLToNektar.pycml._child1(), and CellMLToNektar.pycml.mathml_units_mixin._set_element_in_units().