flopscope.
API Reference

NumPy array routines

The counted NumPy-shaped surface for arrays, random sampling, Fourier transforms, and linear algebra.

Core array routines

Array construction, indexing, reductions, einsum, and other counted NumPy-style entry points.

flopscope.numpy.argpartition

Perform an indirect partition along the given axis using the algorithm specified by the `kind` keyword. It returns an array of indices of the same shape as `a` that index data along the given axis in partitioned order.

flopscope.numpy.bitwise_count

Computes the number of 1-bits in the absolute value of ``x``. Analogous to the builtin `int.bit_count` or ``popcount`` in C++.

flopscope.numpy.complex128

Complex number type composed of two double-precision floating-point numbers, compatible with Python :class:`complex`.

flopscope.numpy.delete

Return a new array with sub-arrays along an axis deleted. For a one dimensional array, this returns those entries not returned by `arr[obj]`.

flopscope.numpy.einsum_path

Evaluates the lowest cost contraction order for an einsum expression by considering the creation of intermediate arrays.

flopscope.numpy.float64

Double-precision floating-point number type, compatible with Python :class:`float` and C ``double``.

flopscope.numpy.floor_divide

Return the largest integer smaller or equal to the division of the inputs. It is equivalent to the Python ``//`` operator and pairs with the Python ``%`` (`remainder`), function so that ``a = a % b + b * (a // b)`` up to roundoff.

flopscope.numpy.from_dlpack

Create a NumPy array from an object implementing the ``__dlpack__`` protocol. Generally, the returned NumPy array is a view of the input object. See [1]_ and [2]_ for more details.

flopscope.numpy.isin

Calculates ``element in test_elements``, broadcasting over `element` only. Returns a boolean array of the same shape as `element` that is True where an element of `element` is in `test_elements` and False otherwise.

flopscope.numpy.min_scalar_type

For scalar ``a``, returns the data type with the smallest size and smallest scalar kind which can hold its value. For non-scalar array ``a``, returns the vector's dtype unmodified.

flopscope.numpy.nan_to_num

Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the numbers defined by the user using the `nan`, `posinf` and/or `neginf` keywords.

flopscope.numpy.nanargmax

Return the indices of the maximum values in the specified axis ignoring NaNs. For all-NaN slices ``ValueError`` is raised. Warning: the results cannot be trusted if a slice contains only NaNs and -Infs.

flopscope.numpy.nanargmin

Return the indices of the minimum values in the specified axis ignoring NaNs. For all-NaN slices ``ValueError`` is raised. Warning: the results cannot be trusted if a slice contains only NaNs and Infs.

flopscope.numpy.nancumprod

Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one. The cumulative product does not change when NaNs are encountered and leading NaNs are replaced by ones.

flopscope.numpy.nancumsum

Return the cumulative sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. The cumulative sum does not change when NaNs are encountered and leading NaNs are replaced by zeros.

flopscope.numpy.nanmax

Return the maximum of an array or maximum along an axis, ignoring any NaNs. When all-NaN slices are encountered a ``RuntimeWarning`` is raised and NaN is returned for that slice.

flopscope.numpy.nanmin

Return minimum of an array or minimum along an axis, ignoring any NaNs. When all-NaN slices are encountered a ``RuntimeWarning`` is raised and Nan is returned for that slice.

flopscope.numpy.nanprod

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

flopscope.numpy.nanquantile

Compute the qth quantile of the data along the specified axis, while ignoring nan values. Returns the qth quantile(s) of the array elements.

flopscope.numpy.nansum

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

flopscope.numpy.nditer

Efficient multi-dimensional iterator object to iterate over arrays. To get started using this object, see the :ref:`introductory guide to array iteration <arrays.nditer>`.

flopscope.numpy.promote_types

Returns the data type with the smallest size and smallest scalar kind to which both ``type1`` and ``type2`` may be safely cast. The returned data type is always considered "canonical", this mainly means that the promoted dtype will always be in native byte order.

Linear algebra

Counted linear algebra routines under `flopscope.numpy.linalg`.

flopscope.numpy.linalg.eigh

Return the eigenvalues and eigenvectors of a complex Hermitian (conjugate symmetric) or a real symmetric matrix.

flopscope.numpy.linalg.multi_dot

Compute the dot product of two or more arrays in a single function call, while automatically selecting the fastest evaluation order.

flopscope.numpy.linalg.svdvals

Returns the singular values of a matrix (or a stack of matrices) ``x``. When x is a stack of matrices, the function will compute the singular values for each matrix in the stack.

Fourier transforms

Counted FFT routines under `flopscope.numpy.fft`.

flopscope.numpy.fft.ifftshift

The inverse of `fftshift`. Although identical for even-length `x`, the functions differ by one sample for odd-length `x`.

Random sampling

Counted random sampling routines, including symmetry-aware sampling helpers.

flopscope.numpy.random.Generator.integers

Return random integers from `low` (inclusive) to `high` (exclusive), or if endpoint=True, `low` (inclusive) to `high` (inclusive). Replaces `RandomState.randint` (with endpoint=False) and `RandomState.random_integers` (with endpoint=True)

flopscope.numpy.random.random

Return random floats in the half-open interval [0.0, 1.0). Alias for `random_sample` to ease forward-porting to the new random API.

flopscope.numpy.random.SeedSequence

SeedSequence mixes sources of entropy in a reproducible way to set the initial state for independent and very probably non-overlapping BitGenerators.