PlasmaCalcs.tools.arrays.memory_size_check_loading_arrays_like
- PlasmaCalcs.tools.arrays.memory_size_check_loading_arrays_like(array1, nload=1, *, MBmax=UNSET, dtype_min=UNSET)
- raise MemorySizeError if loading nload arrays like array1 will be too large.Too large if total size in MB would be more than MBmax.
- array1: array, e.g. numpy array
- must have .nbytes attribute, which tells size in bytes.
- n: int
- number of arrays like array1 which will be loaded.
- MBmax: UNSET, None, or int
- maximum size allowed, in Megabytes.UNSET –> use DEFAULTS.ARRAY_MBYTES_MAXNone –> no limit.
- dtype_min: UNSET or numpy dtype
- calculate memory as if array elements will have at least as many bytes as dtype_min.itemsize.(if array elements already have more bytes than this, use array.dtype instead.)UNSET –> use DEFAULTS.ARRAY_MEMORY_CHECK_DTYPE_MINNone –> don’t impose any minimum, just use array.dtype.
return size of array1, in MB.