Nektar++
|
Public Member Functions | |
def | __init__ (self) |
def | __repr__ (self) |
def | uniquify_tuple (self) |
def | __hash__ (self) |
def | __cmp__ (self, other) |
Public Member Functions inherited from CellMLToNektar.utilities.Colourable | |
def | __init__ (self, *args, **kwargs) |
def | set_colour (self, colour) |
def | get_colour (self) |
def | clear_colour (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) |
Private Member Functions | |
def | _hash_tuple (self) |
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.__init__ | ( | self | ) |
Reimplemented from CellMLToNektar.pycml.element_base.
Definition at line 2557 of file pycml.py.
References CellMLToNektar.pycml.cellml_units.__init__().
Referenced by CellMLToNektar.pycml.cellml_units.__init__().
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.__cmp__(), and CellMLToNektar.pycml.cellml_units._cml_hash_tup.
Referenced by CellMLToNektar.pycml.cellml_units.__cmp__().
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, CellMLToNektar.pycml.UnitsSet.description(), CellMLToNektar.pycml.description(), and CellMLToNektar.pycml.get_offset().
|
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__().