From: Michael D. <md...@st...> - 2007-12-03 20:44:19
|
That's great! I just assumed I had trampled over all kinds of semi-public APIs... ;) Cheers, Mike Jeff Whitaker wrote: > Michael Droettboom wrote: >> Jeff Whitaker wrote: >>> John Hunter wrote: >>>> On Dec 3, 2007 2:08 PM, Jeff Whitaker <js...@fa...> wrote: >>>> >>>> >>>>> try: >>>>> l,b,w,h = ax.get_position() >>>>> except: >>>>> l,b,w,h = (ax.get_position()).bounds >>>>> >>>> >>>> In general, blanket excepts are bad practice because they can mask >>>> other bugs. You might catch the AttributeError, or do something like: >>>> >>>> pos = ax.get_position() >>>> l, b, w, h = getattr(pos, 'bounds', pos) >>>> >>>> or maybe a version or other check to see if you are on the branch >>>> >>>> JDH >>>> >>> John: You're right, I should do that. This is only in the examples, >>> not in the basemap code itself though. >> >> Just out of curiosity -- were there significant changes to the basemap >> code itself? > > No, none. I did uncover one bug though! > > -Jeff > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |