I see what you mean, there is, however, some inconsistency on how this is
handled, and it's not entirely intuitive
```
_type=np.int8
N=8
np.linspace(
start=np.iinfo(_type).min,
stop=np.iinfo(_type).max,
num=N,
dtype=_type,
)
=>array([-128, -92, -56, -19, 17, 54, 90,
Hello all.
I believe that over the years there were multiple proposals to replace the
linspace formula start + n *(stop - start) / (npoints - 1) with a * start + b *
end with a, b linearly spaced between 0 and 1 with npoints. Concretely, a = n /
(npoints - 1), b = 1 - a. Here, 0 <= n < npoints.
Hello,
perhaps it would be best to have an issue about this on github?
It might be worth pointing out that the original problem triggers a
floating point error that can be caught and handled via errstate. This
might be used either in linspace itself, or, if you think this rare
problem is like
On Mon, Jan 10, 2022 at 7:15 AM Hameer Abbasi
wrote:
> Hello all.
>
> I believe that over the years there were multiple proposals to replace the
> linspace formula start + n *(stop - start) / (npoints - 1) with a * start +
> b * end with a, b linearly spaced between 0 and 1 with npoints. Concrete
Hi all,
I am a long time user of astropy.units, which allows one to define
quantities with physical units as follows:
>>> from astropy import units as u
>>> 10 << u.cm
>>> np.sqrt(4 << u.m ** 2)
>>> ([1, 1, 0] << u.m) @ ([0, 10, 20] << u.cm / u.s)
>>> (([1, 1, 0] << u.m) * ([0, 10, 20] << u.cm
There are no C-level APIs for __array_function__ or __array_ufunc__, so
yes, at a high-level Python methods will be invoked by NumPy.
That said, NumPy's logic for handling __array_function__ and
__array_ufunc__ methods is written in highly optimized C. If you wrote your
own __array_function__ and
On Mon, 2022-01-10 at 15:25 -0800, Stephan Hoyer wrote:
> There are no C-level APIs for __array_function__ or __array_ufunc__,
> so
> yes, at a high-level Python methods will be invoked by NumPy.
>
> That said, NumPy's logic for handling __array_function__ and
> __array_ufunc__ methods is written
On January 11, 2022, Sebastian Berg wrote:
> On Mon, 2022-01-10 at 15:25 -0800, Stephan Hoyer wrote:
> > There are no C-level APIs for __array_function__ or __array_ufunc__,
> > so
> > yes, at a high-level Python methods will be invoked by NumPy.
> >
> > That said, NumPy's logic for handling __ar