Nektar++
Private Member Functions | List of all members
CellMLToNektar.pycml.mathml_units_mixin_set_operands Class Reference
Inheritance diagram for CellMLToNektar.pycml.mathml_units_mixin_set_operands:
[legend]

Private Member Functions

def _set_in_units (self, units, no_act=False)
 

Detailed Description

Definition at line 3571 of file pycml.py.

Member Function Documentation

◆ _set_in_units()

def CellMLToNektar.pycml.mathml_units_mixin_set_operands._set_in_units (   self,
  units,
  no_act = False 
)
private
Set the units of the application of this operator.

The default behaviour for many operators is to simply set all operands to have the given units.

Definition at line 3572 of file pycml.py.

3572 def _set_in_units(self, units, no_act=False):
3573 """Set the units of the application of this operator.
3574
3575 The default behaviour for many operators is to simply set all operands to have the given units.
3576 """
3577 # TODO: Do the conversion at this level sometimes rather than pushing it down the tree?
3578 app = self.xml_parent
3579 # We need to convert the operands to a list, because the tree
3580 # may be modified if a conversion is thought to be needed
3581 for operand in list(app.operands()):
3582 self._set_element_in_units(operand, units, no_act)
3583 # And set our units to what they now are
3584 if not no_act:
3585 app._cml_units = units
3586 return
3587

References CellMLToNektar.pycml.mathml_units_mixin._set_element_in_units().