Nektar++
|
Public Member Functions | |
def | __init__ (self) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __hash__ (self) |
def | get_units_element (self) |
def | get_multiplicative_factor (self) |
def | get_multiplier (self) |
def | get_exponent (self) |
def | get_offset (self) |
def | clone (self) |
Public Member Functions inherited from CellMLToNektar.pycml.element_base | |
def | __init__ (self) |
def | __delattr__ (self, key) |
def | __setattr__ (self, key, value) |
def | rootNode (self) |
def | cmeta_id (self) |
def | xml_remove_child_at (self, index=-1) |
def | xml_doc (self) |
def | xml_properties (self) |
Static Public Attributes | |
dictionary | SI_PREFIXES |
Private Member Functions | |
def | _hash_tup (self) |
def | _set_units_element (self, obj, override=False) |
Private Attributes | |
_cml_units_obj | |
Additional Inherited Members | |
Public Attributes inherited from CellMLToNektar.pycml.element_base | |
xml_attributes | |
Specialised class for <unit> elements. Maintains a reference to the object representing the units definition it references, provides some helpful accessor type methods, and allows safe, easy cloning of <unit> elements.
def CellMLToNektar.pycml.cellml_unit.__init__ | ( | self | ) |
Reimplemented from CellMLToNektar.pycml.element_base.
Definition at line 3236 of file pycml.py.
def CellMLToNektar.pycml.cellml_unit.__eq__ | ( | self, | |
other | |||
) |
Compare two <unit> elements. Two <unit> elements are equal if they reference the same <units> element, and have the same prefix, multiplier, etc.
Definition at line 3247 of file pycml.py.
References CellMLToNektar.pycml.cellml_unit._hash_tup().
Referenced by CellMLToNektar.pycml.cellml_unit.__ne__().
def CellMLToNektar.pycml.cellml_unit.__hash__ | ( | self | ) |
Richer hashing function than the default based on object id. Returns the hash of a tuple of relevant attributes.
Definition at line 3260 of file pycml.py.
References CellMLToNektar.pycml.cellml_unit._hash_tup().
def CellMLToNektar.pycml.cellml_unit.__ne__ | ( | self, | |
other | |||
) |
The inverse of self.__eq__(other).
Definition at line 3257 of file pycml.py.
References CellMLToNektar.pycml.cellml_unit.__eq__().
|
private |
Create a tuple to be used for hashing/equality tests.
Definition at line 3241 of file pycml.py.
References CellMLToNektar.pycml.cellml_unit.get_exponent(), CellMLToNektar.pycml.cellml_unit.get_multiplier(), CellMLToNektar.pycml.cellml_unit.get_offset(), and CellMLToNektar.pycml.cellml_unit.get_units_element().
Referenced by CellMLToNektar.pycml.cellml_unit.__eq__(), and CellMLToNektar.pycml.cellml_unit.__hash__().
|
private |
Set the object representing the <units> element that this <unit> element references. Don't use unless you know what you're doing.
Definition at line 3274 of file pycml.py.
References CellMLToNektar.pycml.cellml_unit._cml_units_obj.
def CellMLToNektar.pycml.cellml_unit.clone | ( | self | ) |
Clone this object. Return a new <unit> element that has the same attributes as this one.
Definition at line 3321 of file pycml.py.
References CellMLToNektar.pycml.cellml_unit._cml_units_obj, and CellMLToNektar.pycml.element_base.xml_attributes.
def CellMLToNektar.pycml.cellml_unit.get_exponent | ( | self | ) |
Return the exponent of this units reference, as a float.
Definition at line 3313 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_unit._hash_tup(), and CellMLToNektar.pycml.cellml_unit.get_multiplicative_factor().
def CellMLToNektar.pycml.cellml_unit.get_multiplicative_factor | ( | self | ) |
Return the factor this units reference is multiplied by. Return the quantity m.p^e as a floating point number, where: m is the multiplier (default value 1.0) p is the multiplicative factor due to the prefix (default 10^0=1) e is the exponent (default 1)
Definition at line 3291 of file pycml.py.
References CellMLToNektar.pycml.cellml_unit.get_exponent(), CellMLToNektar.pycml.cellml_unit.get_multiplier(), and CellMLToNektar.pycml.cellml_unit.SI_PREFIXES.
def CellMLToNektar.pycml.cellml_unit.get_multiplier | ( | self | ) |
Return the multiplier of this units reference, as a float.
Definition at line 3309 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_unit._hash_tup(), and CellMLToNektar.pycml.cellml_unit.get_multiplicative_factor().
def CellMLToNektar.pycml.cellml_unit.get_offset | ( | self | ) |
Return the offset of this units reference, as a float.
Definition at line 3317 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_unit._hash_tup().
def CellMLToNektar.pycml.cellml_unit.get_units_element | ( | self | ) |
Return the object representing the <units> element that this <unit> element references.
Definition at line 3266 of file pycml.py.
References CellMLToNektar.pycml.cellml_unit._cml_units_obj, and CellMLToNektar.pycml.get_units_by_name().
Referenced by CellMLToNektar.pycml.cellml_unit._hash_tup().
|
private |
Definition at line 3238 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_unit._set_units_element(), CellMLToNektar.pycml.cellml_unit.clone(), and CellMLToNektar.pycml.cellml_unit.get_units_element().
|
static |
Definition at line 3284 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_unit.get_multiplicative_factor().