[Numpy-discussion] PEP: named axis
Fri Feb 6 15:30:36 CST 2009
On Fri, Feb 6, 2009 at 03:22, Stéfan van der Walt <firstname.lastname@example.org> wrote:
> Hi Robert
> 2009/2/6 Robert Kern <email@example.com>:
>>> This could be implemented but would require adding information to the
>>> NumPy array.
>> More than that, though. Every function and method that takes an axis
>> or reduces an axis will need to be rewritten. For that reason, I'm -1
>> on the proposal.
> Are you -1 on the array dictionary, or on using it to do axis mapping?
I'm -1 on rewriting every axis= argument to accept strings. I'm +1 on
a generic metadata dict that does not implicitly propagate.
> I would imagine that Gael would be happier even if he had to do
> axis = x.meta.axis['Lateral']
> some_func(x, axis)
That's fine with me.
>> I'm of the opinion that it should never guess. We have no idea what
>> semantics are being placed on the dict. Even in the case where all of
>> the inputs have the same dict, the operation may easily invalidate the
>> metadata. For example, a reduction on one of these axis-decorated
>> arrays would make the axis labels incorrect.
> That's a good point. So what would be a sane way of propagating
> meta-data? If we don't want to make any assumptions, it becomes the
> user's responsibility to do it manually.
I don't think there is *any* sane way of numpy propagating the user's
metadata. The user must be the one to do it.
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion