[Numpy-discussion] Re: Exposing `from_dlpack` to the main namespace

2022-03-17 Thread Aaron Meurer
On Tue, Mar 8, 2022 at 10:02 AM Sebastian Berg wrote: > > On Tue, 2022-03-08 at 08:26 -0800, Stefan van der Walt wrote: > > Hi Sebastian, > > > > On Tue, Mar 8, 2022, at 07:41, Sebastian Berg wrote: > > > just a brief note that: > > > > > > https://github.com/numpy/numpy/pull/21145 > > > > > >

[Numpy-discussion] Re: Exposing `from_dlpack` to the main namespace

2022-03-08 Thread Stefan van der Walt
On Tue, Mar 8, 2022, at 09:01, Sebastian Berg wrote: > An annoyance with methods is that our class is `np.ndarray` with an > awkward `__new__` [2]. > So if it is `np.array.from_*` it would not be (only) a static- or > classmethod, but also attached to that function. It sounds like there are severa

[Numpy-discussion] Re: Exposing `from_dlpack` to the main namespace

2022-03-08 Thread Sebastian Berg
On Tue, 2022-03-08 at 08:26 -0800, Stefan van der Walt wrote: > Hi Sebastian, > > On Tue, Mar 8, 2022, at 07:41, Sebastian Berg wrote: > > just a brief note that: > > > > https://github.com/numpy/numpy/pull/21145 > > > > will add `np.from_dlpack` (to import objects implementing the > > `__dl

[Numpy-discussion] Re: Exposing `from_dlpack` to the main namespace

2022-03-08 Thread Stephan Hoyer
On Tue, Mar 8, 2022 at 8:27 AM Stefan van der Walt wrote: > In other places in the ecosystem, like pandas and xarray, `from_x` and > friends live as static methods on their respective classes. Any reason not > to add this as `numpy.array.from_dlpack`? We may also want to consider > adding all th

[Numpy-discussion] Re: Exposing `from_dlpack` to the main namespace

2022-03-08 Thread Stefan van der Walt
Hi Sebastian, On Tue, Mar 8, 2022, at 07:41, Sebastian Berg wrote: > just a brief note that: > > https://github.com/numpy/numpy/pull/21145 > > will add `np.from_dlpack` (to import objects implementing the > `__dlpack__` dunder [1]. In other places in the ecosystem, like pandas and xarray, `fr