MCPcopy
hub / github.com/dask/dask / DataNode

Class DataNode

dask/_task_spec.py:575–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573
574
575class DataNode(GraphNode):
576 value: Any
577 typ: type
578 __slots__ = tuple(__annotations__)
579
580 def __init__(self, key: Any, value: Any):
581 if key is None:
582 key = (type(value).__name__, next(_anom_count))
583 self.key = key
584 self.value = value
585 self.typ = type(value)
586 self._dependencies = _no_deps
587
588 @property
589 def data_producer(self) -> bool:
590 return True
591
592 def copy(self):
593 return DataNode(self.key, self.value)
594
595 def __call__(self, values=()):
596 return self.value
597
598 def __repr__(self):
599 return f"DataNode({self.value!r})"
600
601 def __reduce__(self):
602 return (DataNode, (self.key, self.value))
603
604 def __dask_tokenize__(self):
605 from dask.base import tokenize
606
607 return (type(self).__name__, tokenize(self.value))
608
609 def substitute(
610 self, subs: dict[KeyType, KeyType | GraphNode], key: KeyType | None = None
611 ) -> DataNode:
612 if key is not None and key != self.key:
613 return DataNode(key, self.value)
614 return self
615
616 def __iter__(self):
617 return iter(self.value)
618
619
620def _get_dependencies(obj: object) -> set | frozenset:

Callers 15

orderFunction · 0.90
daskMethod · 0.90
_unpackFunction · 0.90
repackFunction · 0.90
_make_blockwise_graphFunction · 0.90
_taskMethod · 0.90
_layer_informationMethod · 0.90
_layer_informationMethod · 0.90
_filtered_taskMethod · 0.90
test_tokenizeFunction · 0.90
test_pickle_literalsFunction · 0.90
test_sizeofFunction · 0.90

Calls

no outgoing calls

Tested by 14

test_tokenizeFunction · 0.72
test_pickle_literalsFunction · 0.72
test_sizeofFunction · 0.72
test_linear_fusionFunction · 0.72
test_block_io_fusionFunction · 0.72
test_data_producerFunction · 0.72
_layerMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…