Definition at line 3588 of file pycml.py.
def CellMLToNektar.pycml.mathml_units_mixin_equalise_operands._set_in_units |
( |
|
self, |
|
|
|
units, |
|
|
|
no_act = False |
|
) |
| |
|
private |
Set the units of the application of this operator.
This method is used for the relational operators. It ignores the
given units, and instead ensures that all operands have the same
units. The units it chooses are those that are 'least' amongst the
possibilities for the operand units, i.e. that have the smallest
multiplicative factor when expanded.
Definition at line 3589 of file pycml.py.
References CellMLToNektar.pycml.mathml_units_mixin._set_element_in_units(), and CellMLToNektar.pycml.get_multiplicative_factor().
3591 """Set the units of the application of this operator.
3593 This method is used for the relational operators. It ignores the
3594 given units, and instead ensures that all operands have the same
3595 units. The units it chooses are those that are 'least' amongst the
3596 possibilities for the operand units, i.e. that have the smallest
3597 multiplicative factor when expanded.
3599 app = self.xml_parent
3600 min_factor, operand_units =
None,
None
3601 for us
in app._get_operand_units():
3602 if isinstance(us, cellml_units):
3606 if f < min_factor
or min_factor
is None:
3611 for operand
in list(app.operands()):
3616 app._cml_units = units
def get_multiplicative_factor
def _set_element_in_units