On Tue, Aug 24, 2010 at 9:01 PM, Anne Archibald
<aarch...@physics.mcgill.ca>wrote:

> On 24 August 2010 19:16, Erik Tollerud <erik.tolle...@gmail.com> wrote:
> > Whoops, yes, that should be True... Also realized a slight error in
> > the description of how the mimum is set - both of those are fixed in
> > the attached diff.
>
> Um, this is a kind of important point of style: it is much better to
> use "if foo:" than "if foo is True:" or even "if foo == True:".
> Long-standing python convention allows things like 1, 7.0, numpy
> booleans that are true, and nonempty lists to have a value of True.
> Using "if foo:", this works. Using "if foo is True:", this cannot
> possibly work; even though 1==True, it is not true that 1 is True.
> "is" has a very specific meaning that should be used only when
> appropriate (generally, for None or for mutable objects).
>
> Incidentally, the stairstep look of histograms is something I use a
> lot. But if we're looking for bells and whistles to add, I often need
> error bars on the histogram values (usually the error bar should be
> the square root of the value, though for really small values there's a
> correction based on Poisson statistics). Since I also often deal with
> background-subtracted histograms that often need to repeat the data, I
> expect to need to use errorbar() regardless, so I wouldn't worry too
> much about this.
>
> Anne
>
> > On Tue, Aug 24, 2010 at 1:53 PM, Eric Firing <efir...@hawaii.edu> wrote:
> >> On 08/24/2010 08:39 AM, Erik Tollerud wrote:
> >>> I just realized the patch I sent before includes some other changes...
> >>> the attached version should only be the fix for this particular bug.
> >>
> >> +            if log is true:
> >> +                minimum = 1.0
> >>
> >>
> >> Don't you mean True, not true?
> >>
> >> Eric
> >>
> >>
> ------------------------------------------------------------------------------
> >> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> >> Be part of this innovative community and reach millions of netbook users
> >> worldwide. Take advantage of special opportunities to increase revenue
> and
> >> speed time-to-market. Join now, and jumpstart your future.
> >> http://p.sf.net/sfu/intel-atom-d2d
> >> _______________________________________________
> >> Matplotlib-devel mailing list
> >> Matplotlib-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> >>
> >
> >
> >
> > --
> > Erik Tollerud
> >
> >
> ------------------------------------------------------------------------------
> > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> > Be part of this innovative community and reach millions of netbook users
> > worldwide. Take advantage of special opportunities to increase revenue
> and
> > speed time-to-market. Join now, and jumpstart your future.
> > http://p.sf.net/sfu/intel-atom-d2d
> > _______________________________________________
> > Matplotlib-devel mailing list
> > Matplotlib-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> >
> >
>
>
Anne,

While it probably could be better done, the logic of the entire if statement
is to first check to see if someone explicitly set a True value (default is
False), and that sets the minimum to 1.0.  Then, if it isn't explicitly
True, then it checks to see if it is a numerical value and uses that value
to indicate the minimum.  Only if it is None or False does it then go to the
last branch which would set minimum to zero.

Maybe it should use a cbook function that test for a numerical value
explicitly instead and do that first, then have a check for the Truthiness
of log?

Ben Root


P.S. -- I think firefox needs to update its spell-check dictionary, I
thought Steven Colbert got "truthiness" to be added to Webster's...
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to