saiunit.typing.HAS_UNIT

Contents

saiunit.typing.HAS_UNIT#

saiunit.typing.HAS_UNIT#

Methods

__init__(mantissa[, unit, dtype])

all([axis, out, keepdims, where])

Test whether all array elements along a given axis evaluate to True.

any([axis, out, keepdims, where])

Test whether any of the array elements along a given axis evaluate to True.

argmax([axis, out, keepdims])

Return the index of the maximum value of an array.

argmin([axis, out, keepdims])

Return the index of the minimum value of an array.

argsort([axis, kind, order, stable, ...])

Return indices that sort an array.

astype(dtype)

Return a copy of this quantity with the mantissa cast to dtype.

clip([min, max])

Clip (limit) the values in the array to [min, max].

clone()

Return a copy of this quantity (PyTorch-style alias for copy()).

conj()

Return the complex conjugate, element-wise, preserving units.

conjugate()

Return the complex conjugate, element-wise.

copy()

Return a deep copy of this quantity.

cpu([device])

cross(b[, axisa, axisb, axisc, axis])

Cross product of two arrays.

cuda([device])

cumprod(*args, **kwds)

Return the cumulative product of elements along a given axis.

cumsum([axis, dtype, out])

Cumulative sum of elements along an axis.

diagonal([offset, axis1, axis2])

Return specified diagonals, preserving units.

dot(b)

Dot product of two arrays.

double()

expand_as(array)

Expand an array to a shape of another array.

expand_dims(axis)

Insert new axes at the given positions.

factorless()

Return an equivalent quantity whose unit has factor == 1.0.

fill(value)

Fill the array with a scalar mantissa.

flatten()

Return a 1-D copy of this quantity.

float()

half()

has_same_unit(other)

Check whether this quantity shares the same physical dimension as other.

in_unit(unit[, err_msg])

Convert this quantity to a compatible unit.

item(*args)

Extract a single element as a scalar Quantity.

max([axis, out, keepdims, initial, where])

Return the maximum of the array elements along a given axis.

mean([axis, dtype, out, keepdims, where])

Return the mean of array elements along a given axis.

min([axis, out, keepdims, initial, where])

Return the minimum of array elements along a given axis.

nancumprod(*args, **kwds)

Return the cumulative product of elements along a given axis, treating NaNs as ones.

nanprod(*args, **kwds)

Return the product of array elements over a given axis treating Not a Numbers (NaNs) as ones.

nonzero(*[, size, fill_value])

Return indices of nonzero elements of an array.

outer(b)

Outer product of two 1-D arrays.

pow(oc)

Raise this quantity to the power oc.

prod(*args, **kwds)

Return the product of array elements over the given axis.

ptp([axis, out, keepdims])

Return the peak-to-peak range along a given axis.

put(indices, values)

Replaces specified elements of an array with given values.

ravel([order, out_sharding])

Flatten array into a 1-dimensional shape.

repeat(repeats[, axis])

Repeat elements of the array.

repr_in_unit([precision])

Return a human-readable string of this quantity in its current unit.

reshape(shape[, order])

Return a quantity with the same data but a new shape.

resize(new_shape)

Change shape and size of array in-place.

round([decimals])

Evenly round the mantissa to the given number of decimals.

scatter_add(index, value)

Return a copy with value added at index.

scatter_div(index, value)

Return a copy with the element at index divided by value.

scatter_max(index, value)

Return a copy where the element at index is the maximum of the current value and value.

scatter_min(index, value)

Return a copy where the element at index is the minimum of the current value and value.

scatter_mul(index, value)

Return a copy with the element at index multiplied by value.

scatter_sub(index, value)

Return a copy with value subtracted at index.

searchsorted(v[, side, sorter])

Find indices where elements should be inserted to maintain order.

sort([axis, stable, order])

Sort the array in-place along the given axis.

split(indices_or_sections[, axis])

Split the array into multiple sub-arrays.

squeeze([axis])

Remove length-one axes from the array.

std([axis, dtype, out, ddof, keepdims, ...])

Compute the standard deviation along a given axis.

sum([axis, dtype, out, keepdims, initial, ...])

Sum of the elements of the array over a given axis.

swapaxes(axis1, axis2)

Interchange two axes of the array.

take(indices[, axis, mode, unique_indices, ...])

Select elements from the array at the given indices.

tile(reps)

Construct an array by repeating this quantity.

to(new_unit)

Convert this quantity to a different (compatible) unit.

to_decimal([unit])

Return the numerical value expressed in the given unit, without wrapping the result in a Quantity.

tolist()

Convert the array to a (nested) Python list of Quantity scalars.

trace([offset, axis1, axis2])

Sum along diagonals of the array, preserving units.

transpose(*axes)

Return the array with axes transposed.

tree_flatten()

Tree flattens the data.

tree_unflatten(unit, values)

Tree unflattens the data.

unsqueeze(axis)

Insert a length-one axis (PyTorch-style alias for expand_dims()).

update_mantissa(mantissa)

Replace the mantissa in-place, keeping the same unit.

var([axis, dtype, out, ddof, keepdims, ...])

Compute the variance along a given axis.

view(*args[, dtype])

New view of array with the same data.

with_unit(mantissa, unit)

Create a Quantity from a raw value and a unit.

Attributes

T

at

Helper property for index update functionality.

dim

The physical dimension of this quantity (e.g. length, mass, time).

dtype

The data type of the mantissa.

flat

1-D iterator over the mantissa elements, unit preserved.

imag

is_unitless

True if this quantity is dimensionless (has no physical unit).

isfinite

isinf

isinfinite

isnan

isreal

isscalar

itemsize

Length (in bytes) of one array element.

mT

Matrix transpose of the last two dimensions, preserving units.

magnitude

Alias for mantissa.

mantissa

The raw numerical data of this quantity (without the unit).

nbytes

Total bytes consumed by the mantissa array.

ndim

real

shape

The shape of the mantissa array.

size

strides

Tuple of byte-steps in each dimension (mirrors numpy.ndarray.strides).

unit

The Unit attached to this quantity.

alias of Quantity