Closed DamienIrving closed 2 years ago
Thanks for reporting this Damian! I agree this looks like a bug. I am guessing the problem is that you do have the dimension specified as chunked here
'air': {'time': 2920, 'lat': 25, 'lon': 1},
but not here
'time': None,
'lon': None,
'lat': None,
and that is what is confusing rechunker.
To work around this, for now you might try specifying the chunks as tuples (rather than dicts), i.e.
'air': (2920, 25, 1) # assuming dim order is time, lat, lon
Ok my previous suggestion was a red herring. I think I found the issue. You want to rechunk a group. But you are passing an array to rechunk
. Try
- array_plan = rechunk(source_array, target_chunks_dict, max_mem, target_store, temp_store=temp_store)
+ array_plan = rechunk(source_group, target_chunks_dict, max_mem, target_store, temp_store=temp_store)
That worked for me!
Here is the relevant line from the tutorial:
array_plan = rechunk(source_group, target_chunks, max_mem, target_store, temp_store=temp_store)
I suppose it is confusing to call it array_plan
when actually we are rechunking a group.
Thanks, @rabernat! That fixes it. My apologies - I should have spotted that typo.
I'm rechunking a dataset that I ultimately want to open with xarray, so I was following the rechunk a group part of the online tutorial as follows (using rechunker version
0.5.0
):It looks like it isn't happy with the
'time': None, 'lon': None, 'lat': None
in the target chunks dictionary?