From 3ecfc67b73e472b6379ad624219493ab0993fe40 Mon Sep 17 00:00:00 2001 From: LunarLanding <4441338+LunarLanding@users.noreply.github.com> Date: Thu, 25 Nov 2021 14:32:06 +0000 Subject: [PATCH] Allow chunks=None for dask-less lazy loading Otherwise, the preprocess step always gets a single chunk for each variable instead of the xarray lazy accessors; dask can't change the order of slicing / computing in most cases. The default is changed to {} to maintain the default behavior. --- xarray/backends/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xarray/backends/api.py b/xarray/backends/api.py index 0ca82555c8f..fba5f71e3d0 100644 --- a/xarray/backends/api.py +++ b/xarray/backends/api.py @@ -691,7 +691,7 @@ def open_dataarray( def open_mfdataset( paths, - chunks=None, + chunks={}, concat_dim=None, compat="no_conflicts", preprocess=None, @@ -891,7 +891,7 @@ def open_mfdataset( "instead specify combine='nested' along with a value for `concat_dim`.", ) - open_kwargs = dict(engine=engine, chunks=chunks or {}, **kwargs) + open_kwargs = dict(engine=engine, chunks=chunks, **kwargs) if parallel: import dask