Open norlandrhagen opened 1 year ago
Thanks for sharing. Can reproduce it even more simply with
target_chunks = (2, -1, 128, 128)
rechunker.rechunk(group['thetao'], target_chunks, "1000MB", tgt_mapper, temp_store=tmp_mapper)
I'll investigate.
So it looks like we can fix it with
target_chunks = (2, 45, 128, 128)
My impression is that we don't support the syntax -1
to mean "the full size of the dimension." This could easily be fixed. Or we could raise an error if you pass a chunk shape as a negative number.
Thanks for the wildly quick response @rabernat!
Didn't realize the -1
means the full size on the dim wasn't supported. Either of those options sounds like an improvement to me!
PR welcome! 😉
The check would go here: https://github.com/pangeo-data/rechunker/blob/46db8074df3d77cac6cefd1fed0931366d207a9e/rechunker/algorithm.py#L68
Just replace the special value of -1 with the corresponding shape (i.e. swap -1 for 45 like I did above), something like
new_chunks = [s if c == -1 else c for c, s in zip(chunks, shape)]
Sounds great! I'll open up a PR.
Hi there,
I'm having an issue when trying to rechunk a 4d zarr store. In the traceback at L70 of
algorithm.py
(70 headroom = max_mem // chunk_mem
), I'm getting the error:ZeroDivisionError: integer division or modulo by zero
.The snippet below should be a MRE.
A few notes:
ZeroDivisionError
happens on thethetao
var.headroom = max_mem // chunk_mem
calculation, somehow chunk_mem is being assigned to 0 in the above for loop.Traceback:
Results of
conda list
:Wondering if anyone has any thoughts on why this might be happening.
Thanks!