<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On 5 Jul 2017, at 19:05, Stephan Hoyer <<a href="mailto:shoyer@gmail.com" class="">shoyer@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 5, 2017 at 10:40 AM, Chris Barker <span dir="ltr" class=""><<a href="mailto:chris.barker@noaa.gov" target="_blank" class="">chris.barker@noaa.gov</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">Along those lines, there was some discussion of having a set of utilities (or maybe eve3n an ABC?) that would make it easier to create a ndarray-like object.</div><div class=""><br class=""></div><div class="">That is, the boilerplate needed for multi-dimensional indexing and slicing, etc...</div><div class=""><br class=""></div><div class="">That could be a nice little sprint-able project.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Indeed. Let me highlight <a href="https://github.com/pydata/xarray/blob/6a20f917041abf53bcb35e210d59f5b331211012/xarray/core/utils.py#L381-L425" class="">a few mixins</a> that I wrote for xarray that might be more broadly useful. 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. But at least defining a base list of methods to implement/override would be useful.</div><div class=""><br class=""></div><div class="">In NumPy, this could go along with NDArrayOperatorsMixins in <a href="https://github.com/numpy/numpy/blob/14cd918c651d72f4c2a8681093e114f01d5bdc36/numpy/lib/mixins.py" class="">numpy/lib/mixins.py</a></div></div></div></div></div></blockquote></div><br class=""><div class="">Slightly off topic, but as someone who has just spent a fair amount of time implementing various<div class="">subclasses of nd-array, I am interested (and a little concerned), that the consensus is not to use</div><div class="">them. Is there anything available which explains why this is the case and what the alternatives</div><div class="">are?</div><div class=""><br class=""></div><div class="">Ben</div></div></body></html>