This page describes the overall philosophy behind
unumpy. If you are
interested in a general dispatch mechanism, see
unumpy builds on top of
uarray. It is an effort to specify the core
NumPy API, and provide backends for the API.
What’s new in
unumpy is the first approach to leverage
uarray in order to build a
generic backend system for (what we hope will be) the core NumPy API specification.
It’s possible to create the backend object, and use that to perform operations.
In addition, it’s possible to change the used backend via a context manager.
Relation to the NumPy duck-array ecosystem¶
There are three main NumPy enhancement proposals (NEPs) inside NumPy itself that relate
to the duck-array ecosystem. There is NEP-22,
which is a high-level overview of the duck-array ecosystem, and the direction NumPy
intends to move towards. Two main protocols were introduced to fill this gap,
__array_function__ protocol defined in NEP-18,
and the older
__array_ufunc__ protocol defined in NEP-13.
unumpy provides an an alternate framework based on
__array_ufunc__ protocols entirely. It
provides a clear separation of concerns. It defines callables which can be overridden,
and expresses everything else in terms of these callables. See the
documentation for more details.