MCPcopy Create free account
hub / github.com/dask/dask / finalize

Function finalize

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

Source from the content-addressed store, hash-verified

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