MCPcopy
hub / github.com/dask/dask / MaterializedLayer

Class MaterializedLayer

dask/highlevelgraph.py:328–361  ·  view source on GitHub ↗

Fully materialized layer of `Layer` Parameters ---------- mapping: Mapping The mapping between keys and tasks, typically a dask graph.

Source from the content-addressed store, hash-verified

326
327
328class MaterializedLayer(Layer):
329 """Fully materialized layer of `Layer`
330
331 Parameters
332 ----------
333 mapping: Mapping
334 The mapping between keys and tasks, typically a dask graph.
335 """
336
337 def __init__(self, mapping: Mapping, annotations=None, collection_annotations=None):
338 super().__init__(
339 annotations=annotations, collection_annotations=collection_annotations
340 )
341 if not isinstance(mapping, Mapping):
342 raise TypeError(f"mapping must be a Mapping. Instead got {type(mapping)}")
343 self.mapping = mapping
344
345 def __contains__(self, k):
346 return k in self.mapping
347
348 def __getitem__(self, k):
349 return self.mapping[k]
350
351 def __iter__(self):
352 return iter(self.mapping)
353
354 def __len__(self):
355 return len(self.mapping)
356
357 def is_materialized(self):
358 return True
359
360 def get_output_keys(self):
361 return self.keys()
362
363
364class HighLevelGraph(Graph):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…