<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 5, 2017 at 11:05 AM, Stephan Hoyer <span dir="ltr"><<a href="mailto:shoyer@gmail.com" target="_blank">shoyer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>That is, the boilerplate needed for multi-dimensional indexing and slicing, etc...</div><div><br></div><div>That could be a nice little sprint-able project.</div></div></div></div></blockquote><div><br></div></span><div>Indeed. Let me highlight <a href="https://github.com/pydata/xarray/blob/6a20f917041abf53bcb35e210d59f5b331211012/xarray/core/utils.py#L381-L425" target="_blank">a few mixins</a> that I wrote for xarray that might be more broadly useful. </div></div></div></div></blockquote><div><br></div><div>At a quick glance, that is exactly the kind of ting I had in mind.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>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.</div></div></div></div></blockquote><div><br></div><div>exactly!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> But at least defining a base list of methods to implement/override would be useful.</div></div></div></div></blockquote><div><br></div><div>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.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>In NumPy, this could go along with NDArrayOperatorsMixins in <a href="https://github.com/numpy/numpy/blob/14cd918c651d72f4c2a8681093e114f01d5bdc36/numpy/lib/mixins.py" target="_blank">numpy/lib/mixins.py</a></div></div></div></div></blockquote><div><br></div><div>Yes! I had no idea that existed.</div><div><br></div><div>-CHB</div><div><br></div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>