rex.rechunk_h5.chunk_size.TimeseriesChunkSize

class TimeseriesChunkSize(shape, dtype, chunk_size=2, weeks_per_chunk=None)[source]

Bases: BaseChunkSize

Compute Timeseries chunks based on dtype, and weeks_per_chunk

Parameters:
  • shape (tuple) – Array shape

  • dtype (str | np.dtype) – Array data type

  • chunk_size (int, optional) – Chunk size in MB, by default 2

  • weeks_per_chunk (int, optional) – Number of weeks per time chunk, if None scale weeks based on 8 weeks for hourly data, by default None

Methods

compute(shape, dtype[, chunk_size, ...])

Compute chunks based on array shape and dtype

compute_dtype_chunks(shape, dtype[, ...])

Compute chunks based on array shape and dtype

Attributes

chunks

Dataset chunk size along all axis

classmethod compute_dtype_chunks(shape, dtype, chunk_size=2, weeks_per_chunk=None)[source]

Compute chunks based on array shape and dtype

Parameters:
  • shape (tuple) – Array shape

  • dtype (str | np.dtype) – Array data type

  • chunk_size (int, optional) – Chunk size in MB, by default 2

  • weeks_per_chunk (int, optional) – Number of weeks per time chunk, if None scale weeks based on 8 weeks for hourly data, by default None

Returns:

chunks (tuple) – Dataset chunk size along all axis

classmethod compute(shape, dtype, chunk_size=2, weeks_per_chunk=None)[source]

Compute chunks based on array shape and dtype

Parameters:
  • shape (tuple) – Array shape

  • dtype (str | np.dtype) – Array data type

  • chunk_size (int, optional) – Chunk size in MB, by default 2

  • weeks_per_chunk (int, optional) – Number of weeks per time chunk, if None scale weeks based on 8 weeks for hourly data, by default None

Returns:

chunks (tuple) – Dataset chunk size along all axis

property chunks

Dataset chunk size along all axis

Returns:

tuple