nineml.abstraction_layer.component.ComponentClassMixinNamespaceStructure

class nineml.abstraction_layer.component.ComponentClassMixinNamespaceStructure(subnodes=None, portconnections=None)

A mixin class that provides the hierarchical structure for components.

__init__(subnodes=None, portconnections=None)

Constructor - For parameter descriptions, see the ComponentClass.__init__() method

Methods

__init__([subnodes, portconnections]) Constructor - For parameter descriptions, see the
connect_ports(src, sink) Connects the ports of 2 subcomponents.
get_node_addr() Get the namespace address of this component
get_parent_model() Gets the parent component for this component
get_subnode(addr) Gets a subnode from this component recursively.
insert_subnode(namespace, subnode) Insert a subnode into this component
set_parent_model(parentmodel) Sets the parent component for this component

Attributes

portconnections
connect_ports(src, sink)

Connects the ports of 2 subcomponents.

The ports can be specified as string s or NamespaceAddresses.

Parameters:
  • src – The source port of one sub-component; this should either an EventPort or AnalogPort, but it must be a send port.
  • sink – The sink port of one sub-component; this should either an EventPort or AnalogPort, but it must be either a ‘recv’ or a ‘reduce’ port.
get_node_addr()

Get the namespace address of this component

get_parent_model()

Gets the parent component for this component

get_subnode(addr)

Gets a subnode from this component recursively.

insert_subnode(namespace, subnode)

Insert a subnode into this component

Parameters:
  • subnode – An object of type ComponentClass.
  • namespace – A string specifying the name of the component in this components namespace.
Raises :

NineMLRuntimeException if there is already a subcomponent at the same namespace location

Note

This method will clone the subnode.

set_parent_model(parentmodel)

Sets the parent component for this component

portconnections