Nektar++
|
Public Member Functions | |
def | __init__ |
def | __repr__ |
def | uniquify_tuple |
def | __hash__ |
def | __cmp__ |
Public Member Functions inherited from CellMLToNektar.utilities.Colourable | |
def | __init__ |
def | set_colour |
def | get_colour |
def | clear_colour |
Public Member Functions inherited from CellMLToNektar.pycml.element_base | |
def | __init__ |
def | __delattr__ |
def | __setattr__ |
def | rootNode |
def | cmeta_id |
def | xml_remove_child_at |
def | xml_doc |
def | xml_properties |
Private Member Functions | |
def | _hash_tuple |
Private Attributes | |
_cml_expanded | |
_cml_simplified | |
_cml_generated | |
_cml_quotients | |
_cml_hash | |
_cml_hash_tup | |
Additional Inherited Members | |
Public Attributes inherited from CellMLToNektar.pycml.element_base | |
xml_attributes | |
Specialised units class. Contains useful methods for defining the standard units dictionary, and checking for units consistency. After being defined, a units definition should be regarded as being immutable, as should individual <unit> elements, so the expansion and simplification methods create new objects, which don't really live in the document tree (they're not a child of any element in the model), although they do have their xml_parent attribute set. Note that <unit> elements must not be made a child of more than one <units> element, otherwise the linked lists get tangled up.
def CellMLToNektar.pycml.cellml_units.__cmp__ | ( | self, | |
other | |||
) |
Compare 2 units objects, by comparing their hashes. Means using units as dictionary keys is more sane.
Definition at line 2607 of file pycml.py.
References CellMLToNektar.pycml.cellml_units._cml_hash_tup.
def CellMLToNektar.pycml.cellml_units.__hash__ | ( | self | ) |
Generate a hash for these units. Hashes a tuple, the first element of which is the result of self.is_base_unit(), the second of which is our name if we are not auto-generated, and the remaining elements of which are our <unit> elements.
Definition at line 2596 of file pycml.py.
References CellMLToNektar.pycml.cellml_units._cml_hash, and CellMLToNektar.pycml.cellml_units._hash_tuple().
def CellMLToNektar.pycml.cellml_units.__repr__ | ( | self | ) |
Definition at line 2566 of file pycml.py.
References CellMLToNektar.pycml.cellml_component.name.
|
private |
Generate a tuple used as the basis for our hash value.
Definition at line 2570 of file pycml.py.
References CellMLToNektar.pycml.cellml_units._cml_generated, CellMLToNektar.pycml.cellml_units._cml_hash, and CellMLToNektar.pycml.cellml_component.name.
Referenced by CellMLToNektar.pycml.cellml_units.__hash__().
def CellMLToNektar.pycml.cellml_units.uniquify_tuple | ( | self | ) |
For avoiding duplicate identical units definitions. Based on description(cellml=True), since that is what we really want to be unique. Also includes offset information, since that is omitted in the name given by description.
Definition at line 2583 of file pycml.py.
References Nektar::LibUtilities::CmdLineArg.description, and CellMLToNektar.pycml.UnitsSet.description().
|
private |
Definition at line 2561 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_units._hash_tuple().
|
private |
Definition at line 2563 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_units.__hash__(), and CellMLToNektar.pycml.cellml_units._hash_tuple().
|
private |
Definition at line 2578 of file pycml.py.
Referenced by CellMLToNektar.pycml.cellml_units.__cmp__().