Classes for representing the model.
Bases: object
Tree node for model tree.
ModelComponent
parent of this component.
dict
dict of child components - name is key and ModelComponent is value.
dict
attributes of the component. These become HDF5 attributes when it is written to file.
hdf5 Group
the group that this component corresponds to in NSDF file.
Add a child component under this model component.
Parameters: | child (ModelComponent) – child component to add to this component |
---|---|
Returns: | None |
Raises: | TypeError – |
Add a list of children to current component.
Parameters: | children (list) – list of children to be added. |
---|---|
Returns: | None |
Raises: | TypeError – |
Check that uid are indeed unique.
Parameters: |
|
---|
Note
If any uid is not set, this function as a side effect creates the uids in the form parentuid/name - similar to unix file paths.
Return a dictionary mapping the unique id of the model components to their path in modeltree.
See also
update_id_path_dict
Get node at path relative to this node.
Parameters: | path (str) – path obtained by concatenating component names with / as separator. |
---|---|
Returns: | ModelComponent at the specified path |
Raises: | KeyError if there is no element at the specified path. – |
Recursively print subtree rooted at this component.
Parameters: | indent (str) – indentation. |
---|---|
Returns: | None |