sgkit icon indicating copy to clipboard operation
sgkit copied to clipboard

Add ChunkType to sgkit.typing

Open eric-czech opened this issue 5 years ago • 2 comments

IO functions often take Dask chunk specifications and my type hints for those have been inconsistent. We should add a ChunkType or something like it so it is more clear when a chunk specification is a pass-through to Dask.

eric-czech avatar Aug 27 '20 14:08 eric-czech

This would be a good guide (xr.DataArray.chunks):

        chunks: Union[
            None,
            Number,
            Tuple[Number, ...],
            Tuple[Tuple[Number, ...], ...],
            Mapping[Hashable, Union[None, Number, Tuple[Number, ...]]],
        ] = None,

eric-czech avatar Sep 03 '20 21:09 eric-czech

Looks like mypy needs int rather than Number now: https://github.com/pydata/xarray/commit/a73628317acd73cb55f03ad036708d493f4a8b54

tomwhite avatar Jun 28 '21 09:06 tomwhite