aquaduct.utils.maths module

class NumpyDefaultsStorageTypes[source]

Bases: object

Default types that are enforced in numpy.ndarray objects.

Note

It is used only througt defaults instance.

float_default

alias of numpy.float64

int_default

alias of numpy.int64

int_type

alias of numpy.int8

defaults = <aquaduct.utils.maths.NumpyDefaultsStorageTypes object>

Instance of NumpyDefaultsStorageTypes to store default values.

make_default_array(array_like)[source]
Parameters

array_like – Array like object

Returns

Array with dtype set to NumpyDefaultsStorageTypes.float_default.

class MemMap(filename, dtype, shape)[source]

Bases: aquaduct.utils.maths.MemMap

Provides simple convenience wrapper for numpy.memmap().

readonly()[source]
Returns

Memory map object in ‘r’ mode.

Return type

numpy.core.memmap.memmap

readwrite()[source]
Returns

Memory map object in ‘r+’ mode.

Return type

numpy.core.memmap.memmap

class ArrayOrArray(filename=None, dtype=None, shape=None)[source]

Bases: object

Convenience class for handling numpy.ndarray and numpy.core.memmap.memmap objects in a transparent way.

property isndarray
Returns

True if underlaying object is of numpy.ndarray type.

Return type

bool

readwrite()[source]
Returns

Array with read-write access.

readonly()[source]
Returns

Array with read only access, if possible