@@ -274,6 +274,7 @@ def _chunk_ds(
274274 engine ,
275275 chunks ,
276276 overwrite_encoded_chunks ,
277+ inline_array ,
277278 ** extra_tokens ,
278279):
279280 from dask .base import tokenize
@@ -292,6 +293,7 @@ def _chunk_ds(
292293 overwrite_encoded_chunks = overwrite_encoded_chunks ,
293294 name_prefix = name_prefix ,
294295 token = token ,
296+ inline_array = inline_array ,
295297 )
296298 return backend_ds ._replace (variables )
297299
@@ -303,6 +305,7 @@ def _dataset_from_backend_dataset(
303305 chunks ,
304306 cache ,
305307 overwrite_encoded_chunks ,
308+ inline_array ,
306309 ** extra_tokens ,
307310):
308311 if not isinstance (chunks , (int , dict )) and chunks not in {None , "auto" }:
@@ -320,6 +323,7 @@ def _dataset_from_backend_dataset(
320323 engine ,
321324 chunks ,
322325 overwrite_encoded_chunks ,
326+ inline_array ,
323327 ** extra_tokens ,
324328 )
325329
@@ -346,6 +350,7 @@ def open_dataset(
346350 concat_characters = None ,
347351 decode_coords = None ,
348352 drop_variables = None ,
353+ inline_array = False ,
349354 backend_kwargs = None ,
350355 ** kwargs ,
351356):
@@ -430,6 +435,12 @@ def open_dataset(
430435 A variable or list of variables to exclude from being parsed from the
431436 dataset. This may be useful to drop variables with problems or
432437 inconsistent values.
438+ inline_array: bool, optional
439+ How to include the array in the dask task graph.
440+ By default(``inline_array=False``) the array is included in a task by
441+ itself, and each chunk refers to that task by its key. With
442+ ``inline_array=True``, Dask will instead inline the array directly
443+ in the values of the task graph. See :py:func:`dask.array.from_array`.
433444 backend_kwargs: dict
434445 Additional keyword arguments passed on to the engine open function,
435446 equivalent to `**kwargs`.
@@ -505,6 +516,7 @@ def open_dataset(
505516 chunks ,
506517 cache ,
507518 overwrite_encoded_chunks ,
519+ inline_array ,
508520 drop_variables = drop_variables ,
509521 ** decoders ,
510522 ** kwargs ,
@@ -526,6 +538,7 @@ def open_dataarray(
526538 concat_characters = None ,
527539 decode_coords = None ,
528540 drop_variables = None ,
541+ inline_array = False ,
529542 backend_kwargs = None ,
530543 ** kwargs ,
531544):
@@ -613,6 +626,12 @@ def open_dataarray(
613626 A variable or list of variables to exclude from being parsed from the
614627 dataset. This may be useful to drop variables with problems or
615628 inconsistent values.
629+ inline_array: bool, optional
630+ How to include the array in the dask task graph.
631+ By default(``inline_array=False``) the array is included in a task by
632+ itself, and each chunk refers to that task by its key. With
633+ ``inline_array=True``, Dask will instead inline the array directly
634+ in the values of the task graph. See :py:func:`dask.array.from_array`.
616635 backend_kwargs: dict
617636 Additional keyword arguments passed on to the engine open function,
618637 equivalent to `**kwargs`.
@@ -660,6 +679,7 @@ def open_dataarray(
660679 chunks = chunks ,
661680 cache = cache ,
662681 drop_variables = drop_variables ,
682+ inline_array = inline_array ,
663683 backend_kwargs = backend_kwargs ,
664684 use_cftime = use_cftime ,
665685 decode_timedelta = decode_timedelta ,
0 commit comments