Typing aliases (cmomy.core.typing)#

Classes:

DataT

DataArray or Dataset

GenArrayT

NDArray or DataArray or Dataset

FloatT

TypeVar of floating point precision (np.float32, np.float64, default=Any)

SamplerArrayT

TypeVar of types wrapped by IndexSampler

Data:

IndexAny

Index

class cmomy.core.typing.DataT#

DataArray or Dataset

alias of TypeVar(‘DataT’, ~xarray.core.dataarray.DataArray, ~xarray.core.dataset.Dataset, xr.DataArray | xr.Dataset)

class cmomy.core.typing.GenArrayT#

NDArray or DataArray or Dataset

alias of TypeVar(‘GenArrayT’, NDArrayAny, ~xarray.core.dataarray.DataArray, ~xarray.core.dataset.Dataset, xr.DataArray | xr.Dataset)

class cmomy.core.typing.FloatT#

TypeVar of floating point precision (np.float32, np.float64, default=Any)

alias of TypeVar(‘FloatT’, ~numpy.float64, ~numpy.float32)

class cmomy.core.typing.SamplerArrayT#

TypeVar of types wrapped by IndexSampler

alias of TypeVar(‘SamplerArrayT’, bound=NDArrayAny | xr.DataArray | xr.Dataset)

cmomy.core.typing.Axes = int | tuple[int, ...]#

Axes type

cmomy.core.typing.AxesWrap = complex | tuple[complex, ...]#

Axes type (with wrapping)

cmomy.core.typing.AxisReduce = int | None#

Reduction axes type

cmomy.core.typing.AxisReduceWrap = complex | None#

Reduction axes type (with wrapping)

cmomy.core.typing.AxisReduceMult = int | tuple[int, ...] | None#

Reduction axes type (multiple)

cmomy.core.typing.AxisReduceMultWrap = complex | tuple[complex, ...] | None#

Reduction axes type (multiple, with wrapping)

cmomy.core.typing.RngTypes = int | collections.abc.Sequence[int] | numpy.random.bit_generator.SeedSequence | numpy.random.bit_generator.BitGenerator | numpy.random._generator.Generator#

Random number generator types

cmomy.core.typing.DTypeAny[source]#

Any dtype

cmomy.core.typing.FloatDTypes = numpy.float32 | numpy.float64#

Floating dtype

cmomy.core.typing.LongIntDType[source]#

Long integer dtype

cmomy.core.typing.NDArrayAny(*args, **kwargs)#

Array type (any dtype)

alias of ndarray[tuple[Any, …], dtype[Any]]

cmomy.core.typing.NDArrayInt(*args, **kwargs)#

Array type (int dtype)

alias of ndarray[tuple[Any, …], dtype[int64]]

cmomy.core.typing.NDArrayFloats(*args, **kwargs)#

Array type (float dtype)

alias of ndarray[tuple[Any, …], dtype[float32 | float64]]

cmomy.core.typing.NDArrayBool(*args, **kwargs)#

Array type (bool dtype)

alias of ndarray[tuple[Any, …], dtype[bool]]

cmomy.core.typing.IntDTypeT[source]#

Integer dtype

cmomy.core.typing.NDGeneric = ~FloatT | numpy.ndarray[tuple[typing.Any, ...], numpy.dtype[~FloatT]]#

Float or array of float

cmomy.core.typing.Moments = int | tuple[int] | tuple[int, int]#

Moments type

cmomy.core.typing.MomentsStrict = tuple[int] | tuple[int, int]#

Strict moments type

cmomy.core.typing.MomNDim(*args, **kwargs)#

Number of moment dimensions

alias of Literal[1, 2]

cmomy.core.typing.MomAxes = int | tuple[int] | tuple[int, int]#

Axes containing moment(s); accepts a single axis int or tuple forms.

cmomy.core.typing.MomAxesStrict = tuple[int] | tuple[int, int]#

Axes containing moment(s) in strict tuple form only (no bare int).

cmomy.core.typing.DimsReduce = collections.abc.Hashable | None#

Reduction dimension

cmomy.core.typing.DimsReduceMult = collections.abc.Hashable | ForwardRef('Collection[Hashable]') | None#

Reduction dimension(s)

cmomy.core.typing.Dims = str | collections.abc.Collection[collections.abc.Hashable] | ellipsis | None#

Dimensions

cmomy.core.typing.MomDims = collections.abc.Hashable | tuple[collections.abc.Hashable] | tuple[collections.abc.Hashable, collections.abc.Hashable]#

Dimensions containing moment(s)

cmomy.core.typing.MomDimsStrict = tuple[collections.abc.Hashable] | tuple[collections.abc.Hashable, collections.abc.Hashable]#

Dimensions containing moment(s)

cmomy.core.typing.IndexAny = 'pd.Index[Any]'#

Index

cmomy.core.typing.CoordsType = collections.abc.Mapping[typing.Any, typing.Any] | None#

Coordinates

cmomy.core.typing.ArrayOrderCF = typing.Literal['C', 'F'] | None#

Order parameters

cmomy.core.typing.ArrayOrderACF = typing.Literal['A', 'C', 'F'] | None#

Order parameters

cmomy.core.typing.ArrayOrderKACF = typing.Literal['K', 'A', 'C', 'F'] | None#

NumPy order parameters. K=keep input layout, A=Fortran if possible else C, C=row-major, F=column-major

cmomy.core.typing.Casting(*args, **kwargs)#

Casting rules

alias of Literal[‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’]

cmomy.core.typing.MissingCoreDimOptions(*args, **kwargs)#

What to do if missing a core dimensions.

alias of Literal[‘raise’, ‘copy’, ‘drop’]

cmomy.core.typing.SelectMoment(*args, **kwargs)#

Moment names.

alias of Literal[‘weight’, ‘ave’, ‘cov’, ‘var’, ‘xave’, ‘yave’, ‘xvar’, ‘yvar’, ‘all’, ‘xmom_0’, ‘xmom_1’, ‘ymom_0’, ‘ymom_1’]

cmomy.core.typing.ConvertStyle(*args, **kwargs)#

Style to convert to

alias of Literal[‘central’, ‘raw’]

cmomy.core.typing.CoordsPolicy = typing.Literal['first', 'last', 'group'] | None#

Coordinate selection policy. "first" keeps first, "last" keeps last, "group" keeps grouped coordinates, None uses default behavior.