overridding builtin variables in pylab

I'm happy with Fernando's proposed names amin, amax, around,

    > etc. If everyone else is too, I propose Andrew implement
    > his patch, provide the compatibility names, and update the
    > relevant docs to advertise this prominently: API_CHANGES,
    > CHANGELOG, tutorial and users guide. Particularly in the
    > latter two, I think we should warn people about the
    > potential performance hit of using the builtin min, max and
    > friends on large arrays.

Hmm, another thought.

If we are going to make this change for the pylab namespace, then it
seems we might as well make the change in the numerix namespace as
well, since all the same arguments apply. I think doing different
things in numerix and pylab *is* a recipe for confusion. What do you
think Todd, does this seem sensible?

Basically, the theme would be we use the underlying names from
Numeric/numarray except when they clash with python builtins, in which
case we'd use something like the a* names Fernando proposed.

Of course, changing the numerix names would mean the matplotlib code
and examples will have to be updated as well. The former should be
relatively easy since I believe there are no uses of unqualified min
and max from numerix in the base code. Eg, we do in axes.py

from numerix import max as nxmax
from numerix import min as nxmin

and in mlab.py we do MLab.max. But we'll have to be careful to make
sure all the names Andrew identified are handled thoughout the coude
and examples...

JDH

I can't argue with that (though Todd may have some comments of his own). In fact it would seem silly if numerix wasn't consistent.

···

On Jan 10, 2005, at 6:23 AM, John Hunter wrote:

    > I'm happy with Fernando's proposed names amin, amax, around,
    > etc. If everyone else is too, I propose Andrew implement
    > his patch, provide the compatibility names, and update the
    > relevant docs to advertise this prominently: API_CHANGES,
    > CHANGELOG, tutorial and users guide. Particularly in the
    > latter two, I think we should warn people about the
    > potential performance hit of using the builtin min, max and
    > friends on large arrays.

Hmm, another thought.

If we are going to make this change for the pylab namespace, then it
seems we might as well make the change in the numerix namespace as
well, since all the same arguments apply. I think doing different
things in numerix and pylab *is* a recipe for confusion. What do you
think Todd, does this seem sensible?

This all sounds fine to me. My understanding is that anywhere we "get
this wrong" the impact will be degraded performance. As an aside, I
avoid "from *" like the plague myself but understand that it's important
to optimize interactive use.

Unleash Andrew and I'll try to propagate the changes forward to Scipy.

Todd

···

On Mon, 2005-01-10 at 06:23, John Hunter wrote:

    > I'm happy with Fernando's proposed names amin, amax, around,
    > etc. If everyone else is too, I propose Andrew implement
    > his patch, provide the compatibility names, and update the
    > relevant docs to advertise this prominently: API_CHANGES,
    > CHANGELOG, tutorial and users guide. Particularly in the
    > latter two, I think we should warn people about the
    > potential performance hit of using the builtin min, max and
    > friends on large arrays.

Hmm, another thought.

If we are going to make this change for the pylab namespace, then it
seems we might as well make the change in the numerix namespace as
well, since all the same arguments apply. I think doing different
things in numerix and pylab *is* a recipe for confusion. What do you
think Todd, does this seem sensible?

Basically, the theme would be we use the underlying names from
Numeric/numarray except when they clash with python builtins, in which
case we'd use something like the a* names Fernando proposed.

Of course, changing the numerix names would mean the matplotlib code
and examples will have to be updated as well. The former should be
relatively easy since I believe there are no uses of unqualified min
and max from numerix in the base code. Eg, we do in axes.py

from numerix import max as nxmax
from numerix import min as nxmin

and in mlab.py we do MLab.max. But we'll have to be careful to make
sure all the names Andrew identified are handled thoughout the coude
and examples...

JDH