On Wed, Jul 5, 2017 at 11:05 AM, Stephan Hoyer <sho...@gmail.com> wrote:

> That is, the boilerplate needed for multi-dimensional indexing and
>> slicing, etc...
>>
>> That could be a nice little sprint-able project.
>>
>
> Indeed. Let me highlight a few mixins
> <https://github.com/pydata/xarray/blob/6a20f917041abf53bcb35e210d59f5b331211012/xarray/core/utils.py#L381-L425>
>  that
> I wrote for xarray that might be more broadly useful.
>

At a quick glance, that is exactly the kind of ting I had in mind.

The challenge here is that there are quite a few different meanings to
> "ndarray-like", so mixins really need to be mix-and-match-able.
>

exactly!


> But at least defining a base list of methods to implement/override would
> be useful.
>

With sample implementations, even... at last of parts of it -- I'm thinking
things like parsing out the indexes/slices in __getitem__ -- that sort of
thing.



> In NumPy, this could go along with NDArrayOperatorsMixins in
> numpy/lib/mixins.py
> <https://github.com/numpy/numpy/blob/14cd918c651d72f4c2a8681093e114f01d5bdc36/numpy/lib/mixins.py>
>

Yes! I had no idea that existed.

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.gov
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to