earthkit.utils.array.namespace.PatchedJaxNamespace

class earthkit.utils.array.namespace.PatchedJaxNamespace[source]

Bases: UnknownPatchedNamespace

__init__()[source]

Methods

__init__()

allclose(x, y, *[, rtol, atol, equal_nan])

choice(a, size[, replace, generator])

deg2rad(x)

device(x)

dtype(x)

histogram2d(x, y, *[, bins])

Compute a 2D histogram.

histogramdd(x, *[, bins])

isclose(x, y, *[, rtol, atol, equal_nan])

percentile(a, q[, axis])

Compute percentiles by calling the quantile function.

polyval(x, c)

Evaluation of a polynomial using Horner's scheme.

quantile(a, q[, axis])

rad2deg(x)

shape(x)

Return the shape of an array.

size(x)

Return the size of an array.

to_device(x, device, **kwargs)

Attributes

xp

A thread-safe cached property decorator.

choice(a, size, replace=True, generator=None)[source]
deg2rad(x)[source]
percentile(a, q, axis=None)[source]

Compute percentiles by calling the quantile function.

quantile(a, q, axis=None)[source]
rad2deg(x)[source]
xp

A thread-safe cached property decorator.

It was implemented because the functools.cached_property is not thread-safe from Python 3.12 onwards.

Parameters:

method (property method) – The property method to be decorated.

:param The __get__ method of the decorator only runs on lookups. On first call: :param it gets the underlying property’s value and stores it as the hidden name attribute: :param of the instance it was called on. Subsequent calls return the cached value: :param i.e. the: :param hidden name attribute.: