SF.net SVN: matplotlib: [4575] trunk/py4science/classes/0712_ncar_agenda. txt

2007-12-04 Thread jswhit
Revision: 4575
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4575&view=rev
Author:   jswhit
Date: 2007-12-04 05:12:09 -0800 (Tue, 04 Dec 2007)

Log Message:
---
opendap and pydap URLs were reversed

Modified Paths:
--
trunk/py4science/classes/0712_ncar_agenda.txt

Modified: trunk/py4science/classes/0712_ncar_agenda.txt
===
--- trunk/py4science/classes/0712_ncar_agenda.txt   2007-12-04 06:46:07 UTC 
(rev 4574)
+++ trunk/py4science/classes/0712_ncar_agenda.txt   2007-12-04 13:12:09 UTC 
(rev 4575)
@@ -79,8 +79,8 @@
   * (FP) - OpenDAP_ via the PyDAP_ implementation.
   * (JDH) - PyTables_: an HDF5 library.
 
-.. _OPenDAP:  http://pydap.org
-.. _PyDAP: http://opendap.org
+.. _OPenDAP:  http://opendap.org
+.. _PyDAP: http://pydap.org
 .. _PyTables: http://www.pytables.org
 
   
@@ -149,4 +149,4 @@
 1500-1515: Wrapup
   We'll have a bit of time for discussion, feedback and any questions that may
   have been left.
-  
\ No newline at end of file
+  


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4576] trunk/matplotlib

2007-12-04 Thread jdh2358
Revision: 4576
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4576&view=rev
Author:   jdh2358
Date: 2007-12-04 06:38:48 -0800 (Tue, 04 Dec 2007)

Log Message:
---
added additional lines to MANIFEST.in

Modified Paths:
--
trunk/matplotlib/CODING_GUIDE
trunk/matplotlib/MANIFEST.in
trunk/matplotlib/examples/poly_editor.py

Modified: trunk/matplotlib/CODING_GUIDE
===
--- trunk/matplotlib/CODING_GUIDE   2007-12-04 13:12:09 UTC (rev 4575)
+++ trunk/matplotlib/CODING_GUIDE   2007-12-04 14:38:48 UTC (rev 4576)
@@ -39,8 +39,11 @@
   * If you have altered extension code, do you pass
 unit/memleak_hawaii.py?
 
+  * if you have added new files or directories, or reorganized
+existing ones, are the new files included in the match patterns in
+MANIFEST.in.  This file determines what goes into the src
+distribution of the mpl build.
 
-
 == Importing and name spaces ==
 
 For numpy, use:

