MCPcopy
hub / github.com/dask/dask / finalize

Function finalize

dask/array/core.py:1270–1288  ·  view source on GitHub ↗
(results)

Source from the content-addressed store, hash-verified

1268
1269
1270def finalize(results):
1271 if not results:
1272 return concatenate3(results)
1273 results2 = results
1274 while isinstance(results2, (tuple, list)):
1275 if len(results2) > 1:
1276 return concatenate3(results)
1277 else:
1278 results2 = results2[0]
1279
1280 results = unpack_singleton(results)
1281 # Single chunk. There is a risk that the result holds a buffer stored in the
1282 # graph or on a process-local Worker. Deep copy to make sure that nothing can
1283 # accidentally write back to it.
1284 try:
1285 return results.copy() # numpy, sparse, scipy.sparse (any version)
1286 except AttributeError:
1287 # Not an Array API object
1288 return results
1289
1290
1291CHUNKS_NONE_ERROR_MESSAGE = """

Callers

nothing calls this directly

Calls 3

concatenate3Function · 0.85
unpack_singletonFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…