[Numpy-discussion] miniNEP 2: NA support via special dtypes

Charles R Harris charlesr.harris at gmail.com
Wed Jul 6 22:34:56 EDT 2011


On Wed, Jul 6, 2011 at 8:09 PM, Nathaniel Smith <njs at pobox.com> wrote:

> On Wed, Jul 6, 2011 at 7:01 PM, Charles R Harris
> <charlesr.harris at gmail.com> wrote:
> >> Numpy already has a general mechanism for defining new dtypes and
> >> slotting them in so that they're supported by ndarrays, by the casting
> >> machinery, by ufuncs, and so on. In principle, we could implement
> >
> > Well, actually not in any useful sense, take a look at what Mark went
> > through for the half floats. There is a reason the NEP went with
> > parametrized dtypes and masks. But we would sure welcome a plan and code
> to
> > make it true, it is one of the areas that could really use improvement.
>
> Err, yes, that's basically what the next few sentences say?
>
> This is basically a draft spec for implementing the parametrized dtypes
> idea.
>
> And yet:

FIXME: this really needs attention from an expert on numpy's casting
rules. But I can't seem to find the docs that explain how casting
loops are looked up and decided between (e.g., if you're casting from
dtype A to dtype B, which dtype's loops are used?), so I can't go into
details. But those details are tricky and they matter...

There is also a reason that masks were chosen to be implemented first. The
numpy code is freely available and there is no reason not to make
experiments or help Mark get some of the current problems solved, it doesn't
need to be a one man effort and your feedback will have a lot more impact if
you are in the trenches. In particular, I think there is a good deal of work
that will need to be done for the sorts, argmax, and the other functions you
mention that would give you a good idea of what was involved and how to go
about implementing your ideas.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110706/5b0cc7d1/attachment.html>


More information about the NumPy-Discussion mailing list