Verified Commit ad89e4a5 authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

CDAG: Use __slots__ for nodes

parent 92081cae
Pipeline #34287 passed with stages
in 15 minutes and 44 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