MCPcopy Index your code
hub / github.com/dask/dask / ArrayOverlapLayer

Class ArrayOverlapLayer

dask/layers.py:124–253  ·  view source on GitHub ↗

Simple HighLevelGraph array overlap layer. Lazily computed High-level graph layer for a array overlap operations. Parameters ---------- name : str Name of new output overlap array. array : Dask array axes: Mapping Axes dictionary indicating overlap in each d

Source from the content-addressed store, hash-verified

122
123
124class ArrayOverlapLayer(Layer):
125 """Simple HighLevelGraph array overlap layer.
126
127 Lazily computed High-level graph layer for a array overlap operations.
128
129 Parameters
130 ----------
131 name : str
132 Name of new output overlap array.
133 array : Dask array
134 axes: Mapping
135 Axes dictionary indicating overlap in each dimension,
136 e.g. ``{'0': 1, '1': 1}``
137 """
138
139 def __init__(
140 self,
141 name,
142 axes,
143 chunks,
144 numblocks,
145 token,
146 ):
147 super().__init__()
148 self.name = name
149 self.axes = axes
150 self.chunks = chunks
151 self.numblocks = numblocks
152 self.token = token
153 self._cached_keys = None
154
155 def __repr__(self):
156 return f"ArrayOverlapLayer<name='{self.name}'"
157
158 @property
159 def _dict(self):
160 """Materialize full dict representation"""
161 if hasattr(self, "_cached_dict"):
162 return self._cached_dict
163 else:
164 dsk = self._construct_graph()
165 self._cached_dict = dsk
166 return self._cached_dict
167
168 def __getitem__(self, key):
169 return self._dict[key]
170
171 def __iter__(self):
172 return iter(self._dict)
173
174 def __len__(self):
175 return len(self._dict)
176
177 def is_materialized(self):
178 return hasattr(self, "_cached_dict")
179
180 def get_output_keys(self):
181 return self.keys() # FIXME! this implementation materializes the graph

Callers 2

overlap_internalFunction · 0.90
_layerMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…