Commit 4db6bd37 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Merge branch 'noc-cdag-node-slots' into 'master'

CDAG: Use __slots__ for nodes

See merge request !5900
parents 92081cae ad89e4a5
Pipeline #34302 failed with stages
in 33 minutes and 18 seconds
......@@ -73,6 +73,18 @@ class BaseCDAGNode(object, metaclass=BaseCDAGNodeMetaclass):
config_cls_slot: Type # Filled by metaclass
state_cls_slot: Type # Filled by metaclass
__slots__ = (
"node_id",
"description",
"state",
"config",
"_subscribers",
"_inputs",
"const_inputs",
"_const_value",
"sticky",
)
def __init__(
self,
node_id: str,
......
......@@ -34,6 +34,7 @@ class MetricsNode(BaseCDAGNode):
categories = [Category.UTIL]
config_cls = MetricsNodeConfig
dot_shape = "folder"
__slots__ = ("cleaners",)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
......
......@@ -57,6 +57,8 @@ class ProbeNode(BaseCDAGNode):
# Test stub, set by .set_scale() classmethod
_SCALE: Dict[str, Tuple[int, int]] = {}
__slots__ = "convert", "base", "exp"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.convert = self.get_convert(self.config.unit)
......
......@@ -82,6 +82,7 @@ class SubgraphNode(BaseCDAGNode):
config_cls = SubgraphConfig
state_cls = SubgraphState
categories = [Category.UTIL]
__slots__ = "state", "cdag", "input_mappings", "measure_node"
def __init__(
self,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment