Closed joaosferreira closed 4 years ago
I would love to fix this issue, but not sure where these functions will be used. Can anyone help me get started?
Hi, @sayandip18. You can find example multimethods in: https://github.com/Quansight-Labs/unumpy/blob/master/unumpy/_multimethods.py
Documentation on writing new multimethods is available here: https://uarray.org/en/latest/multimethod_docs.html
You will need to add multimethods that mirror the API of np.isclose
and np.allclose
.
Is the Numpy-C API a prerequisite for this?
The NumPy C-API is not a prerequisite for any of our projects. The Python C-API is a prerequisite for uarray
only. unumpy
doesn't have any prerequisites besides a solid understanding of Python.
The task that is associated with this issue is a part of unumpy
.
To be clear, a unumpy
multimethod is an empty shell that dispatches to NumPy or another backend. It is not a full-fledged implementation, although it can include a simplified implementation in terms of other multimethods.
As stated in https://github.com/Quansight-Labs/unumpy/pull/44#discussion_r383711633, the functions
np.isclose
andnp.allclose
are more appropriate when comparing floating-point values, which is necessary in several scenarios.With this in mind we propose that these should be added to the family of available
unumpy
functions as to avoid using the originalnumpy
library and others.