boilerplate.py

Hello all,

In my continuing quest to get style cycles working, I wanted to get errorbar() to support it as well. Unfortunately, errorbar() has a default kwarg ‘fmt’ that takes a value of ‘-’, and None already has a special meaning in errorbar(). Therefore, I wanted to determine if the user wants to use the stylecycle by seeing if ‘fmt’ does not get specified in the call to errorbar(). This requires removing the ‘fmt’ kwarg from the call signature for errorbar() in axes.py.

Of course, changing the call signature for errorbar() in axes.py would require changing the call signature in pyplot.py. But this is supposed to be done by boilerplate.py. How/when during the build does this file get called? Also, pyplot.py is under revision control, so it seems to be a bit odd to have auto-generated files under revision control (or is it just me?).

Is boilerplate.py antiquated? Should we give it another look after the v1.1 release?

Cheers!
Ben Root

boilerplate is called manually when you want to add a new function to
pyplot, and you manually remove all the lines from pyplot.py from the
first instance of

  # This function was autogenerated by boilerplate.py. Do not edit as
  # changes will be lost

to the end, and replace it with the output of boilerplate.py. We
could automate this, or make it better, eg by having boilerplate.py
generate some module like _pyplot_boilerplate.py and having pyplot do
an import * from that, but for now you can just do it the manual way
if you prefer,

JDH

···

On Wed, Aug 31, 2011 at 7:34 PM, Benjamin Root <ben.root@...553...> wrote:

Hello all,

In my continuing quest to get style cycles working, I wanted to get
errorbar() to support it as well. Unfortunately, errorbar() has a default
kwarg 'fmt' that takes a value of '-', and *None* already has a special
meaning in errorbar(). Therefore, I wanted to determine if the user wants
to use the stylecycle by seeing if 'fmt' does not get specified in the call
to errorbar(). This requires removing the 'fmt' kwarg from the call
signature for errorbar() in axes.py.

Of course, changing the call signature for errorbar() in axes.py would
require changing the call signature in pyplot.py. But this is supposed to
be done by boilerplate.py. How/when during the build does this file get
called? Also, pyplot.py is under revision control, so it seems to be a bit
odd to have auto-generated files under revision control (or is it just me?).

Is boilerplate.py antiquated? Should we give it another look after the v1.1
release?