Modified: trunk/matplotlib/MANIFEST.in
===
--- trunk/matplotlib/MANIFEST.in2007-12-04 13:12:09 UTC (rev 4575)
+++ trunk/matplotlib/MANIFEST.in2007-12-04 14:38:48 UTC (rev 4576)
@@ -5,8 +5,13 @@
 include __init__.py setupext.py setup.py setupegg.py makeswig.py
 include examples/data/*
 include lib/matplotlib/toolkits
+include lib/matplotlib/mpl-data/matplotlib.conf
+include lib/matplotlib/mpl-data/matplotlib.conf.template
+include lib/matplotlib/mpl-data/lineprops.glade
+include lib/matplotlib/mpl-data/matplotlibrc
 include lib/matplotlib/mpl-data/images/*
 include lib/matplotlib/mpl-data/fonts/ttf/*
+include lib/matplotlib/mpl-data/fonts/pdfcorefonts/*
 include lib/matplotlib/mpl-data/fonts/afm/*
 recursive-include license LICENSE*
 recursive-include examples README *.py

Modified: trunk/matplotlib/examples/poly_editor.py
===
--- trunk/matplotlib/examples/poly_editor.py2007-12-04 13:12:09 UTC (rev 
4575)
+++ trunk/matplotlib/examples/poly_editor.py2007-12-04 14:38:48 UTC (rev 
4576)
@@ -9,8 +9,6 @@
 from matplotlib.mlab import dist_point_to_segment
 
 
-
-
 class PolygonInteractor:
 """
 An polygon editor.
@@ -73,7 +71,7 @@
 # display coords
 xt, yt = self.poly.get_transform().numerix_x_y(x, y)
 d = sqrt((xt-event.x)**2 + (yt-event.y)**2)
-indseq = nonzero(equal(d, amin(d)))
+indseq = nonzero(equal(d, amin(d)))[0]
 ind = indseq[0]
 
 if d[ind]>=self.epsilon:
@@ -128,6 +126,7 @@
 if event.inaxes is None: return
 if event.button != 1: return
 x,y = event.xdata, event.ydata
+
 self.poly.xy[self._ind] = x,y
 self.line.set_data(zip(*self.poly.xy))
 
@@ -160,7 +159,7 @@
 ax.add_patch(poly)
 p = PolygonInteractor( ax, poly)
 
-ax.add_line(p.line)
+#ax.add_line(p.line)
 ax.set_title('Click and drag a point to move it')
 ax.set_xlim((-2,2))
 ax.set_ylim((-2,2))


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4577] branches/transforms/lib/matplotlib/axes.py

2007-12-04 Thread mdboom
Revision: 4577
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4577&view=rev
Author:   mdboom
Date: 2007-12-04 08:01:06 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Fix bug when collection is empty.

Modified Paths:
--
branches/transforms/lib/matplotlib/axes.py

Modified: branches/transforms/lib/matplotlib/axes.py
===
--- branches/transforms/lib/matplotlib/axes.py  2007-12-04 14:38:48 UTC (rev 
4576)
+++ branches/transforms/lib/matplotlib/axes.py  2007-12-04 16:01:06 UTC (rev 
4577)
@@ -21,6 +21,7 @@
 from matplotlib import lines as mlines
 from matplotlib import mlab
 from matplotlib import patches as mpatches
+from matplotlib import path as mpath
 from matplotlib import quiver as mquiver
 from matplotlib import scale as mscale
 from matplotlib import table as mtable
@@ -770,13 +771,14 @@
 
 self.grid(self._gridOn)
 props = font_manager.FontProperties(size=rcParams['axes.titlesize'])
-self.title =  mtext.Text(
-x=0.5, y=1.02, text='',
+self.titleOffsetTrans = mtransforms.Affine2D()
+self.title = mtext.Text(
+x=0.5, y=1.00, text='',
 fontproperties=props,
 verticalalignment='bottom',
 horizontalalignment='center',
 )
-self.title.set_transform(self.transAxes)
+self.title.set_transform(self.transAxes + self.titleOffsetTrans)
 self.title.set_clip_box(None)
 
 self._set_artist_props(self.title)
@@ -800,6 +802,8 @@
 self.xaxis.set_clip_path(self.axesPatch)
 self.yaxis.set_clip_path(self.axesPatch)
 
+self.titleOffsetTrans.clear()
+
 def clear(self):
 'clear the axes'
 self.cla()
@@ -905,14 +909,14 @@
 ysize = max(math.fabs(ymax-ymin), 1e-30)
 return ysize/xsize
 
-def apply_aspect(self):
+def apply_aspect(self, currentPosition):
 '''
 Use self._aspect and self._adjustable to modify the
 axes box or the view limits.
 '''
 aspect = self.get_aspect()
 if aspect == 'auto':
-self.set_position( self._originalPosition , 'active')
+self.set_position(currentPosition, 'active')
 return
 
 if aspect == 'equal':
@@ -929,7 +933,7 @@
 fig_aspect = figH/figW
 if self._adjustable == 'box':
 box_aspect = A * self.get_data_ratio()
-pb = self._originalPosition.frozen()
+pb = currentPosition.frozen()
 pb1 = pb.shrunk_to_aspect(box_aspect, pb, fig_aspect)
 self.set_position(pb1.anchored(self.get_anchor(), pb), 'active')
 return
@@ -1289,25 +1293,48 @@
 YL = ylocator.autoscale()
 self.set_ybound(YL)
 
+def adjust_for_axis_text(self, renderer):
+pad_pixels = rcParams['xtick.major.pad'] * self.figure.dpi / 72.0
+inverse_transFigure = self.figure.transFigure.inverted()
+t_text, b_text = self.xaxis.get_text_heights(renderer)
+l_text, r_text = self.yaxis.get_text_widths(renderer)
+title_height = self.title.get_window_extent(renderer).height
+title_height += pad_pixels * 2.0
+original_t_text = t_text
+
+((l_text, t_text),
+ (r_text, b_text),
+ (dummy, title_height)) = inverse_transFigure.transform(
+((l_text, t_text),
+ (r_text, b_text),
+ (0.0, title_height)))
+x0, y0, x1, y1 = self.get_position(True).extents
+# Adjust the title
+self.titleOffsetTrans.clear().translate(
+0, original_t_text + pad_pixels * 2.0)
+return mtransforms.Bbox.from_extents(
+x0 + l_text, y0 + b_text, x1 - r_text,
+y1 - t_text - title_height)
+
  Drawing
 def draw(self, renderer=None, inframe=False):
 "Draw everything (plot lines, axes, labels)"
-   if renderer is None:
+if renderer is None:
 renderer = self._cachedRenderer
 
 if renderer is None:
 raise RuntimeError('No renderer defined')
 if not self.get_visible(): return
 renderer.open_group('axes')
-self.apply_aspect()
 
+currentPosition = self.adjust_for_axis_text(renderer)
+self.apply_aspect(currentPosition)
+
 if self.axison and self._frameon:
 self.axesPatch.draw(renderer)
 
 artists = []
 
-
-
 if len(self.images)<=1 or renderer.option_image_nocomposite():
 for im in self.images:
 im.draw(renderer)
@@ -1319,7 +1346,6 @@
 ims = [(im.make_image(mag),0,0)
for im in self.images if im.get_visible()]
 
-
 im = mimage.from_images(self.bbox.height*mag,
 self.bbox.width*mag,
 ims)
@@ -1360,6 +1386,14 @@
 a.draw(renderer)
 
 

SF.net SVN: matplotlib: [4578] branches/transforms/lib/matplotlib/axes.py

2007-12-04 Thread mdboom
Revision: 4578
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4578&view=rev
Author:   mdboom
Date: 2007-12-04 08:06:20 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Oops in last commit

Modified Paths:
--
branches/transforms/lib/matplotlib/axes.py

Modified: branches/transforms/lib/matplotlib/axes.py
===
--- branches/transforms/lib/matplotlib/axes.py  2007-12-04 16:01:06 UTC (rev 
4577)
+++ branches/transforms/lib/matplotlib/axes.py  2007-12-04 16:06:20 UTC (rev 
4578)
@@ -21,7 +21,6 @@
 from matplotlib import lines as mlines
 from matplotlib import mlab
 from matplotlib import patches as mpatches
-from matplotlib import path as mpath
 from matplotlib import quiver as mquiver
 from matplotlib import scale as mscale
 from matplotlib import table as mtable
@@ -771,14 +770,13 @@
 
 self.grid(self._gridOn)
 props = font_manager.FontProperties(size=rcParams['axes.titlesize'])
-self.titleOffsetTrans = mtransforms.Affine2D()
-self.title = mtext.Text(
-x=0.5, y=1.00, text='',
+self.title =  mtext.Text(
+x=0.5, y=1.02, text='',
 fontproperties=props,
 verticalalignment='bottom',
 horizontalalignment='center',
 )
-self.title.set_transform(self.transAxes + self.titleOffsetTrans)
+self.title.set_transform(self.transAxes)
 self.title.set_clip_box(None)
 
 self._set_artist_props(self.title)
@@ -802,8 +800,6 @@
 self.xaxis.set_clip_path(self.axesPatch)
 self.yaxis.set_clip_path(self.axesPatch)
 
-self.titleOffsetTrans.clear()
-
 def clear(self):
 'clear the axes'
 self.cla()
@@ -909,14 +905,14 @@
 ysize = max(math.fabs(ymax-ymin), 1e-30)
 return ysize/xsize
 
-def apply_aspect(self, currentPosition):
+def apply_aspect(self):
 '''
 Use self._aspect and self._adjustable to modify the
 axes box or the view limits.
 '''
 aspect = self.get_aspect()
 if aspect == 'auto':
-self.set_position(currentPosition, 'active')
+self.set_position( self._originalPosition , 'active')
 return
 
 if aspect == 'equal':
@@ -933,7 +929,7 @@
 fig_aspect = figH/figW
 if self._adjustable == 'box':
 box_aspect = A * self.get_data_ratio()
-pb = currentPosition.frozen()
+pb = self._originalPosition.frozen()
 pb1 = pb.shrunk_to_aspect(box_aspect, pb, fig_aspect)
 self.set_position(pb1.anchored(self.get_anchor(), pb), 'active')
 return
@@ -1141,7 +1137,7 @@
 self._set_artist_props(collection)
 collection.set_clip_path(self.axesPatch)
 if autolim:
-if len(collection._paths):
+if collection._paths and len(collection._paths):
 self.update_datalim(collection.get_datalim(self.transData))
 collection._remove_method = lambda h: self.collections.remove(h)
 
@@ -1293,48 +1289,25 @@
 YL = ylocator.autoscale()
 self.set_ybound(YL)
 
-def adjust_for_axis_text(self, renderer):
-pad_pixels = rcParams['xtick.major.pad'] * self.figure.dpi / 72.0
-inverse_transFigure = self.figure.transFigure.inverted()
-t_text, b_text = self.xaxis.get_text_heights(renderer)
-l_text, r_text = self.yaxis.get_text_widths(renderer)
-title_height = self.title.get_window_extent(renderer).height
-title_height += pad_pixels * 2.0
-original_t_text = t_text
-
-((l_text, t_text),
- (r_text, b_text),
- (dummy, title_height)) = inverse_transFigure.transform(
-((l_text, t_text),
- (r_text, b_text),
- (0.0, title_height)))
-x0, y0, x1, y1 = self.get_position(True).extents
-# Adjust the title
-self.titleOffsetTrans.clear().translate(
-0, original_t_text + pad_pixels * 2.0)
-return mtransforms.Bbox.from_extents(
-x0 + l_text, y0 + b_text, x1 - r_text,
-y1 - t_text - title_height)
-
  Drawing
 def draw(self, renderer=None, inframe=False):
 "Draw everything (plot lines, axes, labels)"
-if renderer is None:
+   if renderer is None:
 renderer = self._cachedRenderer
 
 if renderer is None:
 raise RuntimeError('No renderer defined')
 if not self.get_visible(): return
 renderer.open_group('axes')
+self.apply_aspect()
 
-currentPosition = self.adjust_for_axis_text(renderer)
-self.apply_aspect(currentPosition)
-
 if self.axison and self._frameon:
 self.axesPatch.draw(renderer)
 
 artists = []
 
+
+
 if len(self.images)<=1 or renderer.option_image_nocomposite():
 for im in self.images:
  

SF.net SVN: matplotlib: [4579] trunk/toolkits/basemap

2007-12-04 Thread jswhit
Revision: 4579
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4579&view=rev
Author:   jswhit
Date: 2007-12-04 09:36:55 -0800 (Tue, 04 Dec 2007)

Log Message:
---
add date2num and num2date functions to basemap namespace.

Modified Paths:
--
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/MANIFEST.in
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
trunk/toolkits/basemap/setup.py

Modified: trunk/toolkits/basemap/Changelog
===
--- trunk/toolkits/basemap/Changelog2007-12-04 16:06:20 UTC (rev 4578)
+++ trunk/toolkits/basemap/Changelog2007-12-04 17:36:55 UTC (rev 4579)
@@ -1,3 +1,5 @@
+   * added num2date and date2num functions, which use 
+included netcdftime module.
 version 0.9.8 (svn revision 4526)
* fixes for filling continents in orthographic projection.
* added 'maskandscale' kwarg to NetCDFFile to

Modified: trunk/toolkits/basemap/MANIFEST.in
===
--- trunk/toolkits/basemap/MANIFEST.in  2007-12-04 16:06:20 UTC (rev 4578)
+++ trunk/toolkits/basemap/MANIFEST.in  2007-12-04 17:36:55 UTC (rev 4579)
@@ -78,6 +78,7 @@
 recursive-include lib/httplib2 *
 recursive-include lib/dbflib *
 recursive-include lib/shapelib *
+recursive-include lib/netcdftime *
 include lib/matplotlib/toolkits/basemap/data/5minmask.bin
 include lib/matplotlib/toolkits/basemap/data/GL27
 include lib/matplotlib/toolkits/basemap/data/countries_c.dat

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 16:06:20 UTC (rev 4578)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 17:36:55 UTC (rev 4579)
@@ -28,7 +28,7 @@
 from numpy import linspace, squeeze, ma
 from matplotlib.cbook import is_scalar, dedent
 from shapelib import ShapeFile
-import _geos, pupynere
+import _geos, pupynere, netcdftime
 
 # basemap data files now installed in lib/matplotlib/toolkits/basemap/data
 basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
@@ -2857,3 +2857,80 @@
 else:
 f = pupynere._LocalFile(file,maskandscale)
 return f
+
+def num2date(times,units,unit_format='%Y-%m-%d %H:%M:%S',calendar='standard'):
+"""
+Return datetime objects given numeric time values. The units
+of the numeric time values are described by the units argument
+and the unit_format and calendar keywords.
+
+Arguments:
+
+times - numeric time values. Maximum resolution is 1 second.
+units - a string of the form ' since '
+ describing the time units.  can be days, hours, minutes
+ or seconds.   is the time origin, defined by the format
+ keyword (see below). For example, a valid choice would be
+ units='hours since 0001-01-01 00:00:00'.
+
+Keyword Arguments:
+
+format - a string describing a reference time. This string is converted 
+ to a year,month,day,hour,minute,second tuple by strptime. The default 
+ format is '%Y-%m-%d %H:%M:%S'. See the time.strptime docstring for other 
+ valid formats.
+
+calendar - describes the calendar used in the time calculations. 
+ All the values currently defined in the CF metadata convention 
+ (http://cf-pcmdi.llnl.gov/documents/cf-conventions/) are supported.
+ Valid calendars 'standard', 'gregorian', 'proleptic_gregorian'
+ 'noleap', '365_day', '360_day', 'julian'.  Default is 'standard'.
+
+Returns a datetime instance, or an array of datetime instances.
+
+The datetime instances returned are 'real' python datetime 
+objects if the date falls in the Gregorian calendar (i.e. 
+calendar='proleptic_gregorian', or calendar = 'standard' or 'gregorian'
+and the date is after 1582-10-15). Otherwise, they are 'phony' datetime 
+objects which support some but not all the methods of 'real' python
+datetime objects.  This is because the python datetime module cannot
+the weird dates in some calendars (such as '360_day' and 'all_leap'
+which don't exist in any real world calendar.
+"""
+cdftime = netcdftime.utime(units,calendar=calendar,format=unit_format)
+return cdftime.num2date(times)
+
+def date2num(dates,units,unit_format='%Y-%m-%d %H:%M:%S',calendar='standard'):
+"""
+Return numeric time values given datetime objects. The units
+of the numeric time values are described by the units argument
+and the unit_format and calendar keywords.
+
+Arguments:
+
+dates - A datetime object or a sequence of datetime objects.
+units - a string of the form ' since '
+ describing the time units.  can be days, hours, minutes
+ or seconds.   is the time origin, defined by the format
+ keyword (se

SF.net SVN: matplotlib: [4580] trunk/toolkits/basemap/lib

2007-12-04 Thread jswhit
Revision: 4580
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4580&view=rev
Author:   jswhit
Date: 2007-12-04 09:39:31 -0800 (Tue, 04 Dec 2007)

Log Message:
---
add netcdftime module

Added Paths:
---
trunk/toolkits/basemap/lib/netcdftime/
trunk/toolkits/basemap/lib/netcdftime/__init__.py
trunk/toolkits/basemap/lib/netcdftime/netcdftime.py
trunk/toolkits/basemap/lib/netcdftime/strftime.py
trunk/toolkits/basemap/lib/netcdftime/strptime.py

Added: trunk/toolkits/basemap/lib/netcdftime/__init__.py
===
--- trunk/toolkits/basemap/lib/netcdftime/__init__.py   
(rev 0)
+++ trunk/toolkits/basemap/lib/netcdftime/__init__.py   2007-12-04 17:39:31 UTC 
(rev 4580)
@@ -0,0 +1,2 @@
+from netcdftime import __doc__, __version__
+from netcdftime import *

Added: trunk/toolkits/basemap/lib/netcdftime/netcdftime.py
===
--- trunk/toolkits/basemap/lib/netcdftime/netcdftime.py 
(rev 0)
+++ trunk/toolkits/basemap/lib/netcdftime/netcdftime.py 2007-12-04 17:39:31 UTC 
(rev 4580)
@@ -0,0 +1,737 @@
+"""
+Performs conversions of netCDF time coordinate data to/from datetime objects.
+"""
+import math
+import numpy
+from datetime import datetime as real_datetime
+from strptime import strptime
+from strftime import strftime
+
+_units = ['days','hours','minutes','seconds','day','hour','minute','second']
+_calendars = 
['standard','gregorian','proleptic_gregorian','noleap','julian','all_leap','365_day','366_day','360_day']
+
+__version__ = '0.5.1'
+
+class datetime:
+"""
+Phony datetime object which mimics the python datetime object,
+but allows for dates that don't exist in the proleptic gregorian calendar.
+Doesn't do timedelta operations, doesn't overload + and -.
+
+Has strftime, timetuple and __repr__ methods.  The format
+of the string produced by __repr__ is controlled by self.format
+(default %Y-%m-%d %H:%M:%S).
+
+Instance variables are year,month,day,hour,minute,second,dayofwk,dayofyr
+and format.
+"""
+def 
__init__(self,year,month,day,hour=0,minute=0,second=0,dayofwk=-1,dayofyr=1):
+"""dayofyr set to 1 by default - otherwise time.strftime will 
complain"""
+self.year=year
+self.month=month
+self.day=day
+self.hour=hour
+self.minute=minute
+self.dayofwk=dayofwk
+self.dayofyr=dayofyr
+self.second=second
+self.format='%Y-%m-%d %H:%M:%S'
+def strftime(self,format=None):
+if format is None:
+format = self.format
+return strftime(self,format)
+def timetuple(self):
+return 
(self.year,self.month,self.day,self.hour,self.minute,self.second,self.dayofwk,self.dayofyr,-1)
+def __repr__(self):
+return self.strftime(self.format)
+
+def JulianDayFromDate(date,calendar='standard'):
+
+"""
+
+creates a Julian Day from a 'datetime-like' object.  Returns the fractional
+Julian Day (resolution 1 second).
+
+if calendar='standard' or 'gregorian' (default), Julian day follows Julian 
+Calendar on and before 1582-10-5, Gregorian calendar after 1582-10-15.
+
+if calendar='proleptic_gregorian', Julian Day follows gregorian calendar.
+
+if calendar='julian', Julian Day follows julian calendar.
+
+Algorithm:
+
+Meeus, Jean (1998) Astronomical Algorithms (2nd Edition). Willmann-Bell,
+Virginia. p. 63
+
+"""
+
+# based on redate.py by David Finlayson.
+
+year=date.year; month=date.month; day=date.day
+hour=date.hour; minute=date.minute; second=date.second
+# Convert time to fractions of a day
+day = day + hour/24.0 + minute/1440.0 + second/86400.0
+
+# Start Meeus algorithm (variables are in his notation)
+if (month < 3):
+month = month + 12
+year = year - 1
+
+A = int(year/100)
+
+jd = int(365.25 * (year + 4716)) + int(30.6001 * (month + 1)) + \
+ day - 1524.5
+
+# optionally adjust the jd for the switch from 
+# the Julian to Gregorian Calendar
+# here assumed to have occurred the day after 1582 October 4
+if calendar in ['standard','gregorian']:
+if jd >= 2299170.5:
+# 1582 October 15 (Gregorian Calendar)
+B = 2 - A + int(A/4)
+elif jd < 2299160.5:
+# 1582 October 5 (Julian Calendar)
+B = 0
+else:
+raise ValueError, 'impossible date (falls in gap between end of 
Julian calendar and beginning of Gregorian calendar'
+elif calendar == 'proleptic_gregorian':
+B = 2 - A + int(A/4)
+elif calendar == 'julian':
+B = 0
+else:
+raise ValueError, 'unknown calendar, must be one of 
julian,standard,gregorian,proleptic_gregorian, got %s' % calendar
+
+# adjust for Julian calendar if necessary
+jd = jd + B
+
+return jd 
+
+def _NoLeapDayFromDate(date):
+
+"

SF.net SVN: matplotlib: [4581] trunk/py4science

2007-12-04 Thread fer_perez
Revision: 4581
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4581&view=rev
Author:   fer_perez
Date: 2007-12-04 10:37:40 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Updates I forgot to commit yesterday...

Modified Paths:
--
trunk/py4science/workbook/fft_imdenoise.tex
trunk/py4science/workbook/quad_newton.tex

Added Paths:
---
trunk/py4science/examples/stock_demo.py

Added: trunk/py4science/examples/stock_demo.py
===
--- trunk/py4science/examples/stock_demo.py (rev 0)
+++ trunk/py4science/examples/stock_demo.py 2007-12-04 18:37:40 UTC (rev 
4581)
@@ -0,0 +1,42 @@
+"""Simple data access and manipulation demo, using Yahoo Finance data."""
+
+#  stop
+
+# Needed libraries
+import urllib
+import matplotlib.mlab as mlab  # contains csv2rec
+import pylab as p
+
+#  stop
+
+# Choose a stock, make the URL for it and download it to a local file
+ticker = 'CROX'  # Boulder-based company Crocs
+
+url = 'http://ichart.finance.yahoo.com/table.csv?' +\
+  's=%s&d=9&e=20&f=2007&g=d&a=0&b=29&c=1993&ignore=.csv'%ticker
+
+fname = '%s.csv'% ticker
+urllib.urlretrieve(url, fname)
+
+#  stop
+
+# Now, make a Record Array out of this dataset:
+r = mlab.csv2rec(fname)
+
+# note that the CSV file is sorted most recent date first, so you will probably
+# want to sort the record array so most recent date is last
+r.sort()
+# A quick look at the data structure:
+print 'dtype:',r.dtype
+print 'shape:',r.shape
+
+#  stop
+
+p.plot(r.date,r.adj_close)
+p.show()
+
+#  stop
+# Now, make a slightly modified version of the file with cleaner formatting.
+# We'll use this later...
+mlab.rec2csv(r,'dap/myserver/data/sample.csv',
+ formatd={'date':mlab.FormatString()})

Modified: trunk/py4science/workbook/fft_imdenoise.tex
===
--- trunk/py4science/workbook/fft_imdenoise.tex 2007-12-04 17:39:31 UTC (rev 
4580)
+++ trunk/py4science/workbook/fft_imdenoise.tex 2007-12-04 18:37:40 UTC (rev 
4581)
@@ -1,50 +1,52 @@
 \section{FFT Image Denoising}
 \label{sec:fft_imdenoise}
 
-Convolution of an input with with a linear filter in the termporal or
-spatial domain is equivalent to multiplication by the fourier
-transforms of the input and the filter in the spectral domain.  This
-provides a conceptually simple way to think about filtering: transform
-your signal into the frequency domain, dampen the frequencies you are
-not interested in by multiplying the frequency spectrum by the desired
-weights, and then inverse transform the multiplies spectrum back into
-the original domain.  In the example below, we will simply set the
-weights of the frequencies we are uninterested in (the high frequency
-noise) to zero rather than dampening them with a smoothly varying
-function.  Although this is not usually the best thing to do, since
-sharp edges in one domain usually introduce artifacts in another (eg
-high frequency ``ringing''), it is easy to do and sometimes provides
-satisfactory results.
+Convolution of an input with with a linear filter in the termporal or spatial
+domain is equivalent to multiplication by the fourier transforms of the input
+and the filter in the spectral domain.  This provides a conceptually simple way
+to think about filtering: transform your signal into the frequency domain,
+dampen the frequencies you are not interested in by multiplying the frequency
+spectrum by the desired weights, and then apply the inverse transform to the
+modified spectrum, back into the original domain.  In the example below, we
+will simply set the weights of the frequencies we are uninterested in (the high
+frequency noise) to zero rather than dampening them with a smoothly varying
+function.  Although this is not usually the best thing to do, since sharp edges
+in one domain usually introduce artifacts in another (eg high frequency
+``ringing''), it is easy to do and sometimes provides satisfactory results.
 
-The image in the upper left panel of Figure~\ref{fig:fft_imdenoise} is
-a grayscale photo of the moon landing.  There is a banded pattern of
-high frequency noise polluting the image.  In the upper right panel we
-see the 2D spatial frequency spectrum.  The FFT output in
-\texttt{scipy} is packed with the lower freqeuencies starting in the
-upper left, and proceeding to higher frequencies as one moves to the
-center of the spectrum (this is the most efficient way numerically to
-fill the output of the FFT algorithm).  Because the input signal is
-real, the output spectrum is complex and symmetrical: the
-transformation values beyond the midpoint of the frequency spectrum
-(the Nyquist frequency) correspond to the values for negative
-frequencies and are simply the mirror image of the positive
-frequencies below the Nyquist (this is true for the 1D, 2D and ND FFTs
-in \texttt{numpy}).
+The image in the upper left p

SF.net SVN: matplotlib: [4582] trunk/toolkits/basemap/examples/fcstmaps.py

2007-12-04 Thread jswhit
Revision: 4582
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4582&view=rev
Author:   jswhit
Date: 2007-12-04 10:48:02 -0800 (Tue, 04 Dec 2007)

Log Message:
---
use num2date

Modified Paths:
--
trunk/toolkits/basemap/examples/fcstmaps.py

Modified: trunk/toolkits/basemap/examples/fcstmaps.py
===
--- trunk/toolkits/basemap/examples/fcstmaps.py 2007-12-04 18:37:40 UTC (rev 
4581)
+++ trunk/toolkits/basemap/examples/fcstmaps.py 2007-12-04 18:48:02 UTC (rev 
4582)
@@ -6,35 +6,9 @@
 import sys
 from numpy import ma
 import datetime
-from matplotlib.toolkits.basemap import Basemap, NetCDFFile, addcyclic
+from matplotlib.toolkits.basemap import Basemap, NetCDFFile, addcyclic, 
num2date
 
 
-hrsgregstart = 13865688 # hrs from 00010101 to 15821015 in Julian calendar.
-# times in many datasets use mixed Gregorian/Julian calendar, datetime 
-# module uses a proleptic Gregorian calendar. So, I use datetime to compute
-# hours since start of Greg. calendar (15821015) and add this constant to
-# get hours since 1-Jan-0001 in the mixed Gregorian/Julian calendar.
-gregstart = datetime.datetime(1582,10,15) # datetime.datetime instance
-
-def dateto_hrs_since_day1CE(curdate):
-"""given datetime.datetime instance, compute hours since 1-Jan-0001"""
-if curdate < gregstart:
-msg = 'date must be after start of gregorian calendar (15821015)!'
-raise ValueError, msg
-difftime = curdate-gregstart
-hrsdiff = 24*difftime.days + difftime.seconds/3600
-return hrsdiff+hrsgregstart
-
-def hrs_since_day1CE_todate(hrs):
-"""return datetime.datetime instance given hours since 1-Jan-0001"""
-if hrs < 0.0:
-msg = "hrs must be positive!"
-raise ValueError, msg
-delta = datetime.timedelta(hours=1)
-hrs_sincegreg = hrs - hrsgregstart
-curdate = gregstart + hrs_sincegreg*delta
-return curdate
-
 # today's date is default.
 if len(sys.argv) > 1:
 MMDD = sys.argv[1]
@@ -62,14 +36,17 @@
 longitudes = data.variables['lon']
 fcsttimes = data.variables['time']
 times = fcsttimes[0:6] # first 6 forecast times.
+# change 0.0 to 00 at end of time units string
+# (so strptime will understand it).
+timeunits = fcsttimes.units[:-2]+'0'
 ntimes = len(times)
 # put forecast times in MMDDHH format.
 verifdates = []
 fcsthrs=[]
-print times
 for time in times:
+print time, times[0]
 fcsthrs.append(int((time-times[0])*24))
-fdate = hrs_since_day1CE_todate(int(time*24.0)) 
+fdate = num2date(time,'days since 0001-01-01 00:00:00')
 verifdates.append(fdate.strftime('%Y%m%d%H'))
 print fcsthrs
 print verifdates


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4583] trunk/toolkits/basemap/lib/netcdftime/

2007-12-04 Thread jswhit
Revision: 4583
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4583&view=rev
Author:   jswhit
Date: 2007-12-04 11:16:57 -0800 (Tue, 04 Dec 2007)

Log Message:
---
move 

Removed Paths:
-
trunk/toolkits/basemap/lib/netcdftime/


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4584] trunk/toolkits/basemap

2007-12-04 Thread jswhit
Revision: 4584
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4584&view=rev
Author:   jswhit
Date: 2007-12-04 11:18:03 -0800 (Tue, 04 Dec 2007)

Log Message:
---
move netcdftime.py

Modified Paths:
--
trunk/toolkits/basemap/MANIFEST.in
trunk/toolkits/basemap/examples/fcstmaps.py
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
trunk/toolkits/basemap/setup.py

Added Paths:
---
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py

Modified: trunk/toolkits/basemap/MANIFEST.in
===
--- trunk/toolkits/basemap/MANIFEST.in  2007-12-04 19:16:57 UTC (rev 4583)
+++ trunk/toolkits/basemap/MANIFEST.in  2007-12-04 19:18:03 UTC (rev 4584)
@@ -68,6 +68,7 @@
 include lib/matplotlib/toolkits/basemap/pyproj.py
 include lib/matplotlib/toolkits/basemap/cm.py
 include lib/matplotlib/toolkits/basemap/pupynere.py
+include lib/matplotlib/toolkits/basemap/netcdftime.py
 include pyshapelib/README pyshapelib/COPYING pyshapelib/ChangeLog 
pyshapelib/NEWS
 include pyshapelib/*.i pyshapelib/*.c pyshapelib/*.py pyshapelib/*.h
 include pyshapelib/*.shp pyshapelib/*.shx pyshapelib/*.dbf
@@ -78,7 +79,6 @@
 recursive-include lib/httplib2 *
 recursive-include lib/dbflib *
 recursive-include lib/shapelib *
-recursive-include lib/netcdftime *
 include lib/matplotlib/toolkits/basemap/data/5minmask.bin
 include lib/matplotlib/toolkits/basemap/data/GL27
 include lib/matplotlib/toolkits/basemap/data/countries_c.dat

Modified: trunk/toolkits/basemap/examples/fcstmaps.py
===
--- trunk/toolkits/basemap/examples/fcstmaps.py 2007-12-04 19:16:57 UTC (rev 
4583)
+++ trunk/toolkits/basemap/examples/fcstmaps.py 2007-12-04 19:18:03 UTC (rev 
4584)
@@ -36,9 +36,6 @@
 longitudes = data.variables['lon']
 fcsttimes = data.variables['time']
 times = fcsttimes[0:6] # first 6 forecast times.
-# change 0.0 to 00 at end of time units string
-# (so strptime will understand it).
-timeunits = fcsttimes.units[:-2]+'0'
 ntimes = len(times)
 # put forecast times in MMDDHH format.
 verifdates = []
@@ -46,7 +43,7 @@
 for time in times:
 print time, times[0]
 fcsthrs.append(int((time-times[0])*24))
-fdate = num2date(time,'days since 0001-01-01 00:00:00')
+fdate = num2date(time,fcsttimes.units)
 verifdates.append(fdate.strftime('%Y%m%d%H'))
 print fcsthrs
 print verifdates

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 19:16:57 UTC (rev 4583)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 19:18:03 UTC (rev 4584)
@@ -2858,28 +2858,21 @@
 f = pupynere._LocalFile(file,maskandscale)
 return f
 
-def num2date(times,units,unit_format='%Y-%m-%d %H:%M:%S',calendar='standard'):
+def num2date(times,units,calendar='standard'):
 """
 Return datetime objects given numeric time values. The units
 of the numeric time values are described by the units argument
-and the unit_format and calendar keywords.
+and the calendar keyword.
 
 Arguments:
 
 times - numeric time values. Maximum resolution is 1 second.
+
 units - a string of the form ' since '
  describing the time units.  can be days, hours, minutes
- or seconds.   is the time origin, defined by the format
- keyword (see below). For example, a valid choice would be
- units='hours since 0001-01-01 00:00:00'.
+ or seconds.   is the time origin. A valid choice
+ would be units='hours since 0001-01-01 00:00:00'.
 
-Keyword Arguments:
-
-format - a string describing a reference time. This string is converted 
- to a year,month,day,hour,minute,second tuple by strptime. The default 
- format is '%Y-%m-%d %H:%M:%S'. See the time.strptime docstring for other 
- valid formats.
-
 calendar - describes the calendar used in the time calculations. 
  All the values currently defined in the CF metadata convention 
  (http://cf-pcmdi.llnl.gov/documents/cf-conventions/) are supported.
@@ -2897,31 +2890,24 @@
 the weird dates in some calendars (such as '360_day' and 'all_leap'
 which don't exist in any real world calendar.
 """
-cdftime = netcdftime.utime(units,calendar=calendar,format=unit_format)
+cdftime = netcdftime.utime(units,calendar=calendar)
 return cdftime.num2date(times)
 
-def date2num(dates,units,unit_format='%Y-%m-%d %H:%M:%S',calendar='standard'):
+def date2num(dates,units,calendar='standard'):
 """
 Return numeric time values given datetime objects. The units
 of the numeric time values are described by the units argument
-and the unit_format and calendar keywords.
+and the calendar keyword.
 
 Arguments:
 
 dates - A 

SF.net SVN: matplotlib: [4585] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/basemap.py

2007-12-04 Thread jswhit
Revision: 4585
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4585&view=rev
Author:   jswhit
Date: 2007-12-04 11:29:49 -0800 (Tue, 04 Dec 2007)

Log Message:
---
docstring additions

Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 19:18:03 UTC (rev 4584)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 19:29:49 UTC (rev 4585)
@@ -2862,8 +2862,13 @@
 """
 Return datetime objects given numeric time values. The units
 of the numeric time values are described by the units argument
-and the calendar keyword.
+and the calendar keyword. The time zone is assumed to be UTC.
 
+Like the matplotlib num2date function, except that it allows
+for different units and calendars.  Behaves the same if
+units = 'days since 0001-01-01 00:00:00' and 
+calendar = 'proleptic_gregorian'.
+
 Arguments:
 
 times - numeric time values. Maximum resolution is 1 second.
@@ -2897,8 +2902,13 @@
 """
 Return numeric time values given datetime objects. The units
 of the numeric time values are described by the units argument
-and the calendar keyword.
+and the calendar keyword. The time zone is assumed to UTC.
 
+Like the matplotlib date2num function, except that it allows
+for different units and calendars.  Behaves the same if
+units = 'days since 0001-01-01 00:00:00' and 
+calendar = 'proleptic_gregorian'.
+
 Arguments:
 
 dates - A datetime object or a sequence of datetime objects.


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4586] trunk/matplotlib/lib/matplotlib

2007-12-04 Thread mdboom
Revision: 4586
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4586&view=rev
Author:   mdboom
Date: 2007-12-04 11:34:11 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Support '|' as a symbol in mathtext.

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/_mathtext_data.py
trunk/matplotlib/lib/matplotlib/mathtext.py

Modified: trunk/matplotlib/lib/matplotlib/_mathtext_data.py
===
--- trunk/matplotlib/lib/matplotlib/_mathtext_data.py   2007-12-04 19:29:49 UTC 
(rev 4585)
+++ trunk/matplotlib/lib/matplotlib/_mathtext_data.py   2007-12-04 19:34:11 UTC 
(rev 4586)
@@ -90,7 +90,9 @@
 r'\phi' : ('cmmi10',  42),
 r'\chi' : ('cmmi10',  17),
 r'\psi' : ('cmmi10',  31),
-
+
+r'|': ('cmsy10',  47),
+r'\|'   : ('cmsy10',  47),
 r'(': ('cmr10',  119),
 r'\leftparen'   : ('cmr10',  119),
 r'\rightparen'  : ('cmr10',   68),
@@ -129,7 +131,7 @@
 r'\Phi' : ('cmr10',   9),
 r'\Psi' : ('cmr10',  15),
 r'\Omega'   : ('cmr10',  12),
-
+
 # these are mathml names, I think.  I'm just using them for the
 # tex methods noted
 r'\circumflexaccent' : ('cmr10',   124), # for \hat
@@ -400,7 +402,7 @@
 r'\}'   : ('pncr8a', 125),
 r'\backslash'   : ('pncr8a',  92),
 r'\ast' : ('pncr8a',  42),
-
+
 r'\circumflexaccent' : ('pncri8a',   124), # for \hat
 r'\combiningbreve'   : ('pncri8a',   81),  # for \breve
 r'\combininggraveaccent' : ('pncri8a', 114), # for \grave
@@ -1773,6 +1775,7 @@
 'succnsim': 8937,
 'gimel': 8503,
 'vert': 124,
+'|': 124,
 'varrho': 1009,
 'P': 182,
 'approxident': 8779,
@@ -2073,7 +2076,7 @@
 'rightzigzagarrow': 8669,
 'rightarrow': 8594,
 'leftarrow': 8592,
-'__sqrt__': 8730,   
+'__sqrt__': 8730,
 'twoheaddownarrow': 8609,
 'oint': 8750,
 'bigvee': 8897,
@@ -2238,7 +2241,7 @@
 '{': 123,
 '}': 125,
 '_': 95,
-'imath': 0x131,  
+'imath': 0x131,
 'circumflexaccent' : 770,
 'combiningbreve'   : 774,
 'combiningoverline': 772,
@@ -2471,5 +2474,5 @@
 (0x0061, 0x007a, 'rm', 0x1d68a)  # a-z
 ],
 }
-
-
+
+

Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-12-04 19:29:49 UTC (rev 
4585)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-12-04 19:34:11 UTC (rev 
4586)
@@ -2021,7 +2021,7 @@
  ).setParseAction(self.customspace).setName('customspace')
 
 unicode_range = u"\U0080-\U0001"
-symbol   =(Regex(UR"([a-zA-Z0-9 
+\-*/<>=:,.;!'@()%s])|(\\[%%${}\[\]_])" % unicode_range)
+symbol   =(Regex(UR"([a-zA-Z0-9 
+\-*/<>=:,.;!'@()|%s])|(\\[%%${}\[\]_|])" % unicode_range)
  | Combine(
  bslash
+ oneOf(tex2uni.keys())


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4587] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/netcdftime.py

2007-12-04 Thread jswhit
Revision: 4587
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4587&view=rev
Author:   jswhit
Date: 2007-12-04 11:49:01 -0800 (Tue, 04 Dec 2007)

Log Message:
---
format string no longer needed

Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
2007-12-04 19:34:11 UTC (rev 4586)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
2007-12-04 19:49:01 UTC (rev 4587)
@@ -434,7 +434,7 @@
 
 return 
datetime(year,month,int(days),int(hours),int(minutes),int(seconds),-1, 
int(dayofyr))
 
-def _dateparse(timestr,format='%Y-%m-%d %H:%M:%S'):
+def _dateparse(timestr):
 """parse a string of the form time-units since -mm-dd hh:mm:ss
 return a tuple (units, datetimeinstance)"""
 timestr_split = timestr.split()
@@ -443,12 +443,10 @@
 raise ValueError,"units must be one of 'seconds', 'minutes', 'hours' 
or 'days' (or singular version of these), got '%s'" % units
 if timestr_split[1].lower() != 'since':
 raise ValueError,"no 'since' in unit_string"
-# use strptime to parse the date string.
+# parse the date string.
 n = timestr.find('since')+6
-#year,month,day,hour,minute,second,daywk,dayyr,tz = 
strptime(timestr[n:],format)
-year,month,day,hour,minute,second = _parse_date(timestr[n:])
-#if dayyr == -1: dayyr=1 # must have valid day of year for strftime to work
-#return units, datetime(year, month, day, hour, minute, second, daywk, 
dayyr)
+year,month,day,hour,minute,second,utc_offset = _parse_date(timestr[n:])
+
 return units, datetime(year, month, day, hour, minute, second)
 
 class utime:
@@ -456,18 +454,13 @@
 Performs conversions of netCDF time coordinate
 data to/from datetime objects.
 
-To initialize: C{t = utime(unit_string,format='%Y-%m-%d 
%H:%M:%S',calendar='standard')}
+To initialize: C{t = utime(unit_string,calendar='standard')}
 
 where 
 
 B{C{unit_string}} is a string of the form
-C{'time-units since '} defining the time units.
+C{'time-units since '} defining the time units.
 
-B{C{format}} is a string describing a reference time. This string is converted 
-to a year,month,day,hour,minute,second tuple by strptime. The default 
-format is C{'%Y-%m-%d %H:%M:%S'}. See the C{time.strptime} docstring for other 
-valid formats.
-
 Valid time-units are days, hours, minutes and seconds (the singular forms 
 are also accepted). An example unit_string would be C{'hours 
 since 0001-01-01 00:00:00'}.
@@ -556,15 +549,11 @@
 @ivar unit_string:  a string defining the the netCDF time variable.
 @ivar units:  the units part of C{unit_string} (i.e. 'days', 'hours', 
'seconds').
 """
-def __init__(self,unit_string,format='%Y-%m-%d 
%H:%M:%S',calendar='standard'):
+def __init__(self,unit_string,calendar='standard'):
 """
 @param unit_string: a string of the form
-C{'time-units since '} defining the time units.
+C{'time-units since '} defining the time units.
 
[EMAIL PROTECTED] format: a string describing a reference time. This string is 
converted 
-to a year,month,day,hour,minute,second tuple by strptime. The default 
-format is C{'%Y-%m-%d %H:%M:%S'}. See the C{time.strptime} docstring for other 
-valid formats.
 Valid time-units are days, hours, minutes and seconds (the singular forms 
 are also accepted). An example unit_string would be C{'hours 
 since 0001-01-01 00:00:00'}.
@@ -598,7 +587,7 @@
 self.calendar = calendar
 else:
 raise ValueError, "calendar must be one of %s, got '%s'" % 
(str(_calendars),calendar)
-units, self.origin = _dateparse(unit_string,format=format)
+units, self.origin = _dateparse(unit_string)
 self.units = units
 self.unit_string = unit_string
 if self.calendar in ['noleap','365_day'] and self.origin.month == 2 
and self.origin.day == 29:
@@ -736,7 +725,9 @@
 return numpy.reshape(numpy.array(date),shape)
 
 def _parse_date(origin):
-"""Parses a date string and returns a datetime object.
+"""Parses a date string and returns a tuple
+(year,month,day,hour,minute,second,utc_offset).
+utc_offset is in minutes.
 
 This function parses the 'origin' part of the time unit. It should be
 something like::
@@ -784,7 +775,7 @@
 c = m.groupdict(0)
 
 # Instantiate timezone object.
-#offset = int(c['ho'])*60 + int(c['mo'])
+offset = int(c['ho'])*60 + int(c['mo'])
 #tz = FixedOffset(offset, 'Unknown')
 
 #return datetime(int(c['year']),
@@ -795,7 +786,7 @@
 #int(c['sec']),
 #int(c['dsec']) * 10,
 #tz)
-return 
int(c['year']),int(c['m

SF.net SVN: matplotlib: [4588] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/netcdftime.py

2007-12-04 Thread jswhit
Revision: 4588
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4588&view=rev
Author:   jswhit
Date: 2007-12-04 11:55:12 -0800 (Tue, 04 Dec 2007)

Log Message:
---
fix typo

Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
2007-12-04 19:49:01 UTC (rev 4587)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
2007-12-04 19:55:12 UTC (rev 4588)
@@ -736,7 +736,7 @@
 
 Lots of things are optional; just the date is mandatory.
 
-by Roberto D'Almeida 
+by Roberto De Almeida
 
 excerpted from coards.py - http://cheeseshop.python.org/pypi/coards/
 """


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4589] trunk/py4science/workbook/basemap.tex

2007-12-04 Thread jswhit
Revision: 4589
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4589&view=rev
Author:   jswhit
Date: 2007-12-04 11:57:01 -0800 (Tue, 04 Dec 2007)

Log Message:
---
fix typo

Modified Paths:
--
trunk/py4science/workbook/basemap.tex

Modified: trunk/py4science/workbook/basemap.tex
===
--- trunk/py4science/workbook/basemap.tex   2007-12-04 19:55:12 UTC (rev 
4588)
+++ trunk/py4science/workbook/basemap.tex   2007-12-04 19:57:01 UTC (rev 
4589)
@@ -97,7 +97,7 @@
 data, such as output from climate models. These data often come on
 latitude/longitude grids. One common data format for storing such
 grids is NetCDF.  Basemap includes a NetCDF file reader (written in
-pure python by Roberto D'Almeida). 
+pure python by Roberto De Almeida). 
 You can also access remote datasets over the web using the OPeNDAP
 protocol - just give the NetCDFFile function a URL instead of a local file name
 and Roberto's pydap module (\texttt{http://pydap.org}) will be used.


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4590] branches/transforms/src/_backend_agg.cpp

2007-12-04 Thread mdboom
Revision: 4590
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4590&view=rev
Author:   mdboom
Date: 2007-12-04 12:06:45 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Bugfix for missing markers.  Bugfix for faceted pcolor-based quadmeshes.

Modified Paths:
--
branches/transforms/src/_backend_agg.cpp

Modified: branches/transforms/src/_backend_agg.cpp
===
--- branches/transforms/src/_backend_agg.cpp2007-12-04 19:57:01 UTC (rev 
4589)
+++ branches/transforms/src/_backend_agg.cpp2007-12-04 20:06:45 UTC (rev 
4590)
@@ -506,6 +506,8 @@
   //maxim's suggestions for cached scanlines
   agg::scanline_storage_aa8 scanlines;
   theRasterizer->reset();
+  theRasterizer->reset_clipping();
+  rendererBase->reset_clipping(true);
 
   agg::int8u  staticFillCache[MARKER_CACHE_SIZE];
   agg::int8u  staticStrokeCache[MARKER_CACHE_SIZE];
@@ -792,8 +794,12 @@
   // Render stroke
   if (gc.linewidth != 0.0) {
 double linewidth = gc.linewidth;
-if (!gc.isaa)
-  linewidth = round(linewidth);
+if (!gc.isaa) {
+  if (linewidth < 0.5)
+   linewidth = 0.5;
+  else
+   linewidth = round(linewidth);
+}
 if (gc.dashes.size() == 0) {
   stroke_t stroke(path);
   stroke.width(linewidth);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4591] branches/transforms/lib/matplotlib/axes.py

2007-12-04 Thread mdboom
Revision: 4591
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4591&view=rev
Author:   mdboom
Date: 2007-12-04 12:07:31 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Bugfix for faceted pcolor-based quadmeshes.

Modified Paths:
--
branches/transforms/lib/matplotlib/axes.py

Modified: branches/transforms/lib/matplotlib/axes.py
===
--- branches/transforms/lib/matplotlib/axes.py  2007-12-04 20:06:45 UTC (rev 
4590)
+++ branches/transforms/lib/matplotlib/axes.py  2007-12-04 20:07:31 UTC (rev 
4591)
@@ -4694,12 +4694,14 @@
 
 
 if shading == 'faceted':
-edgecolors =  (0,0,0,1),
+edgecolors = (0,0,0,1),
+linewidths = (0.25,)
 else:
 edgecolors = 'None'
+linewidths = (0.0,)
 kwargs.setdefault('edgecolors', edgecolors)
 kwargs.setdefault('antialiaseds', (0,))
-kwargs.setdefault('linewidths', (0.25,))
+kwargs.setdefault('linewidths', linewidths)
 
 collection = mcoll.PolyCollection(verts, **kwargs)
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4592] branches/transforms/lib/matplotlib/ collections.py

2007-12-04 Thread mdboom
Revision: 4592
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4592&view=rev
Author:   mdboom
Date: 2007-12-04 12:07:59 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Bugfix for broken_barh demo

Modified Paths:
--
branches/transforms/lib/matplotlib/collections.py

Modified: branches/transforms/lib/matplotlib/collections.py
===
--- branches/transforms/lib/matplotlib/collections.py   2007-12-04 20:07:31 UTC 
(rev 4591)
+++ branches/transforms/lib/matplotlib/collections.py   2007-12-04 20:07:59 UTC 
(rev 4592)
@@ -54,7 +54,7 @@
 _offsets = npy.array([], npy.float_)
 _transOffset = transforms.IdentityTransform()
 _transforms = []
-
+
 zorder = 1
 def __init__(self,
  edgecolors=None,
@@ -82,7 +82,7 @@
 if linewidths is None: linewidths = (mpl.rcParams['patch.linewidth'],)
 if antialiaseds is None: antialiaseds = 
(mpl.rcParams['patch.antialiased'],)
 self.set_linestyles(linestyles)
-
+
 self._facecolors  = _colors.colorConverter.to_rgba_array(facecolors)
 if edgecolors == 'None':
 self._edgecolors = self._facecolors
@@ -117,13 +117,13 @@
 else: return val
 
 raise TypeError('val must be a float or nonzero sequence of floats')
-
+
 def get_paths(self):
 raise NotImplementedError
 
 def get_transforms(self):
 return self._transforms
-
+
 def get_datalim(self, transData):
 transform = self.get_transform()
 transOffset = self._transOffset
@@ -136,7 +136,7 @@
 offsets = transOffset.transform_non_affine(offsets)
 transOffset = transOffset.get_affine()
 offsets = npy.asarray(offsets, npy.float_)
-
+
 result = mpath.get_path_collection_extents(
 transform.frozen(), paths, self.get_transforms(),
 offsets, transOffset.frozen())
@@ -163,7 +163,7 @@
 xs = self.convert_xunits(self._offsets[:0])
 ys = self.convert_yunits(self._offsets[:1])
 offsets = zip(xs, ys)
-
+
 offsets = npy.asarray(offsets, npy.float_)
 
 self.update_scalarmappable()
@@ -171,18 +171,18 @@
 clippath, clippath_trans = self.get_transformed_clip_path_and_affine()
 if clippath_trans is not None:
 clippath_trans = clippath_trans.frozen()
-
+
 if not transform.is_affine:
 paths = [transform.transform_path_non_affine(path) for path in 
paths]
 transform = transform.get_affine()
 if not transOffset.is_affine:
 offsets = transOffset.transform_non_affine(offsets)
 transOffset = transOffset.get_affine()
-
+
 renderer.draw_path_collection(
 transform.frozen(), self.clipbox, clippath, clippath_trans,
 paths, self.get_transforms(),
-offsets, transOffset, 
+offsets, transOffset,
 self._facecolors, self._edgecolors, self._linewidths,
 self._linestyles, self._antialiaseds)
 renderer.close_group(self.__class__.__name__)
@@ -210,7 +210,7 @@
 
 def set_pickradius(self,pickradius): self.pickradius = 5
 def get_pickradius(self): return self.pickradius
-
+
 def set_linewidths(self, lw):
 """
 Set the linewidth(s) for the collection.  lw can be a scalar or a
@@ -221,7 +221,7 @@
 """
 self._linewidths = self._get_value(lw)
 set_lw = set_linewidth = set_linewidths
-
+
 def set_linestyles(self, ls):
 """
 Set the linestyles(s) for the collection.
@@ -251,7 +251,7 @@
 raise ValueError('Do not know how to convert %s to dashes'%ls)
 self._linestyles = dashes
 set_dashes = set_linestyle = set_linestyles
-
+
 def set_color(self, c):
 """
 Set both the edgecolor and the facecolor.
@@ -307,11 +307,11 @@
 def get_linewidths(self):
 return self._linewidths
 get_linewidth = get_linewidths
-
+
 def get_linestyles(self):
 return self._linestyles
 get_dashes = get_linestyle = get_linestyles
-
+
 def update_scalarmappable(self):
 """
 If the scalar mappable array is not none, update colors
@@ -348,7 +348,7 @@
 None, they default to their patch.* rc params setting, in sequence
 form.
 """
-
+
 class QuadMesh(Collection):
 """
 Class for the efficient drawing of a quadrilateral mesh.
@@ -391,7 +391,7 @@
 # By converting to floats now, we can avoid that on every draw.
 self._coordinates = self._coordinates.reshape((meshHeight + 1, 
meshWidth + 1, 2))
 self._coordinates = npy.array(self._coordinates, npy.float_)
-
+
 def get_paths(self, dataTrans=None):
 if self._paths is None:
 self._pat

SF.net SVN: matplotlib: [4593] branches/transforms/lib/matplotlib/lines.py

2007-12-04 Thread mdboom
Revision: 4593
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4593&view=rev
Author:   mdboom
Date: 2007-12-04 12:08:28 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Fix direction of left and right caret markers.

Modified Paths:
--
branches/transforms/lib/matplotlib/lines.py

Modified: branches/transforms/lib/matplotlib/lines.py
===
--- branches/transforms/lib/matplotlib/lines.py 2007-12-04 20:07:59 UTC (rev 
4592)
+++ branches/transforms/lib/matplotlib/lines.py 2007-12-04 20:08:28 UTC (rev 
4593)
@@ -309,13 +309,13 @@
 xyt = self.get_transform().transform(self._xy)
 xt = xyt[:, 0]
 yt = xyt[:, 1]
-
+
 if self.figure == None:
 print str(self),' has no figure set'
 pixels = self.pickradius
 else:
 pixels = self.figure.dpi/72. * self.pickradius
-
+
 if self._linestyle == 'None':
 # If no line, return the nearby point(s)
 d = npy.sqrt((xt-mouseevent.x)**2 + (yt-mouseevent.y)**2)
@@ -387,7 +387,7 @@
 if not ma.isMaskedArray(y):
 y = npy.asarray(y)
 not_masked += 1
-
+
 if (not_masked < 2 or
 (x is not self._xorig and
  (x.shape != self._xorig.shape or npy.any(x != self._xorig))) or
@@ -413,7 +413,7 @@
 y = npy.asarray(self.convert_yunits(self._yorig), float)
 x = npy.ravel(x)
 y = npy.ravel(y)
-
+
 if len(x)==1 and len(y)>1:
 x = x * npy.ones(y.shape, float)
 if len(y)==1 and len(x)>1:
@@ -447,7 +447,7 @@
 Artist.set_transform(self, t)
 self._invalid = True
 # self._transformed_path = TransformedPath(self._path, 
self.get_transform())
-
+
 def _is_sorted(self, x):
 "return true if x is sorted"
 if len(x)<2: return 1
@@ -456,7 +456,7 @@
 def draw(self, renderer):
 if self._invalid:
 self.recache()
-
+
 renderer.open_group('line2d')
 
 if not self._visible: return
@@ -481,7 +481,7 @@
 tpath, affine = 
self._transformed_path.get_transformed_path_and_affine()
 lineFunc = getattr(self, funcname)
 lineFunc(renderer, gc, tpath, affine.frozen())
-   
+
 if self._marker is not None:
 gc = renderer.new_gc()
 self._set_gc_clip(gc)
@@ -565,7 +565,7 @@
 if self._invalid:
 self.recache()
 return self._xy
-
+
 def set_antialiased(self, b):
 """
 True if line should be drawin with antialiased rendering
@@ -596,7 +596,7 @@
 
 'steps' is equivalent to 'steps-pre' and is maintained for
 backward-compatibility.
-
+
 ACCEPTS: [ '-' | '--' | '-.' | ':' | 'steps' | 'steps-pre' | 
'steps-mid' | 'steps-post' | 'None' | ' ' | '' ]
 """
 if linestyle not in self._lineStyles:
@@ -693,12 +693,12 @@
 def _draw_nothing(self, *args, **kwargs):
 pass
 
-
+
 def _draw_solid(self, renderer, gc, path, trans):
 gc.set_linestyle('solid')
renderer.draw_path(gc, path, trans)
 
-
+
 def _draw_steps_pre(self, renderer, gc, path, trans):
 vertices = self._xy
 steps = ma.zeros((2*len(vertices)-1, 2), npy.float_)
@@ -720,7 +720,7 @@
 path = Path(steps)
 self._draw_solid(renderer, gc, path, trans)
 
-
+
 def _draw_steps_mid(self, renderer, gc, path, trans):
 vertices = self._xy
 steps = ma.zeros((2*len(vertices), 2), npy.float_)
@@ -733,8 +733,8 @@
 
 path = Path(steps)
 self._draw_solid(renderer, gc, path, trans)
-
 
+
 def _draw_dashed(self, renderer, gc, path, trans):
 gc.set_linestyle('dashed')
 if self._dashSeq is not None:
@@ -747,12 +747,12 @@
 gc.set_linestyle('dashdot')
renderer.draw_path(gc, path, trans)
 
-   
+
 def _draw_dotted(self, renderer, gc, path, trans):
 gc.set_linestyle('dotted')
renderer.draw_path(gc, path, trans)
 
-   
+
 def _draw_point(self, renderer, gc, path, path_trans):
 w = renderer.points_to_pixels(self._markersize) * \
self._point_size_reduction * 0.5
@@ -768,8 +768,8 @@
renderer.draw_markers(gc, Path.unit_rectangle(),
   self._draw_pixel_transform,
  path, path_trans, rgbFace)
-   
-   
+
+
 def _draw_circle(self, renderer, gc, path, path_trans):
 w = renderer.points_to_pixels(self._markersize) * 0.5
 rgbFace = self._get_rgb_face()
@@ -795,7 +795,7 @@
renderer.draw_markers(gc, self._triangle_path, transform,
  path, path_trans, rgbFace)
 
-   
+
 def _draw_triangle_left(self, renderer, gc, path, path_trans):
 offse

SF.net SVN: matplotlib: [4594] branches/transforms/lib/matplotlib/patches. py

2007-12-04 Thread mdboom
Revision: 4594
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4594&view=rev
Author:   mdboom
Date: 2007-12-04 12:28:24 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Fix bbox_artist

Modified Paths:
--
branches/transforms/lib/matplotlib/patches.py

Modified: branches/transforms/lib/matplotlib/patches.py
===
--- branches/transforms/lib/matplotlib/patches.py   2007-12-04 20:08:28 UTC 
(rev 4593)
+++ branches/transforms/lib/matplotlib/patches.py   2007-12-04 20:28:24 UTC 
(rev 4594)
@@ -933,6 +933,7 @@
   height=h,
   fill=fill,
   )
+r.set_transform(transforms.IdentityTransform())
 r.set_clip_on( False )
 r.update(props)
 r.draw(renderer)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4595] branches/transforms/src/_image.cpp

2007-12-04 Thread mdboom
Revision: 4595
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4595&view=rev
Author:   mdboom
Date: 2007-12-04 12:29:54 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Fix interpolation so it wraps rather than clips.

Modified Paths:
--
branches/transforms/src/_image.cpp

Modified: branches/transforms/src/_image.cpp
===
--- branches/transforms/src/_image.cpp  2007-12-04 20:28:24 UTC (rev 4594)
+++ branches/transforms/src/_image.cpp  2007-12-04 20:29:54 UTC (rev 4595)
@@ -392,10 +392,11 @@
   agg::conv_transform imageBox(path, srcMatrix);
   ras.add_path(imageBox);
 
-  typedef agg::image_accessor_clip img_accessor_type;
+  typedef agg::wrap_mode_reflect reflect_type;
+  typedef agg::image_accessor_wrap 
img_accessor_type;
 
   pixfmt pixfmtin(*rbufIn);
-  img_accessor_type ia(pixfmtin, background);
+  img_accessor_type ia(pixfmtin);
   switch(interpolation)
 {
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4596] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/basemap.py

2007-12-04 Thread jswhit
Revision: 4596
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4596&view=rev
Author:   jswhit
Date: 2007-12-04 12:37:37 -0800 (Tue, 04 Dec 2007)

Log Message:
---
docstring additions

Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 20:29:54 UTC (rev 4595)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 20:37:37 UTC (rev 4596)
@@ -11,6 +11,10 @@
 shiftgrid:  shifts global lat/lon grids east or west.
 
 addcyclic: Add cyclic (wraparound) point in longitude.
+
+num2date: convert from a numeric time value to a datetime object.
+
+date2num: convert from a datetime object to a numeric time value.
 """
 from matplotlib import rcParams
 from matplotlib import __version__ as _matplotlib_version


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4597] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/basemap.py

2007-12-04 Thread jswhit
Revision: 4597
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4597&view=rev
Author:   jswhit
Date: 2007-12-04 12:43:54 -0800 (Tue, 04 Dec 2007)

Log Message:
---
docstring additions.

Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 20:37:37 UTC (rev 4596)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 20:43:54 UTC (rev 4597)
@@ -2886,7 +2886,8 @@
  All the values currently defined in the CF metadata convention 
  (http://cf-pcmdi.llnl.gov/documents/cf-conventions/) are supported.
  Valid calendars 'standard', 'gregorian', 'proleptic_gregorian'
- 'noleap', '365_day', '360_day', 'julian'.  Default is 'standard'.
+ 'noleap', '365_day', '360_day', 'julian', 'all_leap', '366_day'.
+ Default is 'standard', which is a mixed Julian/Gregorian calendar.
 
 Returns a datetime instance, or an array of datetime instances.
 
@@ -2926,7 +2927,8 @@
  All the values currently defined in the CF metadata convention 
  (http://cf-pcmdi.llnl.gov/documents/cf-conventions/) are supported.
  Valid calendars 'standard', 'gregorian', 'proleptic_gregorian'
- 'noleap', '365_day', '360_day', 'julian'.  Default is 'standard'.
+ 'noleap', '365_day', '360_day', 'julian', 'all_leap', '366_day'.
+ Default is 'standard'.
 
 Returns a numeric time value, or an array of numeric time values.
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4598] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/netcdftime.py

2007-12-04 Thread jswhit
Revision: 4598
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4598&view=rev
Author:   jswhit
Date: 2007-12-04 12:48:55 -0800 (Tue, 04 Dec 2007)

Log Message:
---
check for time zone offset.

Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
2007-12-04 20:43:54 UTC (rev 4597)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
2007-12-04 20:48:55 UTC (rev 4598)
@@ -446,7 +446,8 @@
 # parse the date string.
 n = timestr.find('since')+6
 year,month,day,hour,minute,second,utc_offset = _parse_date(timestr[n:])
-
+if utc_offset:
+raise ValueError("time zone offset not allowed")
 return units, datetime(year, month, day, hour, minute, second)
 
 class utime:
@@ -572,8 +573,9 @@
  it is divisible by 400.
  - C{'noleap'} or C{'365_day'}:
  Gregorian calendar without leap years, i.e., all years are 365 days long. 
- all_leap or 366_day Gregorian calendar with every year being a leap year, 
- i.e., all years are 366 days long.
+ - C{all_leap} or C{'366_day'}:  
+ Gregorian calendar with every year being a leap year, i.e.,
+ all years are 366 days long.
  -C{'360_day'}:
  All years are 360 days divided into 30 day months. 
  -C{'julian'}:
@@ -773,19 +775,8 @@
 m = p.match(origin.strip())
 if m:
 c = m.groupdict(0)
-
-# Instantiate timezone object.
+# UTC offset.
 offset = int(c['ho'])*60 + int(c['mo'])
-#tz = FixedOffset(offset, 'Unknown')
-
-#return datetime(int(c['year']),
-#int(c['month']),
-#int(c['day']),
-#int(c['hour']),
-#int(c['min']),
-#int(c['sec']),
-#int(c['dsec']) * 10,
-#tz)
 return 
int(c['year']),int(c['month']),int(c['day']),int(c['hour']),int(c['min']),int(c['sec']),offset
 
 raise Exception('Invalid date origin: %s' % origin)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4599] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/basemap.py

2007-12-04 Thread jswhit
Revision: 4599
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4599&view=rev
Author:   jswhit
Date: 2007-12-04 12:53:52 -0800 (Tue, 04 Dec 2007)

Log Message:
---
docstring addition.

Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 20:48:55 UTC (rev 4598)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 20:53:52 UTC (rev 4599)
@@ -2928,7 +2928,7 @@
  (http://cf-pcmdi.llnl.gov/documents/cf-conventions/) are supported.
  Valid calendars 'standard', 'gregorian', 'proleptic_gregorian'
  'noleap', '365_day', '360_day', 'julian', 'all_leap', '366_day'.
- Default is 'standard'.
+ Default is 'standard', which is a mixed Julian/Gregorian calendar.
 
 Returns a numeric time value, or an array of numeric time values.
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4600] branches/transforms/lib/matplotlib/axes.py

2007-12-04 Thread mdboom
Revision: 4600
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4600&view=rev
Author:   mdboom
Date: 2007-12-04 12:55:04 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Fix inverted x-axis bug.

Modified Paths:
--
branches/transforms/lib/matplotlib/axes.py

Modified: branches/transforms/lib/matplotlib/axes.py
===
--- branches/transforms/lib/matplotlib/axes.py  2007-12-04 20:53:52 UTC (rev 
4599)
+++ branches/transforms/lib/matplotlib/axes.py  2007-12-04 20:55:04 UTC (rev 
4600)
@@ -1599,7 +1599,7 @@
 if xmin is None: xmin = old_xmin
 if xmax is None: xmax = old_xmax
 
-xmin, xmax = mtransforms.nonsingular(xmin, xmax)
+xmin, xmax = mtransforms.nonsingular(xmin, xmax, increasing=False)
 xmin, xmax = self.xaxis.limit_range_for_scale(xmin, xmax)
 
 self.viewLim.intervalx = (xmin, xmax)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4601] trunk/toolkits/basemap

2007-12-04 Thread jswhit
Revision: 4601
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4601&view=rev
Author:   jswhit
Date: 2007-12-04 12:56:05 -0800 (Tue, 04 Dec 2007)

Log Message:
---
bump version number

Modified Paths:
--
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
trunk/toolkits/basemap/setup.py

Modified: trunk/toolkits/basemap/Changelog
===
--- trunk/toolkits/basemap/Changelog2007-12-04 20:55:04 UTC (rev 4600)
+++ trunk/toolkits/basemap/Changelog2007-12-04 20:56:05 UTC (rev 4601)
@@ -1,5 +1,6 @@
+version 0.9.9 (not yet released)
* added num2date and date2num functions, which use 
-included netcdftime module.
+ included netcdftime module.
 version 0.9.8 (svn revision 4526)
* fixes for filling continents in orthographic projection.
* added 'maskandscale' kwarg to NetCDFFile to

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 20:55:04 UTC (rev 4600)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-04 20:56:05 UTC (rev 4601)
@@ -37,7 +37,7 @@
 # basemap data files now installed in lib/matplotlib/toolkits/basemap/data
 basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
 
-__version__ = '0.9.8'
+__version__ = '0.9.9'
 
 # supported map projections.
 _projnames = {'cyl'  : 'Cylindrical Equidistant',

Modified: trunk/toolkits/basemap/setup.py
===
--- trunk/toolkits/basemap/setup.py 2007-12-04 20:55:04 UTC (rev 4600)
+++ trunk/toolkits/basemap/setup.py 2007-12-04 20:56:05 UTC (rev 4601)
@@ -134,7 +134,7 @@
 package_data = 
{'matplotlib.toolkits.basemap':pyproj_datafiles+basemap_datafiles}
 setup(
   name  = "basemap",
-  version   = "0.9.8",
+  version   = "0.9.9",
   description   = "Plot data on map projections with matplotlib",
   long_description  = """
   An add-on toolkit for matplotlib that lets you plot data


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4602] branches/transforms/lib/matplotlib/axis.py

2007-12-04 Thread mdboom
Revision: 4602
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4602&view=rev
Author:   mdboom
Date: 2007-12-04 13:30:06 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Bugfix.

Modified Paths:
--
branches/transforms/lib/matplotlib/axis.py

Modified: branches/transforms/lib/matplotlib/axis.py
===
--- branches/transforms/lib/matplotlib/axis.py  2007-12-04 20:56:05 UTC (rev 
4601)
+++ branches/transforms/lib/matplotlib/axis.py  2007-12-04 21:30:06 UTC (rev 
4602)
@@ -1125,7 +1125,7 @@
 if not len(bboxes2):
 top = self.axes.bbox.ymax
 else:
-bbox = bbox_union(bboxes2)
+bbox = Bbox.union(bboxes2)
 top = bbox.y1
 self.label.set_position( (x, top+self.LABELPAD*self.figure.dpi / 
72.0))
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4603] branches/transforms

2007-12-04 Thread mdboom
Revision: 4603
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4603&view=rev
Author:   mdboom
Date: 2007-12-04 13:33:33 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Add experimental support for auto-layout of axes on the figure, to
prevent ticks and labels from overlapping things in other axes.

Modified Paths:
--
branches/transforms/examples/backend_driver.py
branches/transforms/examples/colorbar_only.py
branches/transforms/examples/figlegend_demo.py
branches/transforms/examples/finance_demo.py
branches/transforms/examples/mathtext_demo.py
branches/transforms/examples/simple_plot.py
branches/transforms/lib/matplotlib/axes.py
branches/transforms/lib/matplotlib/axis.py
branches/transforms/lib/matplotlib/figure.py
branches/transforms/lib/matplotlib/projections/polar.py
branches/transforms/lib/matplotlib/rcsetup.py

Added Paths:
---
branches/transforms/examples/auto_layout.py

Added: branches/transforms/examples/auto_layout.py
===
--- branches/transforms/examples/auto_layout.py (rev 0)
+++ branches/transforms/examples/auto_layout.py 2007-12-04 21:33:33 UTC (rev 
4603)
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+"""
+Example: simple line plot.
+Show how to make and save a simple line plot with labels, title and grid
+"""
+from pylab import *
+
+t = arange(0.0, 1.0+0.01, 0.01)
+s = cos(2*2*pi*t)
+ax1 = subplot(211)
+plot(t, s, '-', lw=2)
+
+xlabel('xlabel for bottom axes')
+ylabel('ylabel on the right')
+title('About as simple as it gets, folks')
+grid(True)
+ax1.yaxis.set_label_position('right')
+ax1.xaxis.set_ticklabels(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 
'Friday'])
+for label in ax1.get_xticklabels():
+label.set_rotation(45)
+
+ax2 = subplot(212)
+plot(t, s, '-', lw=2)
+grid(True)
+xlabel('xlabel for bottom axes (the ticks are on the top for no good reason)')
+ylabel('I\'m a lefty')
+ax2.xaxis.set_label_position('bottom')
+ax2.xaxis.set_ticks_position('top')
+
+
+#savefig('simple_plot.png')
+savefig('simple_plot')
+
+show()


Property changes on: branches/transforms/examples/auto_layout.py
___
Name: svn:executable
   + *

Modified: branches/transforms/examples/backend_driver.py
===
--- branches/transforms/examples/backend_driver.py  2007-12-04 21:30:06 UTC 
(rev 4602)
+++ branches/transforms/examples/backend_driver.py  2007-12-04 21:33:33 UTC 
(rev 4603)
@@ -23,6 +23,7 @@
 'alignment_test.py',
 'arctest.py',
 'arrow_demo.py',
+'auto_layout.py',
 'axes_demo.py',
 'axhspan_demo.py',
 'bar_stacked.py',
@@ -35,7 +36,7 @@
 'cohere_demo.py',
 'contour_demo.py',
 'contourf_demo.py',
-'csd_demo.py',
+'csd_demo.py',
 'custom_ticker1.py',
 'customize_rc.py',
 'date_demo1.py',

Modified: branches/transforms/examples/colorbar_only.py
===
--- branches/transforms/examples/colorbar_only.py   2007-12-04 21:30:06 UTC 
(rev 4602)
+++ branches/transforms/examples/colorbar_only.py   2007-12-04 21:33:33 UTC 
(rev 4603)
@@ -7,7 +7,7 @@
 
 # Make a figure and axes with dimensions as desired.
 fig = pylab.figure(figsize=(8,1.5))
-ax = fig.add_axes([0.05, 0.4, 0.9, 0.5])
+ax = fig.add_axes([0.05, 0.05, 0.9, 0.9])
 
 # Set the colormap and norm to correspond to the data for which
 # the colorbar will be used.

Modified: branches/transforms/examples/figlegend_demo.py
===
--- branches/transforms/examples/figlegend_demo.py  2007-12-04 21:30:06 UTC 
(rev 4602)
+++ branches/transforms/examples/figlegend_demo.py  2007-12-04 21:33:33 UTC 
(rev 4603)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 from pylab import *
-ax1 = axes([0.1, 0.1, 0.4, 0.7])
+ax1 = axes([0.05, 0.1, 0.4, 0.7])
 ax2 = axes([0.55, 0.1, 0.4, 0.7])
 
 x = arange(0.0, 2.0, 0.02)

Modified: branches/transforms/examples/finance_demo.py
===
--- branches/transforms/examples/finance_demo.py2007-12-04 21:30:06 UTC 
(rev 4602)
+++ branches/transforms/examples/finance_demo.py2007-12-04 21:33:33 UTC 
(rev 4603)
@@ -22,7 +22,7 @@
 raise SystemExit
 
 fig = figure()
-fig.subplots_adjust(bottom=0.2)
+# fig.subplots_adjust(bottom=0.2)
 ax = fig.add_subplot(111)
 ax.xaxis.set_major_locator(mondays)
 ax.xaxis.set_minor_locator(alldays)

Modified: branches/transforms/examples/mathtext_demo.py
===
--- branches/transforms/examples/mathtext_demo.py   2007-12-04 21:30:06 UTC 
(rev 4602)
+++ branches/transforms/examples/mathtext_demo.py   2007-12-04 21:33:33 UTC 
(rev 4603)
@@ -7,7 +7,7 @@
 from matplotlib.pyplot imp

SF.net SVN: matplotlib: [4604] branches/transforms/examples/auto_layout.py

2007-12-04 Thread mdboom
Revision: 4604
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4604&view=rev
Author:   mdboom
Date: 2007-12-04 13:53:43 -0800 (Tue, 04 Dec 2007)

Log Message:
---
Fix xlabel on top axes to say what it is.

Modified Paths:
--
branches/transforms/examples/auto_layout.py

Modified: branches/transforms/examples/auto_layout.py
===
--- branches/transforms/examples/auto_layout.py 2007-12-04 21:33:33 UTC (rev 
4603)
+++ branches/transforms/examples/auto_layout.py 2007-12-04 21:53:43 UTC (rev 
4604)
@@ -10,7 +10,7 @@
 ax1 = subplot(211)
 plot(t, s, '-', lw=2)
 
-xlabel('xlabel for bottom axes')
+xlabel('xlabel for top axes')
 ylabel('ylabel on the right')
 title('About as simple as it gets, folks')
 grid(True)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4605] trunk/toolkits/basemap/examples

2007-12-04 Thread jswhit
Revision: 4605
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4605&view=rev
Author:   jswhit
Date: 2007-12-04 18:31:36 -0800 (Tue, 04 Dec 2007)

Log Message:
---
better way to handle backwards compatibility in axes.get_position()

Modified Paths:
--
trunk/toolkits/basemap/examples/contour_demo.py
trunk/toolkits/basemap/examples/panelplot.py
trunk/toolkits/basemap/examples/plotmap.py
trunk/toolkits/basemap/examples/plotmap_masked.py
trunk/toolkits/basemap/examples/plotmap_oo.py
trunk/toolkits/basemap/examples/plotprecip.py
trunk/toolkits/basemap/examples/pnganim.py
trunk/toolkits/basemap/examples/simpletest_oo.py
trunk/toolkits/basemap/examples/test.py

Modified: trunk/toolkits/basemap/examples/contour_demo.py
===
--- trunk/toolkits/basemap/examples/contour_demo.py 2007-12-04 21:53:43 UTC 
(rev 4604)
+++ trunk/toolkits/basemap/examples/contour_demo.py 2007-12-05 02:31:36 UTC 
(rev 4605)
@@ -21,10 +21,12 @@
 x, y = m(lons, lats)
 CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
 CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
-try: 
-l,b,w,h = ax.get_position()
-except:
-l,b,w,h = (ax.get_position()).bounds
+# setup colorbar axes instance.
+# for matplotlib 0.91 and earlier, could do l,b,w,h = ax.get_position()
+# for post 0.91, pos = ax.get_position(); l,b,w,h = pos.bounds
+# this works for both.
+pos = ax.get_position()
+l, b, w, h = getattr(pos, 'bounds', pos)
 cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
 colorbar(drawedges=True, cax=cax) # draw colorbar
 axes(ax)  # make the original axes current again
@@ -49,10 +51,8 @@
 x, y = m(lons, lats)
 CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
 CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
-try: 
-l,b,w,h = ax.get_position()
-except:
-l,b,w,h = (ax.get_position()).bounds
+pos = ax.get_position()
+l, b, w, h = getattr(pos, 'bounds', pos)
 cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
 colorbar(drawedges=True, cax=cax) # draw colorbar
 axes(ax)  # make the original axes current again
@@ -77,10 +77,8 @@
 x, y = m(lons, lats)
 CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
 CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
-try: 
-l,b,w,h = ax.get_position()
-except:
-l,b,w,h = (ax.get_position()).bounds
+pos = ax.get_position()
+l, b, w, h = getattr(pos, 'bounds', pos)
 cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
 colorbar(drawedges=True, cax=cax) # draw colorbar
 axes(ax)  # make the original axes current again
@@ -105,10 +103,8 @@
 x, y = m(lons, lats)
 CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
 CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
-try: 
-l,b,w,h = ax.get_position()
-except:
-l,b,w,h = (ax.get_position()).bounds
+pos = ax.get_position()
+l, b, w, h = getattr(pos, 'bounds', pos)
 cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
 colorbar(drawedges=True, cax=cax) # draw colorbar
 axes(ax)  # make the original axes current again
@@ -134,10 +130,8 @@
 x, y = m(lons, lats)
 CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
 CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
-try: 
-l,b,w,h = ax.get_position()
-except:
-l,b,w,h = (ax.get_position()).bounds
+pos = ax.get_position()
+l, b, w, h = getattr(pos, 'bounds', pos)
 cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
 colorbar(drawedges=True, cax=cax) # draw colorbar
 axes(ax)  # make the original axes current again

Modified: trunk/toolkits/basemap/examples/panelplot.py
===
--- trunk/toolkits/basemap/examples/panelplot.py2007-12-04 21:53:43 UTC 
(rev 4604)
+++ trunk/toolkits/basemap/examples/panelplot.py2007-12-05 02:31:36 UTC 
(rev 4605)
@@ -27,10 +27,8 @@
 CS = mnh.contour(xnh,ynh,hgt,15,linewidths=0.5,colors='k')
 CS = mnh.contourf(xnh,ynh,hgt,15,cmap=P.cm.Spectral)
 # colorbar on bottom.
-try: 
-l,b,w,h = ax.get_position()
-except:
-l,b,w,h = (ax.get_position()).bounds
+pos = ax.get_position()
+l, b, w, h = getattr(pos, 'bounds', pos)
 cax = P.axes([l, b-0.05, w, 0.025]) # setup colorbar axes
 P.colorbar(cax=cax, orientation='horizontal',ticks=CS.levels[0::4]) # draw 
colorbar
 P.axes(ax)  # make the original axes current again
@@ -52,11 +50,8 @@
 CS = msh.contour(xsh,ysh,hgt,15,linewidths=0.5,colors='k')
 CS = msh.contourf(xsh,ysh,hgt,15,cmap=P.cm.Spectral)
 # colorbar on bottom.
-ax.apply_aspect()
-try: 
-l,b,w,h = ax.get_position()
-except:
-l,b,w,h = (ax.get_position()).bounds
+pos = ax.get_position()
+l, b, w, h = getattr(pos, 'bounds', pos)
 cax = P.axes([l, b-0.05, w, 0.025]) # setup colorbar axes
 P.colorbar(cax=cax,orientation='horizontal',ticks=MultipleLocator(320)) # draw 
colorbar
 P.axes(ax)  # make the original axes current again
@@ -78,10 +73,8 @@
 CS = mnh.contour(xnh,ynh,hgt,15,linewidths=0.5,colors='k')
 CS = mnh.contourf(xnh,ynh,hgt,15,cmap=P.cm.RdBu)

SF.net SVN: matplotlib: [4606] trunk/matplotlib/INSTALL

2007-12-04 Thread jdh2358
Revision: 4606
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4606&view=rev
Author:   jdh2358
Date: 2007-12-04 18:47:07 -0800 (Tue, 04 Dec 2007)

Log Message:
---
updated install doc

Modified Paths:
--
trunk/matplotlib/INSTALL

Modified: trunk/matplotlib/INSTALL
===
--- trunk/matplotlib/INSTALL2007-12-05 02:31:36 UTC (rev 4605)
+++ trunk/matplotlib/INSTALL2007-12-05 02:47:07 UTC (rev 4606)
@@ -1,42 +1,42 @@
+
 INTRODUCTION
 
-  matplotlib requires at a minimum python 2.2+, Numeric or numarray
-  and freetype.  To get the most out of matplotlib, you will want to
-  build some of the optional GUI and image extensions, discussed
-  below.  Matplotlib is known to work on linux, unix, win32 and OS X
+  matplotlib requires at a minimum python 2.3, numpy, libpng and
+  freetype.  To get the most out of matplotlib, you will want to build
+  some of the optional GUI and image extensions, discussed below.
+  Matplotlib is known to work on linux, unix, win32 and OS X
   platforms.
 
   There are two kinds of matplotlib backends: vector based and raster
-  based.  The vector based backends, SVG and PS, produce ASCII text
-  output files *.svg and *.ps.  The core raster based renderer is the
-  http://antigrain.com (agg) backend.  This is a high quality 2D
-  library that supports fast antialiasing, alpha blending and much
-  more.  If you want to produce PNGs or GUI images that support all of
-  matplotlib's features, you should compile matplotlib with agg
-  support and use one of the GUI agg backends: GTKAgg, WXAgg, TkAgg or
-  FLTKAgg.
+  based.  The vector based backends, SVG, PDF and PS, produce ASCII
+  text output files *.svg, *.pdf and *.ps.  The core raster based
+  renderer is the http://antigrain.com (agg) backend.  This is a high
+  quality 2D library that supports fast antialiasing, alpha blending
+  and much more.  If you want to produce PNGs or GUI images that
+  support all of matplotlib's features, you should compile matplotlib
+  with agg support and use one of the GUI agg backends: GTKAgg, WXAgg,
+  TkAgg or FLTKAgg.
 
 COMPILING
 
-  You will need to have recent versions of freetype (>= 2.1.7), libpng
-  and zlib installed on your system.  If you are using a package
-  manager, also make sure the devel versions of these packages are
-  also installed (eg freetype-devel).
+  You will need to have recent versions of freetype, libpng and zlib
+  installed on your system.  If you are using a package manager, also
+  make sure the devel versions of these packages are also installed
+  (eg freetype-devel).
 
-  The top of setup.py contains some flags controlling which backends
-  will be built.  If you want to use a GUI backend, you will need
-  either Tkinter, pygtk or wxpython installed on your system, from src
-  or from a package manager including the devel packages.  You can
-  choose which backends to enable by setting the flags in setup.py,
-  but the 'auto' flags will work in most cases, as matplotlib tries to
-  find a GUI and build the backend acccordingly.  If you know you
-  don't want a particular backend or extension, you can set that flag
-  to False.
+  matplotlib ships with a setup.cfg.template which you can use to
+  customize the build process.  Copy it to setup.cfg if you need to
+  customize something.  See that files for details of the parameters
+  you can set.
 
-  As discussed above, most users will want to set 'BUILD_AGG = 1' and
-  one or more of the GUI backends to True.  Exceptions to this are if
-  you know you don't need a GUI (eg a web server) or you only want to
-  produce vector graphics.
+  If you want to use a GUI backend, you will need either Tkinter,
+  pygtk or wxpython installed on your system, from src or from a
+  package manager including the devel packages.  You can choose which
+  backends to enable by setting the flags in setup.py, but the default
+  is to automatically detect your installed GUIs and build support for
+  them.  If you later find that you did not have a GUI toolkit like
+  pygtk installed when you built matplotlib, but now want it, you will
+  need to install the toolkit and rebuild matplotlib.
 
   If you have installed prerequisites to nonstandard places and need
   to inform matplotlib where they are, edit setupext.py an add the
@@ -45,13 +45,6 @@
   /some/path/include/somheader.h, put /some/path in the basedir list
   for your platform.
 
-  matplotlib works with with Numeric or numarray.  At compile time,
-  setup.py will look for both packages and compile the appropriate
-  extensions into matplotlib.  At runtime, the correct extension code
-  will be chosen based on your numerix setting in matplotlibrc.  If
-  you want to be able to use either Numeric or numarray efficiently
-  with matplotlib, it is important that you have *both* present and in
-  your PYTHONPATH when you compile matplotlib.
 
   Once you have everythin

SF.net SVN: matplotlib: [4607] trunk/py4science/doc/requirements.txt

2007-12-04 Thread jdh2358
Revision: 4607
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4607&view=rev
Author:   jdh2358
Date: 2007-12-04 18:47:33 -0800 (Tue, 04 Dec 2007)

Log Message:
---
updated win32 requirements

Modified Paths:
--
trunk/py4science/doc/requirements.txt

Modified: trunk/py4science/doc/requirements.txt
===
--- trunk/py4science/doc/requirements.txt   2007-12-05 02:47:07 UTC (rev 
4606)
+++ trunk/py4science/doc/requirements.txt   2007-12-05 02:47:33 UTC (rev 
4607)
@@ -145,18 +145,31 @@
 Microsoft Windows
 =
 
-- Install the latest windows `python MSI installer`_ from
+- Install the latest windows `python MSI installer`_ from the
+  python.org site.
 
-- install the win32com_ extensions.  IPython needs these to set up the start 
menu properly and they have lots of useful goodies for windows users anyhow, 
like the abiliy to read and write MS Office documents via the COM API.
+- install the win32com_ extensions.  IPython needs these to set up the
+  start menu properly and they have lots of useful goodies for windows
+  users anyhow, like the abiliy to read and write MS Office documents
+  via the COM API.
 
-- ipython: grab the latest win32 exe installer from the `ipython 
distributions`_ page
+- ipython: grab the latest win32 exe installer from the `ipython
+  distributions`_ page
 
-- numpy: grab the latest exe or msi installer for your version of python at 
`numpy download`_
+- numpy: grab the latest exe or msi installer for your version of
+  python at `numpy download`_
 
-- scipy: grab the latest exe or msi installer from the "Binary installation 
for Windows" distribution from the `scipy download`_ page.
+- scipy: grab the latest exe or msi installer from the "Binary
+  installation for Windows" distribution from the `scipy download`_
+  page.
 
-- matplotlib: grab the latest exe from the `matplotlib download`_ page
+- matplotlib: grab the latest exe from the `matplotlib download`_
+  page.  matplotlib requires the msvcp71.dll library, which you can
+  download from `dll_files`.  You will need to unzip the archive and
+  drag the dll into c:\\windows\\system32
 
+
+
 .. _`python MSI installer`: http://www.python.org/download/releases/2.5.1/
 
 .. _win32com: 
http://sourceforge.net/project/showfiles.php?group_id=78018&package_id=79063&release_id=449591
@@ -169,6 +182,8 @@
 
 .. _`matplotlib download`: 
http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=558083
 
+.. _`dll files`: http://www.dll-files.com/dllindex/dll-files.shtml?msvcp71
+
 Optional packages
 =
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4608] trunk/toolkits/mplsizer/demo/demo_gridsizer2 .py

