iarray.Config#

class iarray.Config(codec: ~iarray.Codec = <factory>, zfp_meta: int = <factory>, clevel: int = <factory>, favor: ~iarray.Favor = <factory>, filters: ~typing.List[~iarray.Filter] = <factory>, fp_mantissa_bits: int = <factory>, use_dict: bool = <factory>, nthreads: int = <factory>, eval_method: ~iarray.Eval = <factory>, seed: int = <factory>, random_gen: ~iarray.RandomGen = <factory>, btune: bool = <factory>, dtype: (<class 'numpy.float64'>, <class 'numpy.float32'>, <class 'numpy.int64'>, <class 'numpy.int32'>, <class 'numpy.int16'>, <class 'numpy.int8'>, <class 'numpy.uint64'>, <class 'numpy.uint32'>, <class 'numpy.uint16'>, <class 'numpy.uint8'>, <class 'numpy.bool_'>) = <factory>, np_dtype: bytes = <factory>, split_mode: ~iarray.SplitMode = <factory>, chunks: ~typing.Optional[~typing.Sequence] = <factory>, blocks: ~typing.Optional[~typing.Sequence] = <factory>, urlpath: bytes = <factory>, mode: str = <factory>, contiguous: bool = <factory>)#

Dataclass for hosting the different ironArray parameters.

All the parameters below are optional. In case you don’t specify one, a sensible default (see below) is used.

Parameters
  • codec (Codec) – The codec to be used inside Blosc. Default is Codec.ZSTD.

  • zfp_meta (int) – It should be set when using Codec.ZFP_FIXED_ACCURACY, Codec.ZFP_FIXED_PRECISION or Codec.ZFP_FIXED_RATE. It sets the absolute error, precision or ratio respectively. For more info see C-Blosc2 documentation .

  • clevel (int) – The compression level. It can have values between 0 (no compression) and 9 (max compression). Default is 1.

  • btune (bool) – Enable btune machinery. The default is True. When setting favor btune has to be enabled, whereas when setting clevel, codec or filters, it has to be disabled.

  • favor (Favor) – What favor when compressing. Possible values are Favor.SPEED for better speed, Favor.CRATIO for better compression ratios and Favor.BALANCE for a balance among the two. Default is Favor.BALANCE. For this to work properly, btune has to be enabled (the default).

  • filters (Filter list) – The list of filters for Blosc. Default is [Filter.BITSHUFFLE].

  • fp_mantissa_bits (int) – The number of bits to be kept in the mantissa in output arrays. If 0 (the default), no precision is capped. FYI, double precision have 52 bit in mantissa, whereas single precision has 23 bit. For example, if you set this to 23 for doubles, you will be using a compressed store very close as if you were using singles. This automatically enables the ia.Filter.TRUNC_PREC at the front of the filters list.

  • use_dict (bool) – Whether Blosc should use a dictionary for enhanced compression (currently only supported by Codec.ZSTD). Default is False.

  • nthreads (int) – The number of threads for internal ironArray operations. This number can be silently capped to be the number of logical cores in the system. If 0 (the default), the number of logical cores in the system is used.

  • eval_method (Eval) – Method to evaluate expressions. The default is Eval.AUTO, where the expression is analyzed and the more convenient method is used.

  • seed (int) – The default seed for internal random generators. If None (the default), a seed will automatically be generated internally for you.

  • random_gen (RandomGen) – The random generator to be used. The default is RandomGen.MERSENNE_TWISTER.

  • dtype ((np.float64, np.float32, np.int64, np.int32, np.int16, np.int8, np.uint64, np.uint32, np.uint16,) – np.uint8, np.bool_) The data type to use. The default is np.float64.

  • np_dtype (bytes, str or np.dtype instance) – The array-protocol typestring of the np.dtype object to use. Default is None. If set, dtype must also be set. The native IArray container type used to store data will be dtype, and if needed, a cast or a copy will be made when retrieving so that the output type is np_dtype. Caveat emptor: all the internal operations will use the native dtype, not np_dtype, so it is easy to shoot in your foot if you expect the reverse thing to happen.

  • splitmode (SplitMode) – The split mode to be used inside Blosc. Default is SplitMode.AUTO_SPLIT.

  • chunks (list, tuple) – The chunk shape for the output array. If None (the default), a sensible default will be used based on the shape of the array and the size of caches in the current processor.

  • blocks (list, tuple) – The block shape for the output array. If None (the default), a sensible default will be used based on the shape of the array and the size of caches in the current processor.

  • urlpath (str) – The name of the file for persistently storing the output array. If None (the default), the output array will be stored in-memory.

  • mode (str) – Persistence mode: ‘r’ means read only (must exist); ‘r+’ means read/write (must exist); ‘a’ means read/write (create if doesn’t exist); ‘w’ means create (overwrite if exists); ‘w-’ means create (fail if exists). Default is ‘a’ for opening/loading and ‘w-’ otherwise.

  • contiguous (bool) – If True, the output array will be stored contiguously, even when in-memory. If False, the store will be sparse. The default value is False for in-memory and True for persistent storage.

__init__(codec: ~iarray.Codec = <factory>, zfp_meta: int = <factory>, clevel: int = <factory>, favor: ~iarray.Favor = <factory>, filters: ~typing.List[~iarray.Filter] = <factory>, fp_mantissa_bits: int = <factory>, use_dict: bool = <factory>, nthreads: int = <factory>, eval_method: ~iarray.Eval = <factory>, seed: int = <factory>, random_gen: ~iarray.RandomGen = <factory>, btune: bool = <factory>, dtype: (<class 'numpy.float64'>, <class 'numpy.float32'>, <class 'numpy.int64'>, <class 'numpy.int32'>, <class 'numpy.int16'>, <class 'numpy.int8'>, <class 'numpy.uint64'>, <class 'numpy.uint32'>, <class 'numpy.uint16'>, <class 'numpy.uint8'>, <class 'numpy.bool_'>) = <factory>, np_dtype: bytes = <factory>, split_mode: ~iarray.SplitMode = <factory>, chunks: ~typing.Optional[~typing.Sequence] = <factory>, blocks: ~typing.Optional[~typing.Sequence] = <factory>, urlpath: bytes = <factory>, mode: str = <factory>, contiguous: bool = <factory>) None#

Methods

__init__([codec, zfp_meta, clevel, favor, ...])