2007-12-04 Thread astraw
Revision: 4608
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4608&view=rev
Author:   astraw
Date: 2007-12-04 23:33:05 -0800 (Tue, 04 Dec 2007)

Log Message:
---
initial commit of new demo

Added Paths:
---
trunk/toolkits/mplsizer/demo/demo_gridsizer2.py

Copied: trunk/toolkits/mplsizer/demo/demo_gridsizer2.py (from rev 2707, 
trunk/toolkits/mplsizer/demo/demo_gridsizer.py)
===
--- trunk/toolkits/mplsizer/demo/demo_gridsizer2.py 
(rev 0)
+++ trunk/toolkits/mplsizer/demo/demo_gridsizer2.py 2007-12-05 07:33:05 UTC 
(rev 4608)
@@ -0,0 +1,54 @@
+import pylab
+import numpy
+
+# Demonstration of MplGridSizer use.
+
+def labelax(ax,label):
+ax.text(0.5,0.5,label,
+   horizontalalignment='center',
+   verticalalignment='center',
+   transform = ax.transAxes,
+   )
+
+fig = pylab.figure(figsize=(8,6))
+
+# Axes placement doesn't matter, but to make sure matplotlib doesn't
+# simply return a previous Axes instance with the same bounding box,
+# assign a different label to each Axes instance.
+
+import matplotlib.toolkits.mplsizer as mplsizer
+
+frame = mplsizer.MplSizerFrame( fig )
+sizer = mplsizer.MplBoxSizer()#orientation='horizontal')
+frame.SetSizer(sizer)#,expand=1)
+
+x = numpy.linspace(0,2*numpy.pi,100)
+y = numpy.sin(1*x+numpy.pi/2) + .5*numpy.sin(3*x)
+cols = 3
+rows = 4
+hsizer = mplsizer.MplGridSizer(cols=cols)#,vgap_inch=0.1)
+for r in range(rows):
+for c in range(cols):
+if r==1 and c==1:
+# This is how to add an empty element.
+ax = mplsizer.MplSizerElement()
+else:
+
+# The unique labels are required to generate separate Axes 
instances.
+ax = fig.add_axes([0,0,1,1],label='row %d col %d'%(r,c))
+
+ax.plot(x,y)
+labelax(ax,'%d,%d'%(r,c))
+if not (r==2 and c==2):
+# Draw tick labels on one Axes instance.
+pylab.setp(ax,'xticks',[])
+pylab.setp(ax,'yticks',[])
+
+# The "border" value below was hand-tuned to not overlap.
+hsizer.Add(ax,name='row %d, col %d'%(r,c),all=1,border=0.3,expand=1)
+
+sizer.Add(hsizer,all=1,bottom=1,border=0.25,expand=1,option=1)
+
+frame.Layout() # Trigger the layout within mplsizer.
+
+pylab.show()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins