You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <md...@us...> - 2007-11-09 16:40:26
|
Revision: 4186 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4186&view=rev Author: mdboom Date: 2007-11-09 08:40:25 -0800 (Fri, 09 Nov 2007) Log Message: ----------- Removed debugging message. Modified Paths: -------------- branches/transforms/lib/matplotlib/backends/backend_wx.py Modified: branches/transforms/lib/matplotlib/backends/backend_wx.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-11-09 16:35:15 UTC (rev 4185) +++ branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-11-09 16:40:25 UTC (rev 4186) @@ -448,7 +448,6 @@ dc, gfx_ctx = self._cache.get(bitmap, (None, None)) if dc is None: - print "new dc" dc = wx.MemoryDC() dc.SelectObject(bitmap) gfx_ctx = wx.GraphicsContext.Create(dc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-09 16:35:21
|
Revision: 4185 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4185&view=rev Author: mdboom Date: 2007-11-09 08:35:15 -0800 (Fri, 09 Nov 2007) Log Message: ----------- Get wx backend working with wxGraphicsContext drawing. Modified Paths: -------------- branches/transforms/lib/matplotlib/backend_bases.py branches/transforms/lib/matplotlib/backends/backend_wx.py Modified: branches/transforms/lib/matplotlib/backend_bases.py =================================================================== --- branches/transforms/lib/matplotlib/backend_bases.py 2007-11-09 16:33:58 UTC (rev 4184) +++ branches/transforms/lib/matplotlib/backend_bases.py 2007-11-09 16:35:15 UTC (rev 4185) @@ -67,8 +67,6 @@ override this method in order to draw the marker only once and reuse it multiple times. """ - ctx = gc.ctx - ctx.new_path() tpath = trans.transform_path(path) for x, y in tpath.vertices: self.draw_path(gc, marker_path, Modified: branches/transforms/lib/matplotlib/backends/backend_wx.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-11-09 16:33:58 UTC (rev 4184) +++ branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-11-09 16:35:15 UTC (rev 4185) @@ -94,7 +94,7 @@ cvs_id = '$Id$' -import sys, os, os.path, math, StringIO +import sys, os, os.path, math, StringIO, weakref # Debugging settings here... # Debug level set here. If the debug level is less than 5, information @@ -154,7 +154,9 @@ from matplotlib.artist import Artist from matplotlib.cbook import exception_to_str from matplotlib.figure import Figure +from matplotlib.path import Path from matplotlib.text import _process_text_args, Text +from matplotlib.transforms import Affine2D from matplotlib.widgets import SubplotTool from matplotlib import rcParams @@ -261,10 +263,14 @@ #return 1, 1 if ismath: s = self.strip_math(s) - if self.gc is None: gc = self.new_gc() + if self.gc is None: + gc = self.new_gc() + else: + gc = self.gc + gfx_ctx = gc.gfx_ctx font = self.get_wx_font(s, prop) - self.gc.SetFont(font) - w, h, descent, leading = self.gc.GetFullTextExtent(s) + gfx_ctx.SetFont(font, wx.BLACK) + w, h, descent, leading = gfx_ctx.GetFullTextExtent(s) return w, h, descent @@ -272,97 +278,49 @@ 'return the canvas width and height in display coords' return self.width, self.height - - def draw_arc(self, gc, rgbFace, x, y, width, height, angle1, angle2, rotation): - """ - Draw an arc centered at x,y with width and height and angles - from 0.0 to 360.0. - If rgbFace is present, fill the figure in this colour, otherwise - it is not filled. - """ + def handle_clip_rectangle(self, gc): + new_bounds = gc.get_clip_rectangle() + if new_bounds is not None: + new_bounds = new_bounds.bounds + gfx_ctx = gc.gfx_ctx + if gfx_ctx._lastcliprect != new_bounds: + gfx_ctx._lastcliprect = new_bounds + if new_bounds is None: + gfx_ctx.ResetClip() + else: + gfx_ctx.Clip(*new_bounds) + + #@staticmethod + def convert_path(gfx_ctx, tpath): + wxpath = gfx_ctx.CreatePath() + for points, code in tpath.iter_segments(): + if code == Path.MOVETO: + wxpath.MoveToPoint(*points) + elif code == Path.LINETO: + wxpath.AddLineToPoint(*points) + elif code == Path.CURVE3: + wxpath.AddQuadCurveToPoint(*points) + elif code == Path.CURVE4: + wxpath.AddCurveToPoint(*points) + elif code == Path.CLOSEPOLY: + wxpath.CloseSubpath() + return wxpath + convert_path = staticmethod(convert_path) + + def draw_path(self, gc, path, transform, rgbFace=None): gc.select() - assert gc.Ok(), "wxMemoryDC not OK to use" - # wxPython requires upper left corner of bounding rectange for ellipse - # Theoretically you don't need the int() below, but it seems to make - # rounding of arc centre point more accurate in screen co-ordinates - ulX = x - int(width/2) - ulY = self.height - int(y + (height/2)) + self.handle_clip_rectangle(gc) + gfx_ctx = gc.gfx_ctx + transform = transform + Affine2D().scale(1.0, -1.0).translate(0.0, self.height) + tpath = transform.transform_path(path) + wxpath = self.convert_path(gfx_ctx, tpath) if rgbFace is not None: - r,g,b = self._to_wx_rgb(rgbFace) - new_brush =wx.Brush(wx.Colour(r,g,b), wx.SOLID) - gc.SetBrush(new_brush) + gfx_ctx.SetBrush(wx.Brush(gc.get_wxcolour(rgbFace))) + gfx_ctx.DrawPath(wxpath) else: - gc.SetBrush(wx.TRANSPARENT_BRUSH) - gc.DrawEllipticArc(int(ulX), int(ulY), int(width)+1, int(height)+1, - int(angle1), int(angle2)) + gfx_ctx.StrokePath(wxpath) gc.unselect() - def draw_line(self, gc, x1, y1, x2, y2): - """ - Draw a single line from x1,y1 to x2,y2 - """ - DEBUG_MSG("draw_line()", 1, self) - gc.select() - gc.DrawLine(int(x1), self.height - int(y1), - int(x2), self.height - int(y2)) - gc.unselect() - - def draw_lines(self, gc, x, y): - """ - x and y are equal length arrays, draw lines connecting each - point in x, y - """ - gc.select() - assert gc.Ok(), "wxMemoryDC not OK to use" - assert len(x) == len(y), "draw_lines() x and y must be of equal length" - gc.DrawLines([wx.Point(int(x[i]), self.height - int(y[i])) for i in range(len(x))]) - gc.unselect() - - def draw_polygon(self, gc, rgbFace, points): - """ - Draw a polygon. points is a len vertices tuple, each element - giving the x,y coords a vertex - """ - gc.select() - assert gc.Ok(), "wxMemoryDC not OK to use" - points = [(int(x), self.height - int(y)) for x,y in points] - if rgbFace is not None: - r,g,b = self._to_wx_rgb(rgbFace) - new_brush =wx.Brush(wx.Colour(r,g,b), wx.SOLID) - gc.SetBrush(new_brush) - else: - gc.SetBrush(wx.TRANSPARENT_BRUSH) - gc.DrawPolygon(points) - gc.unselect() - - def draw_rectangle(self, gc, rgbFace, x, y, width, height): - """ - Draw a rectangle at lower left x,y with width and height - If filled=True, fill the rectangle with the gc foreground - gc is a GraphicsContext instance - """ - # wxPython uses rectangle from TOP left! - gc.select() - assert gc.Ok(), "wxMemoryDC not OK to use" - if rgbFace is not None: - r,g,b = self._to_wx_rgb(rgbFace) - new_brush =wx.Brush(wx.Colour(r,g,b), wx.SOLID) - gc.SetBrush(new_brush) - else: - gc.SetBrush(wx.TRANSPARENT_BRUSH) - gc.DrawRectangle(int(x), self.height - int(height + y), - int(math.ceil(width)), int(math.ceil(height))) - gc.unselect() - - def draw_point(self, gc, x, y): - """ - Draw a single point at x,y - """ - gc.select() - assert gc.Ok(), "wxMemoryDC not OK to use" - gc.DrawPoint(int(x), self.height - int(y)) - gc.unselect() - def draw_text(self, gc, x, y, s, prop, angle, ismath): """ Render the matplotlib.text.Text instance @@ -371,21 +329,23 @@ if ismath: s = self.strip_math(s) DEBUG_MSG("draw_text()", 1, self) gc.select() - + self.handle_clip_rectangle(gc) + gfx_ctx = gc.gfx_ctx + font = self.get_wx_font(s, prop) - gc.SetFont(font) - assert gc.Ok(), "wxMemoryDC not OK to use" + color = gc.get_wxcolour(gc.get_rgb()) + gfx_ctx.SetFont(font, color) w, h, d = self.get_text_width_height_descent(s, prop, ismath) x = int(x) y = int(y-h) - if angle!=0: - try: gc.DrawRotatedText(s, x, y, angle) - except: - verbose.print_error(exception_to_str('WX rotated text failed')) + if angle == 0.0: + gfx_ctx.DrawText(s, x, y) else: - gc.DrawText(s, x, y) + angle = angle * (math.pi / 180.0) + gfx_ctx.DrawRotatedText(s, x, y, angle) + gc.unselect() def new_gc(self): @@ -395,7 +355,6 @@ DEBUG_MSG('new_gc()', 2, self) self.gc = GraphicsContextWx(self.bitmap, self) self.gc.select() - assert self.gc.Ok(), "wxMemoryDC not OK to use" self.gc.unselect() return self.gc @@ -446,14 +405,7 @@ return font - def _to_wx_rgb(self, rgb): - """Takes a colour value and returns a tuple (r,g,b) suitable - for instantiating a wx.Colour.""" - r, g, b = rgb - return (int(r * 255), int(g * 255), int(b * 255)) - - def points_to_pixels(self, points): """ convert point measures to pixes using dpi and the pixels per @@ -461,15 +413,15 @@ """ return points*(PIXELS_PER_INCH/72.0*self.dpi/72.0) -class GraphicsContextWx(GraphicsContextBase, wx.MemoryDC): +class GraphicsContextWx(GraphicsContextBase): """ The graphics context provides the color, line styles, etc... - In wxPython this is done by wrapping a wxDC object and forwarding the - appropriate calls to it. Notice also that colour and line styles are - mapped on the wx.Pen() member of the wxDC. This means that we have some - rudimentary pen management here. - + This class stores a reference to a wxMemoryDC, and a + wxGraphicsContext that draws to it. Creating a wxGraphicsContext + seems to be fairly heavy, so these objects are cached based on the + bitmap object that is passed in. + The base GraphicsContext stores colors as a RGB tuple on the unit interval, eg, (0.5, 0.0, 1.0). wxPython uses an int interval, but since wxPython colour management is rather simple, I have not chosen @@ -487,26 +439,30 @@ 'dashed': wx.SHORT_DASH, 'dashdot': wx.DOT_DASH, 'dotted': wx.DOT } - _lastWxDC = None - + _cache = weakref.WeakKeyDictionary() + def __init__(self, bitmap, renderer): GraphicsContextBase.__init__(self) - wx.MemoryDC.__init__(self) #assert self.Ok(), "wxMemoryDC not OK to use" DEBUG_MSG("__init__()", 1, self) - # Make sure (belt and braces!) that existing wxDC is not selected to - # to a bitmap. - if GraphicsContextWx._lastWxDC != None: - GraphicsContextWx._lastWxDC.SelectObject(wx.NullBitmap) - - self.SelectObject(bitmap) + dc, gfx_ctx = self._cache.get(bitmap, (None, None)) + if dc is None: + print "new dc" + dc = wx.MemoryDC() + dc.SelectObject(bitmap) + gfx_ctx = wx.GraphicsContext.Create(dc) + gfx_ctx._lastcliprect = None + self._cache[bitmap] = dc, gfx_ctx + self.bitmap = bitmap - self.SetPen(wx.Pen('BLACK', 1, wx.SOLID)) - self._style=wx.SOLID + self.dc = dc + self.gfx_ctx = gfx_ctx + self._pen = wx.Pen('BLACK', 1, wx.SOLID) + gfx_ctx.SetPen(self._pen) + self._style = wx.SOLID self.renderer = renderer - GraphicsContextWx._lastWxDC = self - + def select(self): """ Select the current bitmap into this wxDC instance @@ -524,23 +480,6 @@ self.SelectObject(wx.NullBitmap) self.IsSelected = False - def set_clip_rectangle(self, rect): - """ - Destroys previous clipping region and defines a new one. - """ - DEBUG_MSG("set_clip_rectangle()", 1, self) - self.select() - l,b,w,h = rect - # this appears to be version dependent' - if hasattr(self, 'SetClippingRegionXY'): - clipfunc = getattr(self, 'SetClippingRegionXY') - else: - clipfunc = getattr(self, 'SetClippingRegion') - - clipfunc(int(l), self.renderer.height - int(b+h), - int(w), int(h)) - self.unselect() - def set_foreground(self, fg, isRGB=None): """ Set the foreground color. fg can be a matlab format string, a @@ -556,12 +495,8 @@ self.select() GraphicsContextBase.set_foreground(self, fg, isRGB) - pen = self.GetPen() - pen.SetColour(self.get_wxcolour()) - self.SetPen(pen) - brush =wx.Brush(self.get_wxcolour(), wx.SOLID) - self.SetBrush(brush) - self.SetTextForeground(self.get_wxcolour()) + self._pen.SetColour(self.get_wxcolour(self.get_rgb())) + self.gfx_ctx.SetPen(self._pen) self.unselect() def set_graylevel(self, frac): @@ -573,11 +508,8 @@ DEBUG_MSG("set_graylevel()", 1, self) self.select() GraphicsContextBase.set_graylevel(self, frac) - pen = self.GetPen() - pen.SetColour(self.get_wxcolour()) - self.SetPen(pen) - brush =wx.Brush(self.get_wxcolour(), wx.SOLID) - self.SetBrush(brush) + self._pen.SetColour(self.get_wxcolour(self.get_rgb())) + self.gfx_ctx.SetPen(self._pen) self.unselect() def set_linewidth(self, w): @@ -588,11 +520,10 @@ self.select() if w>0 and w<1: w = 1 GraphicsContextBase.set_linewidth(self, w) - pen = self.GetPen() lw = int(self.renderer.points_to_pixels(self._linewidth)) if lw==0: lw = 1 - pen.SetWidth(lw) - self.SetPen(pen) + self._pen.SetWidth(lw) + self.gfx_ctx.SetPen(self._pen) self.unselect() def set_capstyle(self, cs): @@ -602,9 +533,8 @@ DEBUG_MSG("set_capstyle()", 1, self) self.select() GraphicsContextBase.set_capstyle(self, cs) - pen = self.GetPen() - pen.SetCap(GraphicsContextWx._capd[self._capstyle]) - self.SetPen(pen) + self._pen.SetCap(GraphicsContextWx._capd[self._capstyle]) + self.gfx_ctx.SetPen(self._pen) self.unselect() def set_joinstyle(self, js): @@ -614,9 +544,8 @@ DEBUG_MSG("set_joinstyle()", 1, self) self.select() GraphicsContextBase.set_joinstyle(self, js) - pen = self.GetPen() - pen.SetJoin(GraphicsContextWx._joind[self._joinstyle]) - self.SetPen(pen) + self._pen.SetJoin(GraphicsContextWx._joind[self._joinstyle]) + self.gfx_ctx.SetPen(self._pen) self.unselect() def set_linestyle(self, ls): @@ -629,25 +558,32 @@ try: self._style = GraphicsContextWx._dashd_wx[ls] except KeyError: - self._style=wx.LONG_DASH# Style not used elsewhere... + self._style = wx.LONG_DASH# Style not used elsewhere... # On MS Windows platform, only line width of 1 allowed for dash lines if wx.Platform == '__WXMSW__': self.set_linewidth(1) - pen = self.GetPen() - pen.SetStyle(self._style) - self.SetPen(pen) + self._pen.SetStyle(self._style) + self.gfx_ctx.SetPen(self._pen) self.unselect() - def get_wxcolour(self): + def get_wxcolour(self, color): """return a wx.Colour from RGB format""" DEBUG_MSG("get_wx_color()", 1, self) - r, g, b = self.get_rgb() - r *= 255 - g *= 255 - b *= 255 - return wx.Colour(red=int(r), green=int(g), blue=int(b)) + if len(color) == 3: + r, g, b = color + r *= 255 + g *= 255 + b *= 255 + return wx.Colour(red=int(r), green=int(g), blue=int(b)) + else: + r, g, b, a = color + r *= 255 + g *= 255 + b *= 255 + a *= 255 + return wx.Colour(red=int(r), green=int(g), blue=int(b), alpha=int(a)) class FigureCanvasWx(FigureCanvasBase, wx.Panel): """ @@ -783,7 +719,7 @@ self.macros = {} # dict from wx id to seq of macros self.Printer_Init() - + def Destroy(self, *args, **kwargs): wx.Panel.Destroy(self, *args, **kwargs) @@ -938,6 +874,9 @@ self.gui_repaint() + def draw_idle(self, *args, **kwargs): + pass + def draw(self, repaint=True): """ Render the figure using RendererWx instance renderer, or using a @@ -1016,7 +955,7 @@ def _print_image(self, filename, filetype, *args, **kwargs): origBitmap = self.bitmap - l,b,width,height = self.figure.bbox.get_bounds() + l,b,width,height = self.figure.bbox.bounds width = int(math.ceil(width)) height = int(math.ceil(height)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-09 16:34:08
|
Revision: 4184 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4184&view=rev Author: mdboom Date: 2007-11-09 08:33:58 -0800 (Fri, 09 Nov 2007) Log Message: ----------- Fix misaligned clipping rectangle. Modified Paths: -------------- branches/transforms/src/_backend_agg.cpp Modified: branches/transforms/src/_backend_agg.cpp =================================================================== --- branches/transforms/src/_backend_agg.cpp 2007-11-09 14:24:41 UTC (rev 4183) +++ branches/transforms/src/_backend_agg.cpp 2007-11-09 16:33:58 UTC (rev 4184) @@ -282,7 +282,7 @@ double l, b, r, t; if (py_convert_bbox(cliprect.ptr(), l, b, r, t)) { - rasterizer->clip_box((int)l, (int)b, (int)r, (int)t); + rasterizer->clip_box((int)l + 1, (int)b + 1, (int)r + 1, (int)t + 1); } _VERBOSE("RendererAgg::set_clipbox done"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 14:24:44
|
Revision: 4183 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4183&view=rev Author: dsdale Date: 2007-11-09 06:24:41 -0800 (Fri, 09 Nov 2007) Log Message: ----------- updated dependency report during build process Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/config/checkdep.py trunk/matplotlib/setup.py trunk/matplotlib/setupext.py Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2007-11-09 13:49:54 UTC (rev 4182) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2007-11-09 14:24:41 UTC (rev 4183) @@ -256,7 +256,7 @@ v = match.group(0) float(v) return v - except (IndexError, ValueError): + except (IndexError, ValueError, AttributeError): return None def checkdep_pdftops(): Modified: trunk/matplotlib/lib/matplotlib/config/checkdep.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/checkdep.py 2007-11-09 13:49:54 UTC (rev 4182) +++ trunk/matplotlib/lib/matplotlib/config/checkdep.py 2007-11-09 14:24:41 UTC (rev 4183) @@ -35,7 +35,7 @@ pattern = '3\.1\d+' match = re.search(pattern, line) return match.group(0) - except (IndexError, ValueError): + except (IndexError, ValueError, AttributeError): return None def pdftops(): Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2007-11-09 13:49:54 UTC (rev 4182) +++ trunk/matplotlib/setup.py 2007-11-09 14:24:41 UTC (rev 4183) @@ -83,7 +83,8 @@ print_raw, check_for_freetype, check_for_libpng, check_for_gtk, \ check_for_tk, check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, \ check_for_cairo, check_for_traits, check_for_pytz, check_for_dateutil, \ - check_for_configobj + check_for_configobj, check_for_dvipng, check_for_ghostscript, \ + check_for_latex, check_for_pdftops, check_for_datetime #import distutils.sysconfig # jdh @@ -184,55 +185,12 @@ build_contour(ext_modules, packages) build_nxutils(ext_modules, packages) -print_raw("") -print_raw("OPTIONAL DEPENDENCIES") - -try: import datetime -except ImportError: hasdatetime = False -else: hasdatetime = True - -if hasdatetime: # dates require python23 datetime - # only install pytz and dateutil if the user hasn't got them - def add_pytz(): - packages.append('pytz') - resources = ['zone.tab', 'locales/pytz.pot'] - # install pytz subdirs - for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz', - 'zoneinfo')): - if '.svn' not in dirpath: - # remove the 'lib/pytz' part of the path - basepath = dirpath.split(os.path.sep, 2)[2] - resources.extend([os.path.join(basepath, filename) - for filename in filenames]) - package_data['pytz'] = resources - assert len(resources) > 10, 'pytz zoneinfo files not found!' -# packages.append('/'.join(dirpath.split(os.sep)[1:])) - - def add_dateutil(): - packages.append('dateutil') - packages.append('dateutil/zoneinfo') - package_data['dateutil'] = ['zoneinfo/zoneinfo*.tar.*'] - - haspytz = check_for_pytz() - hasdateutil = check_for_dateutil() - - if sys.platform=='win32': - # always add these to the win32 installer - add_pytz() - add_dateutil() - else: - # only add them if we need them - if not haspytz: add_pytz() - if not hasdateutil: add_dateutil() - build_swigagg(ext_modules, packages) build_transforms(ext_modules, packages) -# for the traited config package: -if not check_for_configobj(): py_modules.append('configobj') +print_raw("") +print_raw("OPTIONAL BACKEND DEPENDENCIES") -if not check_for_traits(): build_traits(ext_modules, packages) - if check_for_gtk() and (BUILD_GTK or BUILD_GTKAGG): if BUILD_GTK: build_gdk(ext_modules, packages) @@ -279,6 +237,58 @@ mod.extra_compile_args.append('-DVERBOSE') print_raw("") +print_raw("OPTIONAL DATE/TIMEZONE DEPENDENCIES") + +hasdatetime = check_for_datetime() +hasdateutil = check_for_dateutil(hasdatetime) +haspytz = check_for_pytz(hasdatetime) + +if hasdatetime: # dates require python23 datetime + # only install pytz and dateutil if the user hasn't got them + + def add_pytz(): + packages.append('pytz') + resources = ['zone.tab', 'locales/pytz.pot'] + # install pytz subdirs + for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz', + 'zoneinfo')): + if '.svn' not in dirpath: + # remove the 'lib/pytz' part of the path + basepath = dirpath.split(os.path.sep, 2)[2] + resources.extend([os.path.join(basepath, filename) + for filename in filenames]) + package_data['pytz'] = resources + assert len(resources) > 10, 'pytz zoneinfo files not found!' +# packages.append('/'.join(dirpath.split(os.sep)[1:])) + + def add_dateutil(): + packages.append('dateutil') + packages.append('dateutil/zoneinfo') + package_data['dateutil'] = ['zoneinfo/zoneinfo*.tar.*'] + + if sys.platform=='win32': + # always add these to the win32 installer + add_pytz() + add_dateutil() + else: + # only add them if we need them + if not haspytz: add_pytz() + if not hasdateutil: add_dateutil() + +print_raw("") +print_raw("OPTIONAL USETEX DEPENDENCIES") +check_for_dvipng() +check_for_ghostscript() +check_for_latex() +check_for_pdftops() + +# TODO: comment out for mpl release: +print_raw("") +print_raw("EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES") +if not check_for_configobj(): py_modules.append('configobj') +if not check_for_traits(): build_traits(ext_modules, packages) + +print_raw("") print_raw("[Edit setup.cfg to suppress the above messages]") print_line() Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2007-11-09 13:49:54 UTC (rev 4182) +++ trunk/matplotlib/setupext.py 2007-11-09 14:24:41 UTC (rev 4183) @@ -42,6 +42,7 @@ """ import os +import re basedir = { @@ -325,21 +326,33 @@ print_status("Cairo", cairo.version) return True -def check_for_pytz(): +def check_for_datetime(): try: + import datetime + except ImportError: + print_status("datetime", "no") + return False + else: + print_status("datetime", "present, version unknown") + return True + +def check_for_pytz(hasdatetime=True): + try: import pytz except ImportError: - print_status("pytz", "mpl-provided") + if hasdatetime: print_status("pytz", "mpl-provided") + else: print_status("pytz", "no") return False else: print_status("pytz", pytz.__version__) return True -def check_for_dateutil(): +def check_for_dateutil(hasdatetime=True): try: import dateutil except ImportError: - print_status("dateutil", "mpl-provided") + if hasdatetime: print_status("dateutil", "mpl-provided") + else: print_status("dateutil", "no") return False else: try: @@ -375,6 +388,51 @@ print_status("enthought.traits", "no") return gotit +def check_for_dvipng(): + try: + stdin, stdout = os.popen4('dvipng -version') + print_status("dvipng", stdout.readlines()[1].split()[-1]) + return True + except (IndexError, ValueError): + print_status("dvipng", "no") + return False + +def check_for_ghostscript(): + try: + if sys.platform == 'win32': + command = 'gswin32c --version' + else: + command = 'gs --version' + stdin, stdout = os.popen4(command) + print_status("ghostscript", stdout.read()[:-1]) + return True + except (IndexError, ValueError): + print_status("ghostscript", "no") + return False + +def check_for_latex(): + try: + stdin, stdout = os.popen4('latex -version') + line = stdout.readlines()[0] + pattern = '3\.1\d+' + match = re.search(pattern, line) + print_status("latex", match.group(0)) + return True + except (IndexError, ValueError, AttributeError): + print_status("latex", "no") + return False + +def check_for_pdftops(): + try: + stdin, stdout = os.popen4('pdftops -v') + for line in stdout.readlines(): + if 'version' in line: + print_status("pdftops", line.split()[-1]) + return True + except (IndexError, ValueError): + print_status("pdftops", "no") + return False + def check_for_numpy(): gotit = False try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 13:49:55
|
Revision: 4182 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4182&view=rev Author: dsdale Date: 2007-11-09 05:49:54 -0800 (Fri, 09 Nov 2007) Log Message: ----------- updated CHANGELOG and API_CHANGES Modified Paths: -------------- trunk/matplotlib/API_CHANGES trunk/matplotlib/CHANGELOG Modified: trunk/matplotlib/API_CHANGES =================================================================== --- trunk/matplotlib/API_CHANGES 2007-11-09 13:47:40 UTC (rev 4181) +++ trunk/matplotlib/API_CHANGES 2007-11-09 13:49:54 UTC (rev 4182) @@ -1,7 +1,3 @@ - Removed matplotlib.pyparsing. We now use the system's pyparsing - if it is available, and if not, we install pyparsing directly into - site-packages - Moved mlab.csv2rec -> recutils.csv2rec Added ax kwarg to pyplot.colorbar and Figure.colorbar so that Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-09 13:47:40 UTC (rev 4181) +++ trunk/matplotlib/CHANGELOG 2007-11-09 13:49:54 UTC (rev 4182) @@ -2,7 +2,7 @@ paintEvent, which has to be destroyed using the method end(). If matplotlib raises an exception before the call to end - and it does if you feed it with bad data - this method end() is never - called and Qt4 will start spitting error messages - DSD + called and Qt4 will start spitting error messages 2007-11-09 Moved pyparsing back into matplotlib namespace. Don't use system pyparsing, API is too variable from one release This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-09 13:47:44
|
Revision: 4181 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4181&view=rev Author: mdboom Date: 2007-11-09 05:47:40 -0800 (Fri, 09 Nov 2007) Log Message: ----------- Remove duplicate line caused by myself and Darren committing the same patch and virtually the same time. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2007-11-09 13:20:10 UTC (rev 4180) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2007-11-09 13:47:40 UTC (rev 4181) @@ -114,7 +114,6 @@ reg = self.copy_from_bbox(bbox) stringBuffer = reg.to_string() qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32) - p = QtGui.QPainter(self) pixmap = QtGui.QPixmap.fromImage(qImage) p = QtGui.QPainter( self ) p.drawPixmap(QtCore.QPoint(l, self.renderer.height-t), pixmap) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 13:20:12
|
Revision: 4180 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4180&view=rev Author: dsdale Date: 2007-11-09 05:20:10 -0800 (Fri, 09 Nov 2007) Log Message: ----------- committed Martin Teichmann's patch 1828813 to fix qt4 error messages related to QPainter Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-09 13:19:38 UTC (rev 4179) +++ trunk/matplotlib/CHANGELOG 2007-11-09 13:20:10 UTC (rev 4180) @@ -1,3 +1,9 @@ +2007-11-09 Applied Martin Teichmann's patch 1828813: a QPainter is used in + paintEvent, which has to be destroyed using the method end(). If + matplotlib raises an exception before the call to end - and it + does if you feed it with bad data - this method end() is never + called and Qt4 will start spitting error messages - DSD + 2007-11-09 Moved pyparsing back into matplotlib namespace. Don't use system pyparsing, API is too variable from one release to the next - DSD Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2007-11-09 13:19:38 UTC (rev 4179) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2007-11-09 13:20:10 UTC (rev 4180) @@ -116,6 +116,7 @@ qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32) p = QtGui.QPainter(self) pixmap = QtGui.QPixmap.fromImage(qImage) + p = QtGui.QPainter( self ) p.drawPixmap(QtCore.QPoint(l, self.renderer.height-t), pixmap) p.end() self.replot = False This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-09 13:19:40
|
Revision: 4179 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4179&view=rev Author: mdboom Date: 2007-11-09 05:19:38 -0800 (Fri, 09 Nov 2007) Log Message: ----------- Fix font caching bug on OSX Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/font_manager.py Modified: trunk/matplotlib/lib/matplotlib/font_manager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/font_manager.py 2007-11-09 13:10:12 UTC (rev 4178) +++ trunk/matplotlib/lib/matplotlib/font_manager.py 2007-11-09 13:19:38 UTC (rev 4179) @@ -172,7 +172,7 @@ pass return fontpaths -def OSXInstalledFonts(directory=None, fontext=None): +def OSXInstalledFonts(directory=None, fontext='ttf'): """Get list of font files on OS X - ignores font suffix by default""" if directory is None: directory = OSXFontDirectory() @@ -251,7 +251,7 @@ fontpaths = x11FontDirectory() # check for OS X & load its fonts if present if sys.platform == 'darwin': - for f in OSXInstalledFonts(): + for f in OSXInstalledFonts(fontext=fontext): fontfiles[f] = 1 for f in get_fontconfig_fonts(fontext): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-09 13:10:14
|
Revision: 4178 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4178&view=rev Author: mdboom Date: 2007-11-09 05:10:12 -0800 (Fri, 09 Nov 2007) Log Message: ----------- Avoid annoying Qt4 messages when mpl raises an exception. (Thanks to Martin Teichmann in patch 1828813) Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2007-11-09 13:08:48 UTC (rev 4177) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2007-11-09 13:10:12 UTC (rev 4178) @@ -80,8 +80,6 @@ if DEBUG: print 'FigureCanvasQtAgg.paintEvent: ', self, \ self.get_width_height() - p = QtGui.QPainter( self ) - # only replot data when needed if type(self.replot) is bool: # might be a bbox for blitting if self.replot: @@ -99,6 +97,7 @@ qImage = QtGui.QImage(stringBuffer, self.renderer.width, self.renderer.height, QtGui.QImage.Format_ARGB32) + p = QtGui.QPainter(self) p.drawPixmap(QtCore.QPoint(0, 0), QtGui.QPixmap.fromImage(qImage)) # draw the zoom rectangle to the QPainter @@ -106,6 +105,7 @@ p.setPen( QtGui.QPen( QtCore.Qt.black, 1, QtCore.Qt.DotLine ) ) p.drawRect( self.rect[0], self.rect[1], self.rect[2], self.rect[3] ) + p.end() # we are blitting here else: bbox = self.replot @@ -114,10 +114,10 @@ reg = self.copy_from_bbox(bbox) stringBuffer = reg.to_string() qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32) + p = QtGui.QPainter(self) pixmap = QtGui.QPixmap.fromImage(qImage) p.drawPixmap(QtCore.QPoint(l, self.renderer.height-t), pixmap) - - p.end() + p.end() self.replot = False self.drawRect = False This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 13:08:49
|
Revision: 4177 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4177&view=rev Author: dsdale Date: 2007-11-09 05:08:48 -0800 (Fri, 09 Nov 2007) Log Message: ----------- move pyparsing back into mpl namespace Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py trunk/matplotlib/lib/matplotlib/mathtext.py trunk/matplotlib/setup.py trunk/matplotlib/setupext.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/pyparsing.py Removed Paths: ------------- trunk/matplotlib/lib/pyparsing.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-09 07:25:08 UTC (rev 4176) +++ trunk/matplotlib/CHANGELOG 2007-11-09 13:08:48 UTC (rev 4177) @@ -1,3 +1,7 @@ +2007-11-09 Moved pyparsing back into matplotlib namespace. Don't use + system pyparsing, API is too variable from one release + to the next - DSD + 2007-11-08 Made pylab use straight numpy instead of oldnumeric by default - EF Modified: trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py =================================================================== --- trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py 2007-11-09 07:25:08 UTC (rev 4176) +++ trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py 2007-11-09 13:08:48 UTC (rev 4177) @@ -18,7 +18,7 @@ License : matplotlib license (PSF compatible) """ import re -from pyparsing import Literal, OneOrMore, ZeroOrMore, Optional, Regex, \ +from matplotlib.pyparsing import Literal, OneOrMore, ZeroOrMore, Optional, Regex, \ StringEnd, ParseException, Suppress family_punc = r'\\\-:,' Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-09 07:25:08 UTC (rev 4176) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-09 13:08:48 UTC (rev 4177) @@ -134,7 +134,7 @@ from numpy import inf, isinf from matplotlib import verbose -from pyparsing import Literal, Word, OneOrMore, ZeroOrMore, Combine, Group, \ +from matplotlib.pyparsing import Literal, Word, OneOrMore, ZeroOrMore, Combine, Group, \ Optional, Forward, NotAny, alphas, nums, alphanums, StringStart, \ StringEnd, ParseFatalException, FollowedBy, Regex, operatorPrecedence, \ opAssoc, ParseResults, Or, Suppress, oneOf, ParseException, MatchFirst, \ Copied: trunk/matplotlib/lib/matplotlib/pyparsing.py (from rev 4176, trunk/matplotlib/lib/pyparsing.py) =================================================================== --- trunk/matplotlib/lib/matplotlib/pyparsing.py (rev 0) +++ trunk/matplotlib/lib/matplotlib/pyparsing.py 2007-11-09 13:08:48 UTC (rev 4177) @@ -0,0 +1,3217 @@ +# module pyparsing.py +# +# Copyright (c) 2003-2007 Paul T. McGuire +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +#from __future__ import generators + +__doc__ = \ +""" +pyparsing module - Classes and methods to define and execute parsing grammars + +The pyparsing module is an alternative approach to creating and executing simple grammars, +vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you +don't need to learn a new syntax for defining grammars or matching expressions - the parsing module +provides a library of classes that you use to construct the grammar directly in Python. + +Here is a program to parse "Hello, World!" (or any greeting of the form "<salutation>, <addressee>!"):: + + from pyparsing import Word, alphas + + # define grammar of a greeting + greet = Word( alphas ) + "," + Word( alphas ) + "!" + + hello = "Hello, World!" + print hello, "->", greet.parseString( hello ) + +The program outputs the following:: + + Hello, World! -> ['Hello', ',', 'World', '!'] + +The Python representation of the grammar is quite readable, owing to the self-explanatory +class names, and the use of '+', '|' and '^' operators. + +The parsed results returned from parseString() can be accessed as a nested list, a dictionary, or an +object with named attributes. + +The pyparsing module handles some of the problems that are typically vexing when writing text parsers: + - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) + - quoted strings + - embedded comments +""" + +__version__ = "1.4.8" +__versionTime__ = "7 October 2007 00:25" +__author__ = "Paul McGuire <pt...@us...>" + +import string +from weakref import ref as wkref +import copy,sys +import warnings +import re +import sre_constants +import xml.sax.saxutils +#~ sys.stderr.write( "testing pyparsing module, version %s, %s\n" % (__version__,__versionTime__ ) ) + +def _ustr(obj): + """Drop-in replacement for str(obj) that tries to be Unicode friendly. It first tries + str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It + then < returns the unicode object | encodes it with the default encoding | ... >. + """ + try: + # If this works, then _ustr(obj) has the same behaviour as str(obj), so + # it won't break any existing code. + return str(obj) + + except UnicodeEncodeError, e: + # The Python docs (http://docs.python.org/ref/customization.html#l2h-182) + # state that "The return value must be a string object". However, does a + # unicode object (being a subclass of basestring) count as a "string + # object"? + # If so, then return a unicode object: + return unicode(obj) + # Else encode it... but how? There are many choices... :) + # Replace unprintables with escape codes? + #return unicode(obj).encode(sys.getdefaultencoding(), 'backslashreplace_errors') + # Replace unprintables with question marks? + #return unicode(obj).encode(sys.getdefaultencoding(), 'replace') + # ... + +def _str2dict(strg): + return dict( [(c,0) for c in strg] ) + #~ return set( [c for c in strg] ) + +class _Constants(object): + pass + +alphas = string.lowercase + string.uppercase +nums = string.digits +hexnums = nums + "ABCDEFabcdef" +alphanums = alphas + nums + +class ParseBaseException(Exception): + """base exception class for all parsing runtime exceptions""" + __slots__ = ( "loc","msg","pstr","parserElement" ) + # Performance tuning: we construct a *lot* of these, so keep this + # constructor as small and fast as possible + def __init__( self, pstr, loc=0, msg=None, elem=None ): + self.loc = loc + if msg is None: + self.msg = pstr + self.pstr = "" + else: + self.msg = msg + self.pstr = pstr + self.parserElement = elem + + def __getattr__( self, aname ): + """supported attributes by name are: + - lineno - returns the line number of the exception text + - col - returns the column number of the exception text + - line - returns the line containing the exception text + """ + if( aname == "lineno" ): + return lineno( self.loc, self.pstr ) + elif( aname in ("col", "column") ): + return col( self.loc, self.pstr ) + elif( aname == "line" ): + return line( self.loc, self.pstr ) + else: + raise AttributeError, aname + + def __str__( self ): + return "%s (at char %d), (line:%d, col:%d)" % \ + ( self.msg, self.loc, self.lineno, self.column ) + def __repr__( self ): + return _ustr(self) + def markInputline( self, markerString = ">!<" ): + """Extracts the exception line from the input string, and marks + the location of the exception with a special symbol. + """ + line_str = self.line + line_column = self.column - 1 + if markerString: + line_str = "".join( [line_str[:line_column], + markerString, line_str[line_column:]]) + return line_str.strip() + +class ParseException(ParseBaseException): + """exception thrown when parse expressions don't match class; + supported attributes by name are: + - lineno - returns the line number of the exception text + - col - returns the column number of the exception text + - line - returns the line containing the exception text + """ + pass + +class ParseFatalException(ParseBaseException): + """user-throwable exception thrown when inconsistent parse content + is found; stops all parsing immediately""" + pass + +#~ class ReparseException(ParseBaseException): + #~ """Experimental class - parse actions can raise this exception to cause + #~ pyparsing to reparse the input string: + #~ - with a modified input string, and/or + #~ - with a modified start location + #~ Set the values of the ReparseException in the constructor, and raise the + #~ exception in a parse action to cause pyparsing to use the new string/location. + #~ Setting the values as None causes no change to be made. + #~ """ + #~ def __init_( self, newstring, restartLoc ): + #~ self.newParseText = newstring + #~ self.reparseLoc = restartLoc + +class RecursiveGrammarException(Exception): + """exception thrown by validate() if the grammar could be improperly recursive""" + def __init__( self, parseElementList ): + self.parseElementTrace = parseElementList + + def __str__( self ): + return "RecursiveGrammarException: %s" % self.parseElementTrace + +class _ParseResultsWithOffset(object): + def __init__(self,p1,p2): + self.tup = (p1,p2) + def __getitem__(self,i): + return self.tup[i] + def __repr__(self): + return repr(self.tup) + +class ParseResults(object): + """Structured parse results, to provide multiple means of access to the parsed data: + - as a list (len(results)) + - by list index (results[0], results[1], etc.) + - by attribute (results.<resultsName>) + """ + __slots__ = ( "__toklist", "__tokdict", "__doinit", "__name", "__parent", "__accumNames", "__weakref__" ) + def __new__(cls, toklist, name=None, asList=True, modal=True ): + if isinstance(toklist, cls): + return toklist + retobj = object.__new__(cls) + retobj.__doinit = True + return retobj + + # Performance tuning: we construct a *lot* of these, so keep this + # constructor as small and fast as possible + def __init__( self, toklist, name=None, asList=True, modal=True ): + if self.__doinit: + self.__doinit = False + self.__name = None + self.__parent = None + self.__accumNames = {} + if isinstance(toklist, list): + self.__toklist = toklist[:] + else: + self.__toklist = [toklist] + self.__tokdict = dict() + + # this line is related to debugging the asXML bug + #~ asList = False + + if name: + if not modal: + self.__accumNames[name] = 0 + if isinstance(name,int): + name = _ustr(name) # will always return a str, but use _ustr for consistency + self.__name = name + if not toklist in (None,'',[]): + if isinstance(toklist,basestring): + toklist = [ toklist ] + if asList: + if isinstance(toklist,ParseResults): + self[name] = _ParseResultsWithOffset(toklist.copy(),-1) + else: + self[name] = _ParseResultsWithOffset(ParseResults(toklist[0]),-1) + self[name].__name = name + else: + try: + self[name] = toklist[0] + except (KeyError,TypeError): + self[name] = toklist + + def __getitem__( self, i ): + if isinstance( i, (int,slice) ): + return self.__toklist[i] + else: + if i not in self.__accumNames: + return self.__tokdict[i][-1][0] + else: + return ParseResults([ v[0] for v in self.__tokdict[i] ]) + + def __setitem__( self, k, v ): + if isinstance(v,_ParseResultsWithOffset): + self.__tokdict[k] = self.__tokdict.get(k,list()) + [v] + sub = v[0] + elif isinstance(k,int): + self.__toklist[k] = v + sub = v + else: + self.__tokdict[k] = self.__tokdict.get(k,list()) + [(v,0)] + sub = v + if isinstance(sub,ParseResults): + sub.__parent = wkref(self) + + def __delitem__( self, i ): + if isinstance(i,(int,slice)): + del self.__toklist[i] + else: + del self.__tokdict[i] + + def __contains__( self, k ): + return self.__tokdict.has_key(k) + + def __len__( self ): return len( self.__toklist ) + def __bool__(self): return len( self.__toklist ) > 0 + def __nonzero__( self ): return self.__bool__() + def __iter__( self ): return iter( self.__toklist ) + def keys( self ): + """Returns all named result keys.""" + return self.__tokdict.keys() + + def items( self ): + """Returns all named result keys and values as a list of tuples.""" + return [(k,self[k]) for k in self.__tokdict.keys()] + + def values( self ): + """Returns all named result values.""" + return [ v[-1][0] for v in self.__tokdict.values() ] + + def __getattr__( self, name ): + if name not in self.__slots__: + if self.__tokdict.has_key( name ): + if name not in self.__accumNames: + return self.__tokdict[name][-1][0] + else: + return ParseResults([ v[0] for v in self.__tokdict[name] ]) + else: + return "" + return None + + def __add__( self, other ): + ret = self.copy() + ret += other + return ret + + def __iadd__( self, other ): + if other.__tokdict: + offset = len(self.__toklist) + addoffset = ( lambda a: (a<0 and offset) or (a+offset) ) + otheritems = other.__tokdict.items() + otherdictitems = [(k, _ParseResultsWithOffset(v[0],addoffset(v[1])) ) + for (k,vlist) in otheritems for v in vlist] + for k,v in otherdictitems: + self[k] = v + if isinstance(v[0],ParseResults): + v[0].__parent = wkref(self) + self.__toklist += other.__toklist + self.__accumNames.update( other.__accumNames ) + del other + return self + + def __repr__( self ): + return "(%s, %s)" % ( repr( self.__toklist ), repr( self.__tokdict ) ) + + def __str__( self ): + out = "[" + sep = "" + for i in self.__toklist: + if isinstance(i, ParseResults): + out += sep + _ustr(i) + else: + out += sep + repr(i) + sep = ", " + out += "]" + return out + + def _asStringList( self, sep='' ): + out = [] + for item in self.__toklist: + if out and sep: + out.append(sep) + if isinstance( item, ParseResults ): + out += item._asStringList() + else: + out.append( _ustr(item) ) + return out + + def asList( self ): + """Returns the parse results as a nested list of matching tokens, all converted to strings.""" + out = [] + for res in self.__toklist: + if isinstance(res,ParseResults): + out.append( res.asList() ) + else: + out.append( res ) + return out + + def asDict( self ): + """Returns the named parse results as dictionary.""" + return dict( self.items() ) + + def copy( self ): + """Returns a new copy of a ParseResults object.""" + ret = ParseResults( self.__toklist ) + ret.__tokdict = self.__tokdict.copy() + ret.__parent = self.__parent + ret.__accumNames.update( self.__accumNames ) + ret.__name = self.__name + return ret + + def asXML( self, doctag=None, namedItemsOnly=False, indent="", formatted=True ): + """Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.""" + nl = "\n" + out = [] + namedItems = dict( [ (v[1],k) for (k,vlist) in self.__tokdict.items() + for v in vlist ] ) + nextLevelIndent = indent + " " + + # collapse out indents if formatting is not desired + if not formatted: + indent = "" + nextLevelIndent = "" + nl = "" + + selfTag = None + if doctag is not None: + selfTag = doctag + else: + if self.__name: + selfTag = self.__name + + if not selfTag: + if namedItemsOnly: + return "" + else: + selfTag = "ITEM" + + out += [ nl, indent, "<", selfTag, ">" ] + + worklist = self.__toklist + for i,res in enumerate(worklist): + if isinstance(res,ParseResults): + if i in namedItems: + out += [ res.asXML(namedItems[i], + namedItemsOnly and doctag is None, + nextLevelIndent, + formatted)] + else: + out += [ res.asXML(None, + namedItemsOnly and doctag is None, + nextLevelIndent, + formatted)] + else: + # individual token, see if there is a name for it + resTag = None + if i in namedItems: + resTag = namedItems[i] + if not resTag: + if namedItemsOnly: + continue + else: + resTag = "ITEM" + xmlBodyText = xml.sax.saxutils.escape(_ustr(res)) + out += [ nl, nextLevelIndent, "<", resTag, ">", + xmlBodyText, + "</", resTag, ">" ] + + out += [ nl, indent, "</", selfTag, ">" ] + return "".join(out) + + def __lookup(self,sub): + for k,vlist in self.__tokdict.items(): + for v,loc in vlist: + if sub is v: + return k + return None + + def getName(self): + """Returns the results name for this token expression.""" + if self.__name: + return self.__name + elif self.__parent: + par = self.__parent() + if par: + return par.__lookup(self) + else: + return None + elif (len(self) == 1 and + len(self.__tokdict) == 1 and + self.__tokdict.values()[0][0][1] in (0,-1)): + return self.__tokdict.keys()[0] + else: + return None + + def dump(self,indent='',depth=0): + """Diagnostic method for listing out the contents of a ParseResults. + Accepts an optional indent argument so that this string can be embedded + in a nested display of other data.""" + out = [] + out.append( indent+_ustr(self.asList()) ) + keys = self.items() + keys.sort() + for k,v in keys: + if out: + out.append('\n') + out.append( "%s%s- %s: " % (indent,(' '*depth), k) ) + if isinstance(v,ParseResults): + if v.keys(): + #~ out.append('\n') + out.append( v.dump(indent,depth+1) ) + #~ out.append('\n') + else: + out.append(_ustr(v)) + else: + out.append(_ustr(v)) + #~ out.append('\n') + return "".join(out) + + # add support for pickle protocol + def __getstate__(self): + return ( self.__toklist, + ( self.__tokdict.copy(), + self.__parent is not None and self.__parent() or None, + self.__accumNames, + self.__name ) ) + + def __setstate__(self,state): + self.__toklist = state[0] + self.__tokdict, \ + par, \ + inAccumNames, \ + self.__name = state[1] + self.__accumNames = {} + self.__accumNames.update(inAccumNames) + if par is not None: + self.__parent = wkref(par) + else: + self.__parent = None + + +def col (loc,strg): + """Returns current column within a string, counting newlines as line separators. + The first column is number 1. + + Note: the default parsing behavior is to expand tabs in the input string + before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information + on parsing strings containing <TAB>s, and suggested methods to maintain a + consistent view of the parsed string, the parse location, and line and column + positions within the parsed string. + """ + return (loc<len(strg) and strg[loc] == '\n') and 1 or loc - strg.rfind("\n", 0, loc) + +def lineno(loc,strg): + """Returns current line number within a string, counting newlines as line separators. + The first line is number 1. + + Note: the default parsing behavior is to expand tabs in the input string + before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information + on parsing strings containing <TAB>s, and suggested methods to maintain a + consistent view of the parsed string, the parse location, and line and column + positions within the parsed string. + """ + return strg.count("\n",0,loc) + 1 + +def line( loc, strg ): + """Returns the line of text containing loc within a string, counting newlines as line separators. + """ + lastCR = strg.rfind("\n", 0, loc) + nextCR = strg.find("\n", loc) + if nextCR > 0: + return strg[lastCR+1:nextCR] + else: + return strg[lastCR+1:] + +def _defaultStartDebugAction( instring, loc, expr ): + print "Match",_ustr(expr),"at loc",loc,"(%d,%d)" % ( lineno(loc,instring), col(loc,instring) ) + +def _defaultSuccessDebugAction( instring, startloc, endloc, expr, toks ): + print "Matched",_ustr(expr),"->",toks.asList() + +def _defaultExceptionDebugAction( instring, loc, expr, exc ): + print "Exception raised:", _ustr(exc) + +def nullDebugAction(*args): + """'Do-nothing' debug action, to suppress debugging output during parsing.""" + pass + +class ParserElement(object): + """Abstract base level parser element class.""" + DEFAULT_WHITE_CHARS = " \n\t\r" + + def setDefaultWhitespaceChars( chars ): + """Overrides the default whitespace chars + """ + ParserElement.DEFAULT_WHITE_CHARS = chars + setDefaultWhitespaceChars = staticmethod(setDefaultWhitespaceChars) + + def __init__( self, savelist=False ): + self.parseAction = list() + self.failAction = None + #~ self.name = "<unknown>" # don't define self.name, let subclasses try/except upcall + self.strRepr = None + self.resultsName = None + self.saveAsList = savelist + self.skipWhitespace = True + self.whiteChars = ParserElement.DEFAULT_WHITE_CHARS + self.copyDefaultWhiteChars = True + self.mayReturnEmpty = False # used when checking for left-recursion + self.keepTabs = False + self.ignoreExprs = list() + self.debug = False + self.streamlined = False + self.mayIndexError = True # used to optimize exception handling for subclasses that don't advance parse index + self.errmsg = "" + self.modalResults = True # used to mark results names as modal (report only last) or cumulative (list all) + self.debugActions = ( None, None, None ) #custom debug actions + self.re = None + self.callPreparse = True # used to avoid redundant calls to preParse + self.callDuringTry = False + + def copy( self ): + """Make a copy of this ParserElement. Useful for defining different parse actions + for the same parsing pattern, using copies of the original parse element.""" + cpy = copy.copy( self ) + cpy.parseAction = self.parseAction[:] + cpy.ignoreExprs = self.ignoreExprs[:] + if self.copyDefaultWhiteChars: + cpy.whiteChars = ParserElement.DEFAULT_WHITE_CHARS + return cpy + + def setName( self, name ): + """Define name for this expression, for use in debugging.""" + self.name = name + self.errmsg = "Expected " + self.name + if hasattr(self,"exception"): + self.exception.msg = self.errmsg + return self + + def setResultsName( self, name, listAllMatches=False ): + """Define name for referencing matching tokens as a nested attribute + of the returned parse results. + NOTE: this returns a *copy* of the original ParserElement object; + this is so that the client can define a basic element, such as an + integer, and reference it in multiple places with different names. + """ + newself = self.copy() + newself.resultsName = name + newself.modalResults = not listAllMatches + return newself + + def setBreak(self,breakFlag = True): + """Method to invoke the Python pdb debugger when this element is + about to be parsed. Set breakFlag to True to enable, False to + disable. + """ + if breakFlag: + _parseMethod = self._parse + def breaker(instring, loc, doActions=True, callPreParse=True): + import pdb + pdb.set_trace() + _parseMethod( instring, loc, doActions, callPreParse ) + breaker._originalParseMethod = _parseMethod + self._parse = breaker + else: + if hasattr(self._parse,"_originalParseMethod"): + self._parse = self._parse._originalParseMethod + return self + + def normalizeParseActionArgs( f ): + """Internal method used to decorate parse actions that take fewer than 3 arguments, + so that all parse actions can be called as f(s,l,t).""" + STAR_ARGS = 4 + + try: + restore = None + if isinstance(f,type): + restore = f + f = f.__init__ + if f.func_code.co_flags & STAR_ARGS: + return f + numargs = f.func_code.co_argcount + if hasattr(f,"im_self"): + numargs -= 1 + if restore: + f = restore + except AttributeError: + try: + # not a function, must be a callable object, get info from the + # im_func binding of its bound __call__ method + if f.__call__.im_func.func_code.co_flags & STAR_ARGS: + return f + numargs = f.__call__.im_func.func_code.co_argcount + if hasattr(f.__call__,"im_self"): + numargs -= 1 + except AttributeError: + # not a bound method, get info directly from __call__ method + if f.__call__.func_code.co_flags & STAR_ARGS: + return f + numargs = f.__call__.func_code.co_argcount + if hasattr(f.__call__,"im_self"): + numargs -= 1 + + #~ print "adding function %s with %d args" % (f.func_name,numargs) + if numargs == 3: + return f + else: + if numargs == 2: + def tmp(s,l,t): + return f(l,t) + elif numargs == 1: + def tmp(s,l,t): + return f(t) + else: #~ numargs == 0: + def tmp(s,l,t): + return f() + try: + tmp.__name__ = f.__name__ + except AttributeError: + # no need for special handling if attribute doesnt exist + pass + try: + tmp.__doc__ = f.__doc__ + except AttributeError: + # no need for special handling if attribute doesnt exist + pass + try: + tmp.__dict__.update(f.__dict__) + except AttributeError: + # no need for special handling if attribute doesnt exist + pass + return tmp + normalizeParseActionArgs = staticmethod(normalizeParseActionArgs) + + def setParseAction( self, *fns, **kwargs ): + """Define action to perform when successfully matching parse element definition. + Parse action fn is a callable method with 0-3 arguments, called as fn(s,loc,toks), + fn(loc,toks), fn(toks), or just fn(), where: + - s = the original string being parsed (see note below) + - loc = the location of the matching substring + - toks = a list of the matched tokens, packaged as a ParseResults object + If the functions in fns modify the tokens, they can return them as the return + value from fn, and the modified list of tokens will replace the original. + Otherwise, fn does not need to return any value. + + Note: the default parsing behavior is to expand tabs in the input string + before starting the parsing process. See L{I{parseString}<parseString>} for more information + on parsing strings containing <TAB>s, and suggested methods to maintain a + consistent view of the parsed string, the parse location, and line and column + positions within the parsed string. + """ + self.parseAction = map(self.normalizeParseActionArgs, list(fns)) + self.callDuringTry = ("callDuringTry" in kwargs and kwargs["callDuringTry"]) + return self + + def addParseAction( self, *fns, **kwargs ): + """Add parse action to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}.""" + self.parseAction += map(self.normalizeParseActionArgs, list(fns)) + self.callDuringTry = self.callDuringTry or ("callDuringTry" in kwargs and kwargs["callDuringTry"]) + return self + + def setFailAction( self, fn ): + """Define action to perform if parsing fails at this expression. + Fail acton fn is a callable function that takes the arguments + fn(s,loc,expr,err) where: + - s = string being parsed + - loc = location where expression match was attempted and failed + - expr = the parse expression that failed + - err = the exception thrown + The function returns no value. It may throw ParseFatalException + if it is desired to stop parsing immediately.""" + self.failAction = fn + return self + + def skipIgnorables( self, instring, loc ): + exprsFound = True + while exprsFound: + exprsFound = False + for e in self.ignoreExprs: + try: + while 1: + loc,dummy = e._parse( instring, loc ) + exprsFound = True + except ParseException: + pass + return loc + + def preParse( self, instring, loc ): + if self.ignoreExprs: + loc = self.skipIgnorables( instring, loc ) + + if self.skipWhitespace: + wt = self.whiteChars + instrlen = len(instring) + while loc < instrlen and instring[loc] in wt: + loc += 1 + + return loc + + def parseImpl( self, instring, loc, doActions=True ): + return loc, [] + + def postParse( self, instring, loc, tokenlist ): + return tokenlist + + #~ @profile + def _parseNoCache( self, instring, loc, doActions=True, callPreParse=True ): + debugging = ( self.debug ) #and doActions ) + + if debugging or self.failAction: + #~ print "Match",self,"at loc",loc,"(%d,%d)" % ( lineno(loc,instring), col(loc,instring) ) + if (self.debugActions[0] ): + self.debugActions[0]( instring, loc, self ) + if callPreParse and self.callPreparse: + preloc = self.preParse( instring, loc ) + else: + preloc = loc + tokensStart = loc + try: + try: + loc,tokens = self.parseImpl( instring, preloc, doActions ) + except IndexError: + raise ParseException( instring, len(instring), self.errmsg, self ) + except ParseException, err: + #~ print "Exception raised:", err + if self.debugActions[2]: + self.debugActions[2]( instring, tokensStart, self, err ) + if self.failAction: + self.failAction( instring, tokensStart, self, err ) + raise + else: + if callPreParse and self.callPreparse: + preloc = self.preParse( instring, loc ) + else: + preloc = loc + tokensStart = loc + if self.mayIndexError or loc >= len(instring): + try: + loc,tokens = self.parseImpl( instring, preloc, doActions ) + except IndexError: + raise ParseException( instring, len(instring), self.errmsg, self ) + else: + loc,tokens = self.parseImpl( instring, preloc, doActions ) + + tokens = self.postParse( instring, loc, tokens ) + + retTokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList, modal=self.modalResults ) + if self.parseAction and (doActions or self.callDuringTry): + if debugging: + try: + for fn in self.parseAction: + tokens = fn( instring, tokensStart, retTokens ) + if tokens is not None: + retTokens = ParseResults( tokens, + self.resultsName, + asList=self.saveAsList and isinstance(tokens,(ParseResults,list)), + modal=self.modalResults ) + except ParseException, err: + #~ print "Exception raised in user parse action:", err + if (self.debugActions[2] ): + self.debugActions[2]( instring, tokensStart, self, err ) + raise + else: + for fn in self.parseAction: + tokens = fn( instring, tokensStart, retTokens ) + if tokens is not None: + retTokens = ParseResults( tokens, + self.resultsName, + asList=self.saveAsList and isinstance(tokens,(ParseResults,list)), + modal=self.modalResults ) + + if debugging: + #~ print "Matched",self,"->",retTokens.asList() + if (self.debugActions[1] ): + self.debugActions[1]( instring, tokensStart, loc, self, retTokens ) + + return loc, retTokens + + def tryParse( self, instring, loc ): + return self._parse( instring, loc, doActions=False )[0] + + # this method gets repeatedly called during backtracking with the same arguments - + # we can cache these arguments and save ourselves the trouble of re-parsing the contained expression + def _parseCache( self, instring, loc, doActions=True, callPreParse=True ): + lookup = (self,instring,loc,callPreParse,doActions) + if lookup in ParserElement._exprArgCache: + value = ParserElement._exprArgCache[ lookup ] + if isinstance(value,Exception): + if isinstance(value,ParseBaseException): + value.loc = loc + raise value + return (value[0],value[1].copy()) + else: + try: + value = self._parseNoCache( instring, loc, doActions, callPreParse ) + ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy()) + return value + except ParseBaseException, pe: + ParserElement._exprArgCache[ lookup ] = pe + raise + + _parse = _parseNoCache + + # argument cache for optimizing repeated calls when backtracking through recursive expressions + _exprArgCache = {} + def resetCache(): + ParserElement._exprArgCache.clear() + resetCache = staticmethod(resetCache) + + _packratEnabled = False + def enablePackrat(): + """Enables "packrat" parsing, which adds memoizing to the parsing logic. + Repeated parse attempts at the same string location (which happens + often in many complex grammars) can immediately return a cached value, + instead of re-executing parsing/validating code. Memoizing is done of + both valid results and parsing exceptions. + + This speedup may break existing programs that use parse actions that + have side-effects. For this reason, packrat parsing is disabled when + you first import pyparsing. To activate the packrat feature, your + program must call the class method ParserElement.enablePackrat(). If + your program uses psyco to "compile as you go", you must call + enablePackrat before calling psyco.full(). If you do not do this, + Python will crash. For best results, call enablePackrat() immediately + after importing pyparsing. + """ + if not ParserElement._packratEnabled: + ParserElement._packratEnabled = True + ParserElement._parse = ParserElement._parseCache + enablePackrat = staticmethod(enablePackrat) + + def parseString( self, instring ): + """Execute the parse expression with the given string. + This is the main interface to the client code, once the complete + expression has been built. + + Note: parseString implicitly calls expandtabs() on the input string, + in order to report proper column numbers in parse actions. + If the input string contains tabs and + the grammar uses parse actions that use the loc argument to index into the + string being parsed, you can ensure you have a consistent view of the input + string by: + - calling parseWithTabs on your grammar before calling parseString + (see L{I{parseWithTabs}<parseWithTabs>}) + - define your parse action using the full (s,loc,toks) signature, and + reference the input string using the parse action's s argument + - explictly expand the tabs in your input string before calling + parseString + """ + ParserElement.resetCache() + if not self.streamlined: + self.streamline() + #~ self.saveAsList = True + for e in self.ignoreExprs: + e.streamline() + if self.keepTabs: + loc, tokens = self._parse( instring, 0 ) + else: + loc, tokens = self._parse( instring.expandtabs(), 0 ) + return tokens + + def scanString( self, instring, maxMatches=sys.maxint ): + """Scan the input string for expression matches. Each match will return the + matching tokens, start location, and end location. May be called with optional + maxMatches argument, to clip scanning after 'n' matches are found. + + Note that the start and end locations are reported relative to the string + being parsed. See L{I{parseString}<parseString>} for more information on parsing + strings with embedded tabs.""" + if not self.streamlined: + self.streamline() + for e in self.ignoreExprs: + e.streamline() + + if not self.keepTabs: + instring = _ustr(instring).expandtabs() + instrlen = len(instring) + loc = 0 + preparseFn = self.preParse + parseFn = self._parse + ParserElement.resetCache() + matches = 0 + while loc <= instrlen and matches < maxMatches: + try: + preloc = preparseFn( instring, loc ) + nextLoc,tokens = parseFn( instring, preloc, callPreParse=False ) + except ParseException: + loc = preloc+1 + else: + matches += 1 + yield tokens, preloc, nextLoc + loc = nextLoc + + def transformString( self, instring ): + """Extension to scanString, to modify matching text with modified tokens that may + be returned from a parse action. To use transformString, define a grammar and + attach a parse action to it that modifies the returned token list. + Invoking transformString() on a target string will then scan for matches, + and replace the matched text patterns according to the logic in the parse + action. transformString() returns the resulting transformed string.""" + out = [] + lastE = 0 + # force preservation of <TAB>s, to minimize unwanted transformation of string, and to + # keep string locs straight between transformString and scanString + self.keepTabs = True + for t,s,e in self.scanString( instring ): + out.append( instring[lastE:s] ) + if t: + if isinstance(t,ParseResults): + out += t.asList() + elif isinstance(t,list): + out += t + else: + out.append(t) + lastE = e + out.append(instring[lastE:]) + return "".join(map(_ustr,out)) + + def searchString( self, instring, maxMatches=sys.maxint ): + """Another extension to scanString, simplifying the access to the tokens found + to match the given parse expression. May be called with optional + maxMatches argument, to clip searching after 'n' matches are found. + """ + return ParseResults([ t for t,s,e in self.scanString( instring, maxMatches ) ]) + + def __add__(self, other ): + """Implementation of + operator - returns And""" + if isinstance( other, basestring ): + other = Literal( other ) + if not isinstance( other, ParserElement ): + warnings.warn("Cannot add element of type %s to ParserElement" % type(other), + SyntaxWarning, stacklevel=2) + return And( [ self, other ] ) + + def __radd__(self, other ): + """Implementation of += operator""" + if isinstance( other, basestring ): + other = Literal( other ) + if not isinstance( other, ParserElement ): + warnings.warn("Cannot add element of type %s to ParserElement" % type(other), + SyntaxWarning, stacklevel=2) + return other + self + + def __or__(self, other ): + """Implementation of | operator - returns MatchFirst""" + if isinstance( other, basestring ): + other = Literal( other ) + if not isinstance( other, ParserElement ): + warnings.warn("Cannot add element of type %s to ParserElement" % type(other), + SyntaxWarning, stacklevel=2) + return MatchFirst( [ self, other ] ) + + def __ror__(self, other ): + """Implementation of |= operator""" + if isinstance( other, basestring ): + other = Literal( other ) + if not isinstance( other, ParserElement ): + warnings.warn("Cannot add element of type %s to ParserElement" % type(other), + SyntaxWarning, stacklevel=2) + return other | self + + def __xor__(self, other ): + """Implementation of ^ operator - returns Or""" + if isinstance( other, basestring ): + other = Literal( other ) + if not isinstance( other, ParserElement ): + warnings.warn("Cannot add element of type %s to ParserElement" % type(other), + SyntaxWarning, stacklevel=2) + return Or( [ self, other ] ) + + def __rxor__(self, other ): + """Implementation of ^= operator""" + if isinstance( other, basestring ): + other = Literal( other ) + if not isinstance( other, ParserElement ): + warnings.warn("Cannot add element of type %s to ParserElement" % type(other), + SyntaxWarning, stacklevel=2) + return other ^ self + + def __and__(self, other ): + """Implementation of & operator - returns Each""" + if isinstance( other, basestring ): + other = Literal( other ) + if not isinstance( other, ParserElement ): + warnings.warn("Cannot add element of type %s to ParserElement" % type(other), + SyntaxWarning, stacklevel=2) + return Each( [ self, other ] ) + + def __rand__(self, other ): + """Implementation of right-& operator""" + if isinstance( other, basestring ): + other = Literal( other ) + if not isinstance( other, ParserElement ): + warnings.warn("Cannot add element of type %s to ParserElement" % type(other), + SyntaxWarning, stacklevel=2) + return other & self + + def __invert__( self ): + """Implementation of ~ operator - returns NotAny""" + return NotAny( self ) + + def __call__(self, name): + """Shortcut for setResultsName, with listAllMatches=default:: + userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno") + could be written as:: + userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") + """ + return self.setResultsName(name) + + def suppress( self ): + """Suppresses the output of this ParserElement; useful to keep punctuation from + cluttering up returned output. + """ + return Suppress( self ) + + def leaveWhitespace( self ): + """Disables the skipping of whitespace before matching the characters in the + ParserElement's defined pattern. This is normally only used internally by + the pyparsing module, but may be needed in some whitespace-sensitive grammars. + """ + self.skipWhitespace = False + return self + + def setWhitespaceChars( self, chars ): + """Overrides the default whitespace chars + """ + self.skipWhitespace = True + self.whiteChars = chars + self.copyDefaultWhiteChars = False + return self + + def parseWithTabs( self ): + """Overrides default behavior to expand <TAB>s to spaces before parsing the input string. + Must be called before parseString when the input grammar contains elements that + match <TAB> characters.""" + self.keepTabs = True + return self + + def ignore( self, other ): + """Define expression to be ignored (e.g., comments) while doing pattern + matching; may be called repeatedly, to define multiple comment or other + ignorable patterns. + """ + if isinstance( other, Suppress ): + if other not in self.ignoreExprs: + self.ignoreExprs.append( other ) + else: + self.ignoreExprs.append( Suppress( other ) ) + return self + + def setDebugActions( self, startAction, successAction, exceptionAction ): + """Enable display of debugging messages while doing pattern matching.""" + self.debugActions = (startAction or _defaultStartDebugAction, + successAction or _defaultSuccessDebugAction, + exceptionAction or _defaultExceptionDebugAction) + self.debug = True + return self + + def setDebug( self, flag=True ): + """Enable display of debugging messages while doing pattern matching. + Set flag to True to enable, False to disable.""" + if flag: + self.setDebugActions( _defaultStartDebugAction, _defaultSuccessDebugAction, _defaultExceptionDebugAction ) + else: + self.debug = False + return self + + def __str__( self ): + return self.name + + def __repr__( self ): + return _ustr(self) + + def streamline( self ): + self.streamlined = True + self.strRepr = None + return self + + def checkRecursion( self, parseElementList ): + pass + + def validate( self, validateTrace=[] ): + """Check defined expressions for valid structure, check for infinite recursive definitions.""" + self.checkRecursion( [] ) + + def parseFile( self, file_or_filename ): + """Execute the parse expression on the given file or filename. + If a filename is specified (instead of a file object), + the entire file is opened, read, and closed before parsing. + """ + try: + file_contents = file_or_filename.read() + except AttributeError: + f = open(file_or_filename, "rb") + file_contents = f.read() + f.close() + return self.parseString(file_contents) + + def getException(self): + return ParseException("",0,self.errmsg,self) + + def __getattr__(self,aname): + if aname == "myException": + self.myException = ret = self.getException(); + return ret; + else: + raise AttributeError, "no such attribute " + aname + +class Token(ParserElement): + """Abstract ParserElement subclass, for defining atomic matching patterns.""" + def __init__( self ): + super(Token,self).__init__( savelist=False ) + #self.myException = ParseException("",0,"",self) + + def setName(self, name): + s = super(Token,self).setName(name) + self.errmsg = "Expected " + self.name + #s.myException.msg = self.errmsg + return s + + +class Empty(Token): + """An empty token, will always match.""" + def __init__( self ): + super(Empty,self).__init__() + self.name = "Empty" + self.mayReturnEmpty = True + self.mayIndexError = False + + +class NoMatch(Token): + """A token that will never match.""" + def __init__( self ): + super(NoMatch,self).__init__() + self.name = "NoMatch" + self.mayReturnEmpty = True + self.mayIndexError = False + self.errmsg = "Unmatchable token" + #self.myException.msg = self.errmsg + + def parseImpl( self, instring, loc, doActions=True ): + exc = self.myException + exc.loc = loc + exc.pstr = instring + raise exc + + +class Literal(Token): + """Token to exactly match a specified string.""" + def __init__( self, matchString ): + super(Literal,self).__init__() + self.match = matchString + self.matchLen = len(matchString) + try: + self.firstMatchChar = matchString[0] + except IndexError: + warnings.warn("null string passed to Literal; use Empty() instead", + SyntaxWarning, stacklevel=2) + self.__class__ = Empty + self.name = '"%s"' % _ustr(self.match) + self.errmsg = "Expected " + self.name + self.mayReturnEmpty = False + #self.myException.msg = self.errmsg + self.mayIndexError = False + + # Performance tuning: this routine gets called a *lot* + # if this is a single character match string and the first character matches, + # short-circuit as quickly as possible, and avoid calling startswith + #~ @profile + def parseImpl( self, instring, loc, doActions=True ): + if (instring[loc] == self.firstMatchChar and + (self.matchLen==1 or instring.startswith(self.match,loc)) ): + return loc+self.matchLen, self.match + #~ raise ParseException( instring, loc, self.errmsg ) + exc = self.myException + exc.loc = loc + exc.pstr = instring + raise exc + +class Keyword(Token): + """Token to exactly match a specified string as a keyword, that is, it must be + immediately followed by a non-keyword character. Compare with Literal:: + Literal("if") will match the leading 'if' in 'ifAndOnlyIf'. + Keyword("if") will not; it will only match the leading 'if in 'if x=1', or 'if(y==2)' + Accepts two optional constructor arguments in addition to the keyword string: + identChars is a string of characters that would be valid identifier characters, + defaulting to all alphanumerics + "_" and "$"; caseless allows case-insensitive + matching, default is False. + """ + DEFAULT_KEYWORD_CHARS = alphanums+"_$" + + def __init__( self, matchString, identChars=DEFAULT_KEYWORD_CHARS, caseless=False ): + super(Keyword,self).__init__() + self.match = matchString + self.matchLen = len(matchString) + try: + self.firstMatchChar = matchString[0] + except IndexError: + warnings.warn("null string passed to Keyword; use Empty() instead", + SyntaxWarning, stacklevel=2) + self.name = '"%s"' % self.match + self.errmsg = "Expected " + self.name + self.mayReturnEmpty = False + #self.myException.msg = self.errmsg + self.mayIndexError = False + self.caseless = caseless + if caseless: + self.caselessmatch = matchString.upper() + identChars = identChars.upper() + self.identChars = _str2dict(identChars) + + def parseImpl( self, instring, loc, doActions=True ): + if self.caseless: + if ( (instring[ loc:loc+self.matchLen ].upper() == self.caselessmatch) and + (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen].upper() not in self.identChars) and + (loc == 0 or instring[loc-1].upper() not in self.identChars) ): + return loc+self.matchLen, self.match + else: + if (instring[loc] == self.firstMatchChar and + (self.matchLen==1 or instring.startswith(self.match,loc)) and + (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen] not in self.identChars) and + (loc == 0 or instring[loc-1] not in self.identChars) ): + return loc+self.matchLen, self.match + #~ raise ParseException( instring, loc, self.errmsg ) + exc = self.myException + exc.loc = loc + exc.pstr = instring + raise exc + + def copy(self): + c = super(Keyword,self).copy() + c.identChars = Keyword.DEFAULT_KEYWORD_CHARS + return c + + def setDefaultKeywordChars( chars ): + """Overrides the default Keyword chars + """ + Keyword.DEFAULT_KEYWORD_CHARS = chars + setDefaultKeywordChars = staticmethod(setDefaultKeywordChars) + + +class CaselessLiteral(Literal): + """Token to match a specified string, ignoring case of letters. + Note: the matched results will always be in the case of the given + match string, NOT the case of the input text. + """ + def __init__( self, matchString ): + super(CaselessLiteral,self).__init__( matchString.upper() ) + # Preserve the defining literal. + self.returnString = matchString + self.name = "'%s'" % self.returnString + self.errmsg = "Expected " + self.name + #self.myException.msg = self.errmsg + + def parseImpl( self, instring, loc, doActions=True ): + if instring[ loc:loc+self.matchLen ].upper() == self.match: + return loc+self.matchLen, self.returnString + #~ raise ParseException( instring, loc, self.errmsg ) + exc = self.myException + exc.loc = loc + exc.pstr = instring + raise exc + +class CaselessKeyword(Keyword): + def __init__( self, matchString, identChars=Keyword.DEFAULT_KEYWORD_CHARS ): + super(CaselessKeyword,self).__init__( matchString, identChars, caseless=True ) + + def parseImpl( self, instring, loc, doActions=True ): + if ( (instring[ loc:loc+self.matchLen ].upper() == self.caselessmatch) and + (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen].upper() not in self.identChars) ): + return loc+self.matchLen, self.match + #~ raise ParseException( instring, loc, self.errmsg ) + exc = self.myException + exc.loc = loc + exc.pstr = instring + raise exc + +class Word(Token): + """Token for matching words composed of allowed character sets. + Defined with string containing all allowed initial characters, + an optional string containing allowed body characters (if omitted, + defaults to the initial character set), and an optional minimum, + maximum, and/or exact length. The default value for min is 1 (a + minimum value < 1 is not valid); the default values for max and exact + are 0, meaning no maximum or exact length restriction. + """ + def __init__( self, initChars, bodyChars=None, min=1, max=0, exact=0, asKeyword=False ): + super(Word,self).__init__() + self.initCharsOrig = initChars + self.initChars = _str2dict(initChars) + if bodyChars : + self.bodyCharsOrig = bodyChars + self.bodyChars = _str2dict(bodyChars) + else: + self.bodyCharsOrig = initChars + self.bodyChars = _str2dict(initChars) + + self.maxSpecified = max > 0 + + if min < 1: + raise ValueError, "cannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permitted" + + self.minLen = min + + if max > 0: + self.maxLen = max + else: + self.maxLen = sys.maxint + + if exact > 0: + self.maxLen = exact + self.minLen = exact + + self.name = _ustr(self)... [truncated message content] |
From: <ef...@us...> - 2007-11-09 07:25:10
|
Revision: 4176 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4176&view=rev Author: efiring Date: 2007-11-08 23:25:08 -0800 (Thu, 08 Nov 2007) Log Message: ----------- Pylab uses numpy instead of oldnumeric Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/examples/image_demo2.py trunk/matplotlib/examples/mathtext_demo.py trunk/matplotlib/examples/mri_with_eeg.py trunk/matplotlib/lib/matplotlib/pylab.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-09 02:55:47 UTC (rev 4175) +++ trunk/matplotlib/CHANGELOG 2007-11-09 07:25:08 UTC (rev 4176) @@ -1,3 +1,6 @@ +2007-11-08 Made pylab use straight numpy instead of oldnumeric + by default - EF + 2007-11-08 Added additional record array utilites to mlab (rec2excel, rec2gtk, rec_join, rec_append_field, rec_drop_field) - JDH @@ -8,16 +11,22 @@ 2007-11-08 Moved csv2rec to recutils and added other record array utilities - JDH -2007-11-08 If available, use existing pyparsing installation - DSD +2007-11-08 If available, use existing pyparsing installation - DSD -2007-11-07 Removed old enthought.traits from lib/matplotlib, added - Gael Varoquaux's enthought.traits-2.6b1, which is stripped - of setuptools. The package is installed to site-packages +2007-11-07 Removed old enthought.traits from lib/matplotlib, added + Gael Varoquaux's enthought.traits-2.6b1, which is stripped + of setuptools. The package is installed to site-packages if not already available - DSD -2007-11-02 Commited Phil Thompson's patch 1599876, fixes to Qt4Agg - backend and qt4 blitting demo - DSD +2007-11-05 Added easy access to minor tick properties; slight mod + of patch by Pierre G-M - EF +2007-11-02 Commited Phil Thompson's patch 1599876, fixes to Qt4Agg + backend and qt4 blitting demo - DSD + +2007-11-02 Commited Phil Thompson's patch 1599876, fixes to Qt4Agg + backend and qt4 blitting demo - DSD + 2007-10-31 Made log color scale easier to use with contourf; automatic level generation now works. - EF @@ -41,7 +50,7 @@ generator expressions are not supported by python-2.3 - DSD 2007-10-01 Made matplotlib.use() raise an exception if called after - backends has been imported. + backends has been imported. - EF 2007-09-30 Modified update* methods of Bbox and Interval so they work with reversed axes. Prior to this, trying to @@ -201,7 +210,7 @@ 2007-07-19 completed numpification of most trivial cases - NN -2007-07-19 converted non-numpy relicts troughout the code - NN +2007-07-19 converted non-numpy relicts throughout the code - NN 2007-07-19 replaced the Python code in numerix/ by a minimal wrapper around numpy that explicitly mentions all symbols that need to be Modified: trunk/matplotlib/examples/image_demo2.py =================================================================== --- trunk/matplotlib/examples/image_demo2.py 2007-11-09 02:55:47 UTC (rev 4175) +++ trunk/matplotlib/examples/image_demo2.py 2007-11-09 07:25:08 UTC (rev 4176) @@ -3,7 +3,7 @@ w, h = 512, 512 s = file('data/ct.raw', 'rb').read() -A = fromstring(s, UInt16).astype(Float) +A = fromstring(s, uint16).astype(float) A *= 1.0/max(A) A.shape = w, h Modified: trunk/matplotlib/examples/mathtext_demo.py =================================================================== --- trunk/matplotlib/examples/mathtext_demo.py 2007-11-09 02:55:47 UTC (rev 4175) +++ trunk/matplotlib/examples/mathtext_demo.py 2007-11-09 07:25:08 UTC (rev 4176) @@ -4,7 +4,8 @@ latex rendering, see the text.usetex option """ import numpy as npy -from pylab import figure, show +from matplotlib.pyplot import figure, show + fig = figure() fig.subplots_adjust(bottom=0.2) @@ -21,7 +22,8 @@ ax.legend(("Foo", "Testing $x^2$")) -#title(r'$\Delta_i^j \hspace{0.4} \rm{versus} \hspace{0.4} \Delta_{i+1}^j$', fontsize=20) -fig.savefig('mathtext_demo') +ax.set_title(r'$\Delta_i^j \hspace{0.4} \rm{versus} \hspace{0.4} \Delta_{i+1}^j$', fontsize=20) +#fig.savefig('mathtext_demo') show() + Modified: trunk/matplotlib/examples/mri_with_eeg.py =================================================================== --- trunk/matplotlib/examples/mri_with_eeg.py 2007-11-09 02:55:47 UTC (rev 4175) +++ trunk/matplotlib/examples/mri_with_eeg.py 2007-11-09 07:25:08 UTC (rev 4176) @@ -15,7 +15,7 @@ if 1: # load the data # data are 256x256 16 bit integers dfile = 'data/s1045.ima' - im = fromstring(file(dfile, 'rb').read(), UInt16).astype(Float) + im = fromstring(file(dfile, 'rb').read(), uint16).astype(float) im.shape = 256, 256 if 1: # plot the MRI in pcolor @@ -37,7 +37,7 @@ if 1: # plot the EEG # load the data numSamples, numRows = 800,4 - data = fromstring(file('data/eeg.dat', 'rb').read(), Float) + data = fromstring(file('data/eeg.dat', 'rb').read(), float) data.shape = numSamples, numRows t = arange(numSamples)/float(numSamples)*10.0 ticklocs = [] Modified: trunk/matplotlib/lib/matplotlib/pylab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pylab.py 2007-11-09 02:55:47 UTC (rev 4175) +++ trunk/matplotlib/lib/matplotlib/pylab.py 2007-11-09 07:25:08 UTC (rev 4176) @@ -230,38 +230,6 @@ # bring all the symbols in so folks can import them from # pylab in one fell swoop -from numpy.oldnumeric import array, zeros, shape, rank, size, fromstring,\ - take, put, putmask, reshape, repeat, choose, searchsorted,\ - cumsum, product, cumproduct, alltrue, sometrue, allclose,\ - arrayrange, arange, asarray, convolve, swapaxes, concatenate,\ - transpose, sort, argsort, argmax, argmin, innerproduct, dot,\ - outerproduct, resize, indices, fromfunction, diagonal, trace,\ - ravel, nonzero, shape, where, compress, clip, zeros, ones,\ - identity, add, logical_or, exp, subtract, logical_xor,\ - log, multiply, logical_not, log10, divide, maximum, sin,\ - minimum, sinh, conjugate, bitwise_and, sqrt, power, bitwise_or,\ - tan, absolute, bitwise_xor, tanh, negative, ceil, greater, fabs,\ - greater_equal, floor, less, arccos, arctan2, less_equal, arcsin,\ - fmod, equal, arctan, hypot, not_equal, cos, around, logical_and,\ - cosh, arccosh, arcsinh, arctanh, cross_correlate,\ - pi, ArrayType, matrixmultiply - -from numpy.oldnumeric import sum as asum - -from numpy.oldnumeric import Int8, UInt8, Int16, UInt16, Int32, UInt32, Float32,\ - Float64, Complex32, Complex64, Float, Int, Complex - -from numpy.fft import fft # Why just fft? -from numpy.linalg import inv as inverse -from numpy.oldnumeric.linear_algebra import eigenvectors - # not quite the same as linalg.eig - - -pymin, pymax = min, max -from numpy.oldnumeric.mlab import * -min, max = pymin, pymax -from numpy import amin, amax - from matplotlib.mlab import window_hanning, window_none,\ conv, detrend, detrend_mean, detrend_none, detrend_linear,\ polyfit, polyval, entropy, normpdf,\ @@ -271,24 +239,43 @@ diagonal_matrix, base_repr, binary_repr, log2, ispower2,\ bivariate_normal, load, save, stineman_interp -from numpy import meshgrid, linspace, logspace, corrcoef, vander +from numpy import * +from numpy.fft import * +from numpy.random import * +from numpy.linalg import * -""" -problem syms - - cross_correlate - getting from convolve -average -sarray -dump -dumps -load -loads -divide_safe -invert -left_shift -right_shift -sign -""" +# old style--if True, override standard numpy with oldnumeric +if False: + from numpy.oldnumeric import array, zeros, shape, rank, size, fromstring,\ + take, put, putmask, reshape, repeat, choose, searchsorted,\ + cumsum, product, cumproduct, alltrue, sometrue, allclose,\ + arrayrange, arange, asarray, convolve, swapaxes, concatenate,\ + transpose, sort, argsort, argmax, argmin, innerproduct, dot,\ + outerproduct, resize, indices, fromfunction, diagonal, trace,\ + ravel, nonzero, shape, where, compress, clip, zeros, ones,\ + identity, add, logical_or, exp, subtract, logical_xor,\ + log, multiply, logical_not, log10, divide, maximum, sin,\ + minimum, sinh, conjugate, bitwise_and, sqrt, power, bitwise_or,\ + tan, absolute, bitwise_xor, tanh, negative, ceil, greater, fabs,\ + greater_equal, floor, less, arccos, arctan2, less_equal, arcsin,\ + fmod, equal, arctan, hypot, not_equal, cos, around, logical_and,\ + cosh, arccosh, arcsinh, arctanh, cross_correlate,\ + pi, ArrayType, matrixmultiply + from numpy.oldnumeric import sum as asum + + from numpy.oldnumeric import Int8, UInt8, Int16, UInt16, Int32, UInt32, Float32,\ + Float64, Complex32, Complex64, Float, Int, Complex + + pymin, pymax = min, max + from numpy.oldnumeric.mlab import * + min, max = pymin, pymax + from numpy import amin, amax + from numpy.oldnumeric.linear_algebra import eigenvectors + # not quite the same as linalg.eig + from numpy.linalg import inv as inverse + + from matplotlib.pyplot import * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2007-11-09 02:56:05
|
Revision: 4175 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4175&view=rev Author: jdh2358 Date: 2007-11-08 18:55:47 -0800 (Thu, 08 Nov 2007) Log Message: ----------- reverted rec utils to mlab Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/examples/date_index_formatter.py trunk/matplotlib/examples/loadrec.py trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-09 01:43:18 UTC (rev 4174) +++ trunk/matplotlib/CHANGELOG 2007-11-09 02:55:47 UTC (rev 4175) @@ -1,3 +1,6 @@ +2007-11-08 Added additional record array utilites to mlab (rec2excel, + rec2gtk, rec_join, rec_append_field, rec_drop_field) - JDH + 2007-11-08 Updated pytz to version 2007g - DSD 2007-11-08 Updated pyparsing to version 1.4.8 - DSD Modified: trunk/matplotlib/examples/date_index_formatter.py =================================================================== --- trunk/matplotlib/examples/date_index_formatter.py 2007-11-09 01:43:18 UTC (rev 4174) +++ trunk/matplotlib/examples/date_index_formatter.py 2007-11-09 02:55:47 UTC (rev 4175) @@ -9,7 +9,7 @@ """ import numpy -from matplotlib.recutils import csv2rec +from matplotlib.mlab import csv2rec from pylab import figure, show from matplotlib.ticker import Formatter Modified: trunk/matplotlib/examples/loadrec.py =================================================================== --- trunk/matplotlib/examples/loadrec.py 2007-11-09 01:43:18 UTC (rev 4174) +++ trunk/matplotlib/examples/loadrec.py 2007-11-09 02:55:47 UTC (rev 4175) @@ -1,7 +1,7 @@ -from matplotlib.recutils import csv2rec +from matplotlib import mlab from pylab import figure, show -a = csv2rec('data/msft.csv') +a = mlab.csv2rec('data/msft.csv') print a.dtype fig = figure() Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2007-11-09 01:43:18 UTC (rev 4174) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2007-11-09 02:55:47 UTC (rev 4175) @@ -44,18 +44,47 @@ compute it for a lot of pairs. This function is optimized to do this efficiently by caching the direct FFTs. -Credits: += record array helper functions = - Unless otherwise noted, these functions were written by - Author: John D. Hunter <jdh...@ac...> + rec2csv : store record array in CSV file + rec2excel : store record array in excel worksheet - required pyExcelerator + rec2gtk : put record array in GTK treeview - requires gtk + csv2rec : import record array from CSV file with type inspection + rec_append_field : add a field/array to record array + rec_drop_fields : drop fields from record array + rec_join : join two record arrays on sequence of fields - Some others are from the Numeric documentation, or imported from - MLab or other Numeric packages +For the rec viewer clases (rec2csv, rec2excel and rec2gtk), there are +a bunch of Format objects you can pass into the functions that will do +things like color negative values red, set percent formatting and +scaling, etc. + +Example usage: + + r = csv2rec('somefile.csv', checkrows=0) + + formatd = dict( + weight = FormatFloat(2), + change = FormatPercent(2), + cost = FormatThousands(2), + ) + + + rec2excel(r, 'test.xls', formatd=formatd) + rec2csv(r, 'test.csv', formatd=formatd) + scroll = rec2gtk(r, formatd=formatd) + + win = gtk.Window() + win.set_size_request(600,800) + win.add(scroll) + win.show_all() + gtk.main() + """ from __future__ import division -import sys, datetime, csv, warnings +import sys, datetime, csv, warnings, copy import numpy as npy @@ -1907,3 +1936,762 @@ return x ### end mlab2 functions + +#Classes for manipulating and viewing numpy record arrays + + + + + +def safe_isnan(x): + 'isnan for arbitrary types' + try: b = npy.isnan(x) + except NotImplementedError: return False + else: return b + + +def rec_append_field(rec, name, arr, dtype=None): + 'return a new record array with field name populated with data from array arr' + arr = npy.asarray(arr) + if dtype is None: + dtype = arr.dtype + newdtype = npy.dtype(rec.dtype.descr + [(name, dtype)]) + newrec = npy.empty(rec.shape, dtype=newdtype) + for field in rec.dtype.fields: + newrec[field] = rec[field] + newrec[name] = arr + return newrec.view(npy.recarray) + + +def rec_drop_fields(rec, names): + 'return a new numpy record array with fields in names dropped' + + names = set(names) + Nr = len(rec) + + newdtype = npy.dtype([(name, rec.dtype[name]) for name in rec.dtype.names + if name not in names]) + + newrec = npy.empty(Nr, dtype=newdtype) + for field in newdtype.names: + newrec[field] = rec[field] + + return newrec.view(npy.recarray) + + +def rec_join(key, r1, r2): + """ + join record arrays r1 and r2 on key; key is a tuple of field + names. if r1 and r2 have equal values on all the keys in the key + tuple, then their fields will be merged into a new record array + containing the union of the fields of r1 and r2 + """ + + for name in key: + if name not in r1.dtype.names: + raise ValueError('r1 does not have key field %s'%name) + if name not in r2.dtype.names: + raise ValueError('r2 does not have key field %s'%name) + + def makekey(row): + return tuple([row[name] for name in key]) + + + names = list(r1.dtype.names) + [name for name in r2.dtype.names if name not in set(r1.dtype.names)] + + + + r1d = dict([(makekey(row),i) for i,row in enumerate(r1)]) + r2d = dict([(makekey(row),i) for i,row in enumerate(r2)]) + + r1keys = set(r1d.keys()) + r2keys = set(r2d.keys()) + + keys = r1keys & r2keys + + r1ind = [r1d[k] for k in keys] + r2ind = [r2d[k] for k in keys] + + + r1 = r1[r1ind] + r2 = r2[r2ind] + + r2 = rec_drop_fields(r2, r1.dtype.names) + + + def key_desc(name): + 'if name is a string key, use the larger size of r1 or r2 before merging' + dt1 = r1.dtype[name] + if dt1.type != npy.string_: + return (name, dt1.descr[0][1]) + + dt2 = r1.dtype[name] + assert dt2==dt1 + if dt1.num>dt2.num: + return (name, dt1.descr[0][1]) + else: + return (name, dt2.descr[0][1]) + + + + keydesc = [key_desc(name) for name in key] + + newdtype = npy.dtype(keydesc + + [desc for desc in r1.dtype.descr if desc[0] not in key ] + + [desc for desc in r2.dtype.descr if desc[0] not in key ] ) + + + newrec = npy.empty(len(r1), dtype=newdtype) + for field in r1.dtype.names: + newrec[field] = r1[field] + + for field in r2.dtype.names: + newrec[field] = r2[field] + + return newrec.view(npy.recarray) + + +def csv2rec(fname, comments='#', skiprows=0, checkrows=5, delimiter=',', + converterd=None, names=None, missing=None): + """ + Load data from comma/space/tab delimited file in fname into a + numpy record array and return the record array. + + If names is None, a header row is required to automatically assign + the recarray names. The headers will be lower cased, spaces will + be converted to underscores, and illegal attribute name characters + removed. If names is not None, it is a sequence of names to use + for the column names. In this case, it is assumed there is no header row. + + + fname - can be a filename or a file handle. Support for gzipped + files is automatic, if the filename ends in .gz + + comments - the character used to indicate the start of a comment + in the file + + skiprows - is the number of rows from the top to skip + + checkrows - is the number of rows to check to validate the column + data type. When set to zero all rows are validated. + + converterd, if not None, is a dictionary mapping column number or + munged column name to a converter function + + names, if not None, is a list of header names. In this case, no + header will be read from the file + + if no rows are found, None is returned See examples/loadrec.py + """ + + if converterd is None: + converterd = dict() + + import dateutil.parser + parsedate = dateutil.parser.parse + + + fh = cbook.to_filehandle(fname) + + + class FH: + """ + for space delimited files, we want different behavior than + comma or tab. Generally, we want multiple spaces to be + treated as a single separator, whereas with comma and tab we + want multiple commas to return multiple (empty) fields. The + join/strip trick below effects this + """ + def __init__(self, fh): + self.fh = fh + + def close(self): + self.fh.close() + + def seek(self, arg): + self.fh.seek(arg) + + def fix(self, s): + return ' '.join(s.split()) + + + def next(self): + return self.fix(self.fh.next()) + + def __iter__(self): + for line in self.fh: + yield self.fix(line) + + if delimiter==' ': + fh = FH(fh) + + reader = csv.reader(fh, delimiter=delimiter) + def process_skiprows(reader): + if skiprows: + for i, row in enumerate(reader): + if i>=(skiprows-1): break + + return fh, reader + + process_skiprows(reader) + + + def myfloat(x): + if x==missing: + return npy.nan + else: + return float(x) + + def get_func(item, func): + # promote functions in this order + funcmap = {int:myfloat, myfloat:dateutil.parser.parse, dateutil.parser.parse:str} + try: func(item) + except: + if func==str: + raise ValueError('Could not find a working conversion function') + else: return get_func(item, funcmap[func]) # recurse + else: return func + + + # map column names that clash with builtins -- TODO - extend this list + itemd = { + 'return' : 'return_', + 'file' : 'file_', + 'print' : 'print_', + } + + def get_converters(reader): + + converters = None + for i, row in enumerate(reader): + if i==0: + converters = [int]*len(row) + if checkrows and i>checkrows: + break + #print i, len(names), len(row) + #print 'converters', zip(converters, row) + for j, (name, item) in enumerate(zip(names, row)): + func = converterd.get(j) + if func is None: + func = converterd.get(name) + if func is None: + if not item.strip(): continue + func = converters[j] + if len(item.strip()): + func = get_func(item, func) + converters[j] = func + return converters + + # Get header and remove invalid characters + needheader = names is None + if needheader: + headers = reader.next() + # remove these chars + delete = set("""~!@#$%^&*()-=+~\|]}[{';: /?.>,<""") + delete.add('"') + + names = [] + seen = dict() + for i, item in enumerate(headers): + item = item.strip().lower().replace(' ', '_') + item = ''.join([c for c in item if c not in delete]) + if not len(item): + item = 'column%d'%i + + item = itemd.get(item, item) + cnt = seen.get(item, 0) + if cnt>0: + names.append(item + '%d'%cnt) + else: + names.append(item) + seen[item] = cnt+1 + + # get the converter functions by inspecting checkrows + converters = get_converters(reader) + if converters is None: + raise ValueError('Could not find any valid data in CSV file') + + # reset the reader and start over + fh.seek(0) + process_skiprows(reader) + if needheader: + skipheader = reader.next() + + # iterate over the remaining rows and convert the data to date + # objects, ints, or floats as approriate + rows = [] + for i, row in enumerate(reader): + if not len(row): continue + if row[0].startswith(comments): continue + rows.append([func(val) for func, val in zip(converters, row)]) + fh.close() + + if not len(rows): + return None + r = npy.rec.fromrecords(rows, names=names) + return r + + +# a series of classes for describing the format intentions of various rec views +class FormatObj: + def tostr(self, x): + return str(self.toval(x)) + + def toval(self, x): + return x + + +class FormatString(FormatObj): + def tostr(self, x): + return '"%s"'%self.toval(x) + + +class FormatFormatStr(FormatObj): + def __init__(self, fmt): + self.fmt = fmt + + def tostr(self, x): + if x is None: return 'None' + return self.fmt%self.toval(x) + +class FormatFloat(FormatFormatStr): + def __init__(self, precision=4, scale=1.): + FormatFormatStr.__init__(self, '%%1.%df'%precision) + self.precision = precision + self.scale = scale + + def toval(self, x): + if x is not None: + x = x * self.scale + return x + +class FormatInt(FormatObj): + pass + +class FormatPercent(FormatFloat): + def __init__(self, precision=4): + FormatFloat.__init__(self, precision, scale=100.) + +class FormatThousands(FormatFloat): + def __init__(self, precision=4): + FormatFloat.__init__(self, precision, scale=1e-3) + +class FormatMillions(FormatFloat): + def __init__(self, precision=4): + FormatFloat.__init__(self, precision, scale=1e-6) + + +class FormatDate(FormatString): + def __init__(self, fmt): + self.fmt = fmt + + def toval(self, x): + if x is None: return 'None' + return x.strftime(self.fmt) + +class FormatDatetime(FormatDate): + def __init__(self, fmt='%Y-%m-%d %H:%M:%S'): + FormatDate.__init__(self, fmt) + + +defaultformatd = { + npy.int16 : FormatInt(), + npy.int32 : FormatInt(), + npy.int64 : FormatInt(), + npy.float32 : FormatFloat(), + npy.float64 : FormatFloat(), + npy.object_ : FormatObj(), + npy.string_ : FormatString(), + } + +def get_formatd(r, formatd=None): + 'build a formatd guaranteed to have a key for every dtype name' + if formatd is None: + formatd = dict() + + for i, name in enumerate(r.dtype.names): + dt = r.dtype[name] + format = formatd.get(name) + if format is None: + format = defaultformatd.get(dt.type, FormatObj()) + formatd[name] = format + return formatd + +def csvformat_factory(format): + format = copy.deepcopy(format) + if isinstance(format, FormatFloat): + format.scale = 1. # override scaling for storage + format.fmt = '%g' # maximal precision + return format + +def rec2csv(r, fname, delimiter=',', formatd=None): + """ + Save the data from numpy record array r into a comma/space/tab + delimited file. The record array dtype names will be used for + column headers. + + + fname - can be a filename or a file handle. Support for gzipped + files is automatic, if the filename ends in .gz + """ + formatd = get_formatd(r, formatd) + funcs = [] + for i, name in enumerate(r.dtype.names): + funcs.append(csvformat_factory(formatd[name]).tostr) + + fh = cbook.to_filehandle(fname, 'w') + writer = csv.writer(fh, delimiter=delimiter) + header = r.dtype.names + writer.writerow(header) + for row in r: + writer.writerow([func(val) for func, val in zip(funcs, row)]) + fh.close() + +# if pyExcelerator is installed, provide an excel view +try: + import pyExcelerator as excel +except ImportError: + pass +else: + + def xlformat_factory(format): + """ + copy the format, perform any overrides, and attach an xlstyle instance + copied format is returned + """ + format = copy.deepcopy(format) + + + + xlstyle = excel.XFStyle() + if isinstance(format, FormatFloat): + zeros = ''.join(['0']*format.precision) + xlstyle.num_format_str = '#,##0.%s;[RED]-#,##0.%s'%(zeros, zeros) + elif isinstance(format, FormatInt): + xlstyle.num_format_str = '#,##;[RED]-#,##' + elif isinstance(format, FormatPercent): + zeros = ''.join(['0']*format.precision) + xlstyle.num_format_str = '0.%s%;[RED]-0.%s%'%(zeros, zeros) + format.scale = 1. + else: + xlstyle = None + + format.xlstyle = xlstyle + + return format + + def rec2excel(r, ws, formatd=None, rownum=0): + """ + save record array r to excel pyExcelerator worksheet ws + starting at rownum. if ws is string like, assume it is a + filename and save to it + + formatd is a dictionary mapping dtype name -> FormatXL instances + + The next rownum after writing is returned + """ + + autosave = False + if cbook.is_string_like(ws): + filename = ws + wb = excel.Workbook() + ws = wb.add_sheet('worksheet') + autosave = True + + + if formatd is None: + formatd = dict() + + formats = [] + for i, name in enumerate(r.dtype.names): + dt = r.dtype[name] + format = formatd.get(name) + if format is None: + format = defaultformatd.get(dt.type, FormatObj()) + + format = xlformat_factory(format) + ws.write(rownum, i, name) + formats.append(format) + + rownum+=1 + + + ind = npy.arange(len(r.dtype.names)) + for row in r: + for i in ind: + val = row[i] + format = formats[i] + val = format.toval(val) + if format.xlstyle is None: + ws.write(rownum, i, val) + else: + if safe_isnan(val): + ws.write(rownum, i, 'NaN') + else: + ws.write(rownum, i, val, format.xlstyle) + rownum += 1 + + if autosave: + wb.save(filename) + return rownum + + + + +# if gtk is installed, provide a gtk view +try: + import gtk, gobject +except ImportError: + pass +except RuntimeError: + pass +else: + + + def gtkformat_factory(format, colnum): + """ + copy the format, perform any overrides, and attach an gtk style attrs + + + xalign = 0. + cell = None + + """ + + format = copy.copy(format) + format.xalign = 0. + format.cell = None + + def negative_red_cell(column, cell, model, thisiter): + val = model.get_value(thisiter, colnum) + try: val = float(val) + except: cell.set_property('foreground', 'black') + else: + if val<0: + cell.set_property('foreground', 'red') + else: + cell.set_property('foreground', 'black') + + + if isinstance(format, FormatFloat) or isinstance(format, FormatInt): + format.cell = negative_red_cell + format.xalign = 1. + elif isinstance(format, FormatDate): + format.xalign = 1. + return format + + + + class SortedStringsScrolledWindow(gtk.ScrolledWindow): + """ + A simple treeview/liststore assuming all columns are strings. + Supports ascending/descending sort by clicking on column header + """ + + def __init__(self, colheaders, formatterd=None): + """ + xalignd if not None, is a dict mapping col header to xalignent (default 1) + + formatterd if not None, is a dict mapping col header to a ColumnFormatter + """ + + + gtk.ScrolledWindow.__init__(self) + self.colheaders = colheaders + self.seq = None # not initialized with accts + self.set_shadow_type(gtk.SHADOW_ETCHED_IN) + self.set_policy(gtk.POLICY_AUTOMATIC, + gtk.POLICY_AUTOMATIC) + + types = [gobject.TYPE_STRING] * len(colheaders) + model = self.model = gtk.ListStore(*types) + + + treeview = gtk.TreeView(self.model) + treeview.show() + treeview.get_selection().set_mode(gtk.SELECTION_MULTIPLE) + treeview.set_rules_hint(True) + + + class Clicked: + def __init__(self, parent, i): + self.parent = parent + self.i = i + self.num = 0 + + def __call__(self, column): + ind = [] + dsu = [] + for rownum, thisiter in enumerate(self.parent.iters): + val = model.get_value(thisiter, self.i) + try: val = float(val.strip().rstrip('%')) + except ValueError: pass + if npy.isnan(val): val = npy.inf # force nan to sort uniquely + dsu.append((val, rownum)) + dsu.sort() + if not self.num%2: dsu.reverse() + + vals, otherind = zip(*dsu) + ind.extend(otherind) + + self.parent.model.reorder(ind) + newiters = [] + for i in ind: + newiters.append(self.parent.iters[i]) + self.parent.iters = newiters[:] + for i, thisiter in enumerate(self.parent.iters): + key = tuple([self.parent.model.get_value(thisiter, j) for j in range(len(colheaders))]) + self.parent.rownumd[i] = key + + self.num+=1 + + + if formatterd is None: + formatterd = dict() + + formatterd = formatterd.copy() + + for i, header in enumerate(colheaders): + renderer = gtk.CellRendererText() + if header not in formatterd: + formatterd[header] = ColumnFormatter() + formatter = formatterd[header] + + column = gtk.TreeViewColumn(header, renderer, text=i) + renderer.set_property('xalign', formatter.xalign) + column.connect('clicked', Clicked(self, i)) + column.set_property('clickable', True) + + if formatter.cell is not None: + column.set_cell_data_func(renderer, formatter.cell) + + treeview.append_column(column) + + + + self.formatterd = formatterd + self.lastcol = column + self.add(treeview) + self.treeview = treeview + self.clear() + + def clear(self): + self.iterd = dict() + self.iters = [] # an ordered list of iters + self.rownumd = dict() # a map from rownum -> symbol + self.model.clear() + self.datad = dict() + + + def flat(self, row): + seq = [] + for i,val in enumerate(row): + formatter = self.formatterd.get(self.colheaders[i]) + seq.extend([i,formatter.tostr(val)]) + return seq + + def __delete_selected(self, *unused): # untested + + + keyd = dict([(thisiter, key) for key, thisiter in self.iterd.values()]) + for row in self.get_selected(): + key = tuple(row) + thisiter = self.iterd[key] + self.model.remove(thisiter) + del self.datad[key] + del self.iterd[key] + self.iters.remove(thisiter) + + for i, thisiter in enumerate(self.iters): + self.rownumd[i] = keyd[thisiter] + + + + def delete_row(self, row): + key = tuple(row) + thisiter = self.iterd[key] + self.model.remove(thisiter) + + + del self.datad[key] + del self.iterd[key] + self.rownumd[len(self.iters)] = key + self.iters.remove(thisiter) + + for rownum, thiskey in self.rownumd.items(): + if thiskey==key: del self.rownumd[rownum] + + def add_row(self, row): + thisiter = self.model.append() + self.model.set(thisiter, *self.flat(row)) + key = tuple(row) + self.datad[key] = row + self.iterd[key] = thisiter + self.rownumd[len(self.iters)] = key + self.iters.append(thisiter) + + def update_row(self, rownum, newrow): + key = self.rownumd[rownum] + thisiter = self.iterd[key] + newkey = tuple(newrow) + + self.rownumd[rownum] = newkey + del self.datad[key] + del self.iterd[key] + self.datad[newkey] = newrow + self.iterd[newkey] = thisiter + + + self.model.set(thisiter, *self.flat(newrow)) + + def get_row(self, rownum): + key = self.rownumd[rownum] + return self.datad[key] + + def get_selected(self): + selected = [] + def foreach(model, path, iter, selected): + selected.append(model.get_value(iter, 0)) + + self.treeview.get_selection().selected_foreach(foreach, selected) + return selected + + + + def rec2gtk(r, formatd=None, rownum=0): + """ + save record array r to excel pyExcelerator worksheet ws + starting at rownum. if ws is string like, assume it is a + filename and save to it + + formatd is a dictionary mapping dtype name -> FormatXL instances + + The next rownum after writing is returned + """ + + + + if formatd is None: + formatd = dict() + + formats = [] + for i, name in enumerate(r.dtype.names): + dt = r.dtype[name] + format = formatd.get(name) + if format is None: + format = defaultformatd.get(dt.type, FormatObj()) + #print 'gtk fmt factory', i, name, format, type(format) + format = gtkformat_factory(format, i) + formatd[name] = format + + + colheaders = r.dtype.names + scroll = SortedStringsScrolledWindow(colheaders, formatd) + + ind = npy.arange(len(r.dtype.names)) + for row in r: + scroll.add_row(row) + + return scroll + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 01:43:19
|
Revision: 4174 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4174&view=rev Author: dsdale Date: 2007-11-08 17:43:18 -0800 (Thu, 08 Nov 2007) Log Message: ----------- fixed bug in dateutil version check Modified Paths: -------------- trunk/matplotlib/setupext.py Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2007-11-09 01:40:54 UTC (rev 4173) +++ trunk/matplotlib/setupext.py 2007-11-09 01:43:18 UTC (rev 4174) @@ -353,7 +353,7 @@ return False else: try: - print_status("dateutil", dateutil.__version) + print_status("dateutil", dateutil.__version__) except AttributeError: print_status("dateutil", "present, version unknown") return True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 01:40:56
|
Revision: 4173 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4173&view=rev Author: dsdale Date: 2007-11-08 17:40:54 -0800 (Thu, 08 Nov 2007) Log Message: ----------- added pytz-2007g Modified Paths: -------------- trunk/matplotlib/CHANGELOG Added Paths: ----------- trunk/matplotlib/lib/pytz/ trunk/matplotlib/lib/pytz/CHANGES.txt trunk/matplotlib/lib/pytz/LICENSE.txt trunk/matplotlib/lib/pytz/README.txt trunk/matplotlib/lib/pytz/__init__.py trunk/matplotlib/lib/pytz/reference.py trunk/matplotlib/lib/pytz/tzfile.py trunk/matplotlib/lib/pytz/tzinfo.py trunk/matplotlib/lib/pytz/zoneinfo/ trunk/matplotlib/lib/pytz/zoneinfo/Africa/ trunk/matplotlib/lib/pytz/zoneinfo/Africa/Abidjan trunk/matplotlib/lib/pytz/zoneinfo/Africa/Accra trunk/matplotlib/lib/pytz/zoneinfo/Africa/Addis_Ababa trunk/matplotlib/lib/pytz/zoneinfo/Africa/Algiers trunk/matplotlib/lib/pytz/zoneinfo/Africa/Asmara trunk/matplotlib/lib/pytz/zoneinfo/Africa/Asmera trunk/matplotlib/lib/pytz/zoneinfo/Africa/Bamako trunk/matplotlib/lib/pytz/zoneinfo/Africa/Bangui trunk/matplotlib/lib/pytz/zoneinfo/Africa/Banjul trunk/matplotlib/lib/pytz/zoneinfo/Africa/Bissau trunk/matplotlib/lib/pytz/zoneinfo/Africa/Blantyre trunk/matplotlib/lib/pytz/zoneinfo/Africa/Brazzaville trunk/matplotlib/lib/pytz/zoneinfo/Africa/Bujumbura trunk/matplotlib/lib/pytz/zoneinfo/Africa/Cairo trunk/matplotlib/lib/pytz/zoneinfo/Africa/Casablanca trunk/matplotlib/lib/pytz/zoneinfo/Africa/Ceuta trunk/matplotlib/lib/pytz/zoneinfo/Africa/Conakry trunk/matplotlib/lib/pytz/zoneinfo/Africa/Dakar trunk/matplotlib/lib/pytz/zoneinfo/Africa/Dar_es_Salaam trunk/matplotlib/lib/pytz/zoneinfo/Africa/Djibouti trunk/matplotlib/lib/pytz/zoneinfo/Africa/Douala trunk/matplotlib/lib/pytz/zoneinfo/Africa/El_Aaiun trunk/matplotlib/lib/pytz/zoneinfo/Africa/Freetown trunk/matplotlib/lib/pytz/zoneinfo/Africa/Gaborone trunk/matplotlib/lib/pytz/zoneinfo/Africa/Harare trunk/matplotlib/lib/pytz/zoneinfo/Africa/Johannesburg trunk/matplotlib/lib/pytz/zoneinfo/Africa/Kampala trunk/matplotlib/lib/pytz/zoneinfo/Africa/Khartoum trunk/matplotlib/lib/pytz/zoneinfo/Africa/Kigali trunk/matplotlib/lib/pytz/zoneinfo/Africa/Kinshasa trunk/matplotlib/lib/pytz/zoneinfo/Africa/Lagos trunk/matplotlib/lib/pytz/zoneinfo/Africa/Libreville trunk/matplotlib/lib/pytz/zoneinfo/Africa/Lome trunk/matplotlib/lib/pytz/zoneinfo/Africa/Luanda trunk/matplotlib/lib/pytz/zoneinfo/Africa/Lubumbashi trunk/matplotlib/lib/pytz/zoneinfo/Africa/Lusaka trunk/matplotlib/lib/pytz/zoneinfo/Africa/Malabo trunk/matplotlib/lib/pytz/zoneinfo/Africa/Maputo trunk/matplotlib/lib/pytz/zoneinfo/Africa/Maseru trunk/matplotlib/lib/pytz/zoneinfo/Africa/Mbabane trunk/matplotlib/lib/pytz/zoneinfo/Africa/Mogadishu trunk/matplotlib/lib/pytz/zoneinfo/Africa/Monrovia trunk/matplotlib/lib/pytz/zoneinfo/Africa/Nairobi trunk/matplotlib/lib/pytz/zoneinfo/Africa/Ndjamena trunk/matplotlib/lib/pytz/zoneinfo/Africa/Niamey trunk/matplotlib/lib/pytz/zoneinfo/Africa/Nouakchott trunk/matplotlib/lib/pytz/zoneinfo/Africa/Ouagadougou trunk/matplotlib/lib/pytz/zoneinfo/Africa/Porto-Novo trunk/matplotlib/lib/pytz/zoneinfo/Africa/Sao_Tome trunk/matplotlib/lib/pytz/zoneinfo/Africa/Timbuktu trunk/matplotlib/lib/pytz/zoneinfo/Africa/Tripoli trunk/matplotlib/lib/pytz/zoneinfo/Africa/Tunis trunk/matplotlib/lib/pytz/zoneinfo/Africa/Windhoek trunk/matplotlib/lib/pytz/zoneinfo/America/ trunk/matplotlib/lib/pytz/zoneinfo/America/Adak trunk/matplotlib/lib/pytz/zoneinfo/America/Anchorage trunk/matplotlib/lib/pytz/zoneinfo/America/Anguilla trunk/matplotlib/lib/pytz/zoneinfo/America/Antigua trunk/matplotlib/lib/pytz/zoneinfo/America/Araguaina trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/ trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Buenos_Aires trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Catamarca trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/ComodRivadavia trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Cordoba trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Jujuy trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/La_Rioja trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Mendoza trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Rio_Gallegos trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/San_Juan trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Tucuman trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Ushuaia trunk/matplotlib/lib/pytz/zoneinfo/America/Aruba trunk/matplotlib/lib/pytz/zoneinfo/America/Asuncion trunk/matplotlib/lib/pytz/zoneinfo/America/Atikokan trunk/matplotlib/lib/pytz/zoneinfo/America/Atka trunk/matplotlib/lib/pytz/zoneinfo/America/Bahia trunk/matplotlib/lib/pytz/zoneinfo/America/Barbados trunk/matplotlib/lib/pytz/zoneinfo/America/Belem trunk/matplotlib/lib/pytz/zoneinfo/America/Belize trunk/matplotlib/lib/pytz/zoneinfo/America/Blanc-Sablon trunk/matplotlib/lib/pytz/zoneinfo/America/Boa_Vista trunk/matplotlib/lib/pytz/zoneinfo/America/Bogota trunk/matplotlib/lib/pytz/zoneinfo/America/Boise trunk/matplotlib/lib/pytz/zoneinfo/America/Buenos_Aires trunk/matplotlib/lib/pytz/zoneinfo/America/Cambridge_Bay trunk/matplotlib/lib/pytz/zoneinfo/America/Campo_Grande trunk/matplotlib/lib/pytz/zoneinfo/America/Cancun trunk/matplotlib/lib/pytz/zoneinfo/America/Caracas trunk/matplotlib/lib/pytz/zoneinfo/America/Catamarca trunk/matplotlib/lib/pytz/zoneinfo/America/Cayenne trunk/matplotlib/lib/pytz/zoneinfo/America/Cayman trunk/matplotlib/lib/pytz/zoneinfo/America/Chicago trunk/matplotlib/lib/pytz/zoneinfo/America/Chihuahua trunk/matplotlib/lib/pytz/zoneinfo/America/Coral_Harbour trunk/matplotlib/lib/pytz/zoneinfo/America/Cordoba trunk/matplotlib/lib/pytz/zoneinfo/America/Costa_Rica trunk/matplotlib/lib/pytz/zoneinfo/America/Cuiaba trunk/matplotlib/lib/pytz/zoneinfo/America/Curacao trunk/matplotlib/lib/pytz/zoneinfo/America/Danmarkshavn trunk/matplotlib/lib/pytz/zoneinfo/America/Dawson trunk/matplotlib/lib/pytz/zoneinfo/America/Dawson_Creek trunk/matplotlib/lib/pytz/zoneinfo/America/Denver trunk/matplotlib/lib/pytz/zoneinfo/America/Detroit trunk/matplotlib/lib/pytz/zoneinfo/America/Dominica trunk/matplotlib/lib/pytz/zoneinfo/America/Edmonton trunk/matplotlib/lib/pytz/zoneinfo/America/Eirunepe trunk/matplotlib/lib/pytz/zoneinfo/America/El_Salvador trunk/matplotlib/lib/pytz/zoneinfo/America/Ensenada trunk/matplotlib/lib/pytz/zoneinfo/America/Fort_Wayne trunk/matplotlib/lib/pytz/zoneinfo/America/Fortaleza trunk/matplotlib/lib/pytz/zoneinfo/America/Glace_Bay trunk/matplotlib/lib/pytz/zoneinfo/America/Godthab trunk/matplotlib/lib/pytz/zoneinfo/America/Goose_Bay trunk/matplotlib/lib/pytz/zoneinfo/America/Grand_Turk trunk/matplotlib/lib/pytz/zoneinfo/America/Grenada trunk/matplotlib/lib/pytz/zoneinfo/America/Guadeloupe trunk/matplotlib/lib/pytz/zoneinfo/America/Guatemala trunk/matplotlib/lib/pytz/zoneinfo/America/Guayaquil trunk/matplotlib/lib/pytz/zoneinfo/America/Guyana trunk/matplotlib/lib/pytz/zoneinfo/America/Halifax trunk/matplotlib/lib/pytz/zoneinfo/America/Havana trunk/matplotlib/lib/pytz/zoneinfo/America/Hermosillo trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/ trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Indianapolis trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Knox trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Marengo trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Petersburg trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Tell_City trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Vevay trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Vincennes trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Winamac trunk/matplotlib/lib/pytz/zoneinfo/America/Indianapolis trunk/matplotlib/lib/pytz/zoneinfo/America/Inuvik trunk/matplotlib/lib/pytz/zoneinfo/America/Iqaluit trunk/matplotlib/lib/pytz/zoneinfo/America/Jamaica trunk/matplotlib/lib/pytz/zoneinfo/America/Jujuy trunk/matplotlib/lib/pytz/zoneinfo/America/Juneau trunk/matplotlib/lib/pytz/zoneinfo/America/Kentucky/ trunk/matplotlib/lib/pytz/zoneinfo/America/Kentucky/Louisville trunk/matplotlib/lib/pytz/zoneinfo/America/Kentucky/Monticello trunk/matplotlib/lib/pytz/zoneinfo/America/Knox_IN trunk/matplotlib/lib/pytz/zoneinfo/America/La_Paz trunk/matplotlib/lib/pytz/zoneinfo/America/Lima trunk/matplotlib/lib/pytz/zoneinfo/America/Los_Angeles trunk/matplotlib/lib/pytz/zoneinfo/America/Louisville trunk/matplotlib/lib/pytz/zoneinfo/America/Maceio trunk/matplotlib/lib/pytz/zoneinfo/America/Managua trunk/matplotlib/lib/pytz/zoneinfo/America/Manaus trunk/matplotlib/lib/pytz/zoneinfo/America/Martinique trunk/matplotlib/lib/pytz/zoneinfo/America/Mazatlan trunk/matplotlib/lib/pytz/zoneinfo/America/Mendoza trunk/matplotlib/lib/pytz/zoneinfo/America/Menominee trunk/matplotlib/lib/pytz/zoneinfo/America/Merida trunk/matplotlib/lib/pytz/zoneinfo/America/Mexico_City trunk/matplotlib/lib/pytz/zoneinfo/America/Miquelon trunk/matplotlib/lib/pytz/zoneinfo/America/Moncton trunk/matplotlib/lib/pytz/zoneinfo/America/Monterrey trunk/matplotlib/lib/pytz/zoneinfo/America/Montevideo trunk/matplotlib/lib/pytz/zoneinfo/America/Montreal trunk/matplotlib/lib/pytz/zoneinfo/America/Montserrat trunk/matplotlib/lib/pytz/zoneinfo/America/Nassau trunk/matplotlib/lib/pytz/zoneinfo/America/New_York trunk/matplotlib/lib/pytz/zoneinfo/America/Nipigon trunk/matplotlib/lib/pytz/zoneinfo/America/Nome trunk/matplotlib/lib/pytz/zoneinfo/America/Noronha trunk/matplotlib/lib/pytz/zoneinfo/America/North_Dakota/ trunk/matplotlib/lib/pytz/zoneinfo/America/North_Dakota/Center trunk/matplotlib/lib/pytz/zoneinfo/America/North_Dakota/New_Salem trunk/matplotlib/lib/pytz/zoneinfo/America/Panama trunk/matplotlib/lib/pytz/zoneinfo/America/Pangnirtung trunk/matplotlib/lib/pytz/zoneinfo/America/Paramaribo trunk/matplotlib/lib/pytz/zoneinfo/America/Phoenix trunk/matplotlib/lib/pytz/zoneinfo/America/Port-au-Prince trunk/matplotlib/lib/pytz/zoneinfo/America/Port_of_Spain trunk/matplotlib/lib/pytz/zoneinfo/America/Porto_Acre trunk/matplotlib/lib/pytz/zoneinfo/America/Porto_Velho trunk/matplotlib/lib/pytz/zoneinfo/America/Puerto_Rico trunk/matplotlib/lib/pytz/zoneinfo/America/Rainy_River trunk/matplotlib/lib/pytz/zoneinfo/America/Rankin_Inlet trunk/matplotlib/lib/pytz/zoneinfo/America/Recife trunk/matplotlib/lib/pytz/zoneinfo/America/Regina trunk/matplotlib/lib/pytz/zoneinfo/America/Resolute trunk/matplotlib/lib/pytz/zoneinfo/America/Rio_Branco trunk/matplotlib/lib/pytz/zoneinfo/America/Rosario trunk/matplotlib/lib/pytz/zoneinfo/America/Santiago trunk/matplotlib/lib/pytz/zoneinfo/America/Santo_Domingo trunk/matplotlib/lib/pytz/zoneinfo/America/Sao_Paulo trunk/matplotlib/lib/pytz/zoneinfo/America/Scoresbysund trunk/matplotlib/lib/pytz/zoneinfo/America/Shiprock trunk/matplotlib/lib/pytz/zoneinfo/America/St_Johns trunk/matplotlib/lib/pytz/zoneinfo/America/St_Kitts trunk/matplotlib/lib/pytz/zoneinfo/America/St_Lucia trunk/matplotlib/lib/pytz/zoneinfo/America/St_Thomas trunk/matplotlib/lib/pytz/zoneinfo/America/St_Vincent trunk/matplotlib/lib/pytz/zoneinfo/America/Swift_Current trunk/matplotlib/lib/pytz/zoneinfo/America/Tegucigalpa trunk/matplotlib/lib/pytz/zoneinfo/America/Thule trunk/matplotlib/lib/pytz/zoneinfo/America/Thunder_Bay trunk/matplotlib/lib/pytz/zoneinfo/America/Tijuana trunk/matplotlib/lib/pytz/zoneinfo/America/Toronto trunk/matplotlib/lib/pytz/zoneinfo/America/Tortola trunk/matplotlib/lib/pytz/zoneinfo/America/Vancouver trunk/matplotlib/lib/pytz/zoneinfo/America/Virgin trunk/matplotlib/lib/pytz/zoneinfo/America/Whitehorse trunk/matplotlib/lib/pytz/zoneinfo/America/Winnipeg trunk/matplotlib/lib/pytz/zoneinfo/America/Yakutat trunk/matplotlib/lib/pytz/zoneinfo/America/Yellowknife trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/ trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Casey trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Davis trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/DumontDUrville trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Mawson trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/McMurdo trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Palmer trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Rothera trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/South_Pole trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Syowa trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Vostok trunk/matplotlib/lib/pytz/zoneinfo/Arctic/ trunk/matplotlib/lib/pytz/zoneinfo/Arctic/Longyearbyen trunk/matplotlib/lib/pytz/zoneinfo/Asia/ trunk/matplotlib/lib/pytz/zoneinfo/Asia/Aden trunk/matplotlib/lib/pytz/zoneinfo/Asia/Almaty trunk/matplotlib/lib/pytz/zoneinfo/Asia/Amman trunk/matplotlib/lib/pytz/zoneinfo/Asia/Anadyr trunk/matplotlib/lib/pytz/zoneinfo/Asia/Aqtau trunk/matplotlib/lib/pytz/zoneinfo/Asia/Aqtobe trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ashgabat trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ashkhabad trunk/matplotlib/lib/pytz/zoneinfo/Asia/Baghdad trunk/matplotlib/lib/pytz/zoneinfo/Asia/Bahrain trunk/matplotlib/lib/pytz/zoneinfo/Asia/Baku trunk/matplotlib/lib/pytz/zoneinfo/Asia/Bangkok trunk/matplotlib/lib/pytz/zoneinfo/Asia/Beirut trunk/matplotlib/lib/pytz/zoneinfo/Asia/Bishkek trunk/matplotlib/lib/pytz/zoneinfo/Asia/Brunei trunk/matplotlib/lib/pytz/zoneinfo/Asia/Calcutta trunk/matplotlib/lib/pytz/zoneinfo/Asia/Choibalsan trunk/matplotlib/lib/pytz/zoneinfo/Asia/Chongqing trunk/matplotlib/lib/pytz/zoneinfo/Asia/Chungking trunk/matplotlib/lib/pytz/zoneinfo/Asia/Colombo trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dacca trunk/matplotlib/lib/pytz/zoneinfo/Asia/Damascus trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dhaka trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dili trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dubai trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dushanbe trunk/matplotlib/lib/pytz/zoneinfo/Asia/Gaza trunk/matplotlib/lib/pytz/zoneinfo/Asia/Harbin trunk/matplotlib/lib/pytz/zoneinfo/Asia/Hong_Kong trunk/matplotlib/lib/pytz/zoneinfo/Asia/Hovd trunk/matplotlib/lib/pytz/zoneinfo/Asia/Irkutsk trunk/matplotlib/lib/pytz/zoneinfo/Asia/Istanbul trunk/matplotlib/lib/pytz/zoneinfo/Asia/Jakarta trunk/matplotlib/lib/pytz/zoneinfo/Asia/Jayapura trunk/matplotlib/lib/pytz/zoneinfo/Asia/Jerusalem trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kabul trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kamchatka trunk/matplotlib/lib/pytz/zoneinfo/Asia/Karachi trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kashgar trunk/matplotlib/lib/pytz/zoneinfo/Asia/Katmandu trunk/matplotlib/lib/pytz/zoneinfo/Asia/Krasnoyarsk trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kuala_Lumpur trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kuching trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kuwait trunk/matplotlib/lib/pytz/zoneinfo/Asia/Macao trunk/matplotlib/lib/pytz/zoneinfo/Asia/Macau trunk/matplotlib/lib/pytz/zoneinfo/Asia/Magadan trunk/matplotlib/lib/pytz/zoneinfo/Asia/Makassar trunk/matplotlib/lib/pytz/zoneinfo/Asia/Manila trunk/matplotlib/lib/pytz/zoneinfo/Asia/Muscat trunk/matplotlib/lib/pytz/zoneinfo/Asia/Nicosia trunk/matplotlib/lib/pytz/zoneinfo/Asia/Novosibirsk trunk/matplotlib/lib/pytz/zoneinfo/Asia/Omsk trunk/matplotlib/lib/pytz/zoneinfo/Asia/Oral trunk/matplotlib/lib/pytz/zoneinfo/Asia/Phnom_Penh trunk/matplotlib/lib/pytz/zoneinfo/Asia/Pontianak trunk/matplotlib/lib/pytz/zoneinfo/Asia/Pyongyang trunk/matplotlib/lib/pytz/zoneinfo/Asia/Qatar trunk/matplotlib/lib/pytz/zoneinfo/Asia/Qyzylorda trunk/matplotlib/lib/pytz/zoneinfo/Asia/Rangoon trunk/matplotlib/lib/pytz/zoneinfo/Asia/Riyadh trunk/matplotlib/lib/pytz/zoneinfo/Asia/Riyadh87 trunk/matplotlib/lib/pytz/zoneinfo/Asia/Riyadh88 trunk/matplotlib/lib/pytz/zoneinfo/Asia/Riyadh89 trunk/matplotlib/lib/pytz/zoneinfo/Asia/Saigon trunk/matplotlib/lib/pytz/zoneinfo/Asia/Sakhalin trunk/matplotlib/lib/pytz/zoneinfo/Asia/Samarkand trunk/matplotlib/lib/pytz/zoneinfo/Asia/Seoul trunk/matplotlib/lib/pytz/zoneinfo/Asia/Shanghai trunk/matplotlib/lib/pytz/zoneinfo/Asia/Singapore trunk/matplotlib/lib/pytz/zoneinfo/Asia/Taipei trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tashkent trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tbilisi trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tehran trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tel_Aviv trunk/matplotlib/lib/pytz/zoneinfo/Asia/Thimbu trunk/matplotlib/lib/pytz/zoneinfo/Asia/Thimphu trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tokyo trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ujung_Pandang trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ulaanbaatar trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ulan_Bator trunk/matplotlib/lib/pytz/zoneinfo/Asia/Urumqi trunk/matplotlib/lib/pytz/zoneinfo/Asia/Vientiane trunk/matplotlib/lib/pytz/zoneinfo/Asia/Vladivostok trunk/matplotlib/lib/pytz/zoneinfo/Asia/Yakutsk trunk/matplotlib/lib/pytz/zoneinfo/Asia/Yekaterinburg trunk/matplotlib/lib/pytz/zoneinfo/Asia/Yerevan trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/ trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Azores trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Bermuda trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Canary trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Cape_Verde trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Faeroe trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Faroe trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Jan_Mayen trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Madeira trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Reykjavik trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/South_Georgia trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/St_Helena trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Stanley trunk/matplotlib/lib/pytz/zoneinfo/Australia/ trunk/matplotlib/lib/pytz/zoneinfo/Australia/ACT trunk/matplotlib/lib/pytz/zoneinfo/Australia/Adelaide trunk/matplotlib/lib/pytz/zoneinfo/Australia/Brisbane trunk/matplotlib/lib/pytz/zoneinfo/Australia/Broken_Hill trunk/matplotlib/lib/pytz/zoneinfo/Australia/Canberra trunk/matplotlib/lib/pytz/zoneinfo/Australia/Currie trunk/matplotlib/lib/pytz/zoneinfo/Australia/Darwin trunk/matplotlib/lib/pytz/zoneinfo/Australia/Eucla trunk/matplotlib/lib/pytz/zoneinfo/Australia/Hobart trunk/matplotlib/lib/pytz/zoneinfo/Australia/LHI trunk/matplotlib/lib/pytz/zoneinfo/Australia/Lindeman trunk/matplotlib/lib/pytz/zoneinfo/Australia/Lord_Howe trunk/matplotlib/lib/pytz/zoneinfo/Australia/Melbourne trunk/matplotlib/lib/pytz/zoneinfo/Australia/NSW trunk/matplotlib/lib/pytz/zoneinfo/Australia/North trunk/matplotlib/lib/pytz/zoneinfo/Australia/Perth trunk/matplotlib/lib/pytz/zoneinfo/Australia/Queensland trunk/matplotlib/lib/pytz/zoneinfo/Australia/South trunk/matplotlib/lib/pytz/zoneinfo/Australia/Sydney trunk/matplotlib/lib/pytz/zoneinfo/Australia/Tasmania trunk/matplotlib/lib/pytz/zoneinfo/Australia/Victoria trunk/matplotlib/lib/pytz/zoneinfo/Australia/West trunk/matplotlib/lib/pytz/zoneinfo/Australia/Yancowinna trunk/matplotlib/lib/pytz/zoneinfo/Brazil/ trunk/matplotlib/lib/pytz/zoneinfo/Brazil/Acre trunk/matplotlib/lib/pytz/zoneinfo/Brazil/DeNoronha trunk/matplotlib/lib/pytz/zoneinfo/Brazil/East trunk/matplotlib/lib/pytz/zoneinfo/Brazil/West trunk/matplotlib/lib/pytz/zoneinfo/CET trunk/matplotlib/lib/pytz/zoneinfo/CST6CDT trunk/matplotlib/lib/pytz/zoneinfo/Canada/ trunk/matplotlib/lib/pytz/zoneinfo/Canada/Atlantic trunk/matplotlib/lib/pytz/zoneinfo/Canada/Central trunk/matplotlib/lib/pytz/zoneinfo/Canada/East-Saskatchewan trunk/matplotlib/lib/pytz/zoneinfo/Canada/Eastern trunk/matplotlib/lib/pytz/zoneinfo/Canada/Mountain trunk/matplotlib/lib/pytz/zoneinfo/Canada/Newfoundland trunk/matplotlib/lib/pytz/zoneinfo/Canada/Pacific trunk/matplotlib/lib/pytz/zoneinfo/Canada/Saskatchewan trunk/matplotlib/lib/pytz/zoneinfo/Canada/Yukon trunk/matplotlib/lib/pytz/zoneinfo/Chile/ trunk/matplotlib/lib/pytz/zoneinfo/Chile/Continental trunk/matplotlib/lib/pytz/zoneinfo/Chile/EasterIsland trunk/matplotlib/lib/pytz/zoneinfo/Cuba trunk/matplotlib/lib/pytz/zoneinfo/EET trunk/matplotlib/lib/pytz/zoneinfo/EST trunk/matplotlib/lib/pytz/zoneinfo/EST5EDT trunk/matplotlib/lib/pytz/zoneinfo/Egypt trunk/matplotlib/lib/pytz/zoneinfo/Eire trunk/matplotlib/lib/pytz/zoneinfo/Etc/ trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+0 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+1 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+10 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+11 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+12 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+2 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+3 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+4 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+5 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+6 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+7 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+8 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+9 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-0 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-1 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-10 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-11 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-12 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-13 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-14 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-2 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-3 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-4 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-5 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-6 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-7 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-8 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-9 trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT0 trunk/matplotlib/lib/pytz/zoneinfo/Etc/Greenwich trunk/matplotlib/lib/pytz/zoneinfo/Etc/UCT trunk/matplotlib/lib/pytz/zoneinfo/Etc/UTC trunk/matplotlib/lib/pytz/zoneinfo/Etc/Universal trunk/matplotlib/lib/pytz/zoneinfo/Etc/Zulu trunk/matplotlib/lib/pytz/zoneinfo/Europe/ trunk/matplotlib/lib/pytz/zoneinfo/Europe/Amsterdam trunk/matplotlib/lib/pytz/zoneinfo/Europe/Andorra trunk/matplotlib/lib/pytz/zoneinfo/Europe/Athens trunk/matplotlib/lib/pytz/zoneinfo/Europe/Belfast trunk/matplotlib/lib/pytz/zoneinfo/Europe/Belgrade trunk/matplotlib/lib/pytz/zoneinfo/Europe/Berlin trunk/matplotlib/lib/pytz/zoneinfo/Europe/Bratislava trunk/matplotlib/lib/pytz/zoneinfo/Europe/Brussels trunk/matplotlib/lib/pytz/zoneinfo/Europe/Bucharest trunk/matplotlib/lib/pytz/zoneinfo/Europe/Budapest trunk/matplotlib/lib/pytz/zoneinfo/Europe/Chisinau trunk/matplotlib/lib/pytz/zoneinfo/Europe/Copenhagen trunk/matplotlib/lib/pytz/zoneinfo/Europe/Dublin trunk/matplotlib/lib/pytz/zoneinfo/Europe/Gibraltar trunk/matplotlib/lib/pytz/zoneinfo/Europe/Guernsey trunk/matplotlib/lib/pytz/zoneinfo/Europe/Helsinki trunk/matplotlib/lib/pytz/zoneinfo/Europe/Isle_of_Man trunk/matplotlib/lib/pytz/zoneinfo/Europe/Istanbul trunk/matplotlib/lib/pytz/zoneinfo/Europe/Jersey trunk/matplotlib/lib/pytz/zoneinfo/Europe/Kaliningrad trunk/matplotlib/lib/pytz/zoneinfo/Europe/Kiev trunk/matplotlib/lib/pytz/zoneinfo/Europe/Lisbon trunk/matplotlib/lib/pytz/zoneinfo/Europe/Ljubljana trunk/matplotlib/lib/pytz/zoneinfo/Europe/London trunk/matplotlib/lib/pytz/zoneinfo/Europe/Luxembourg trunk/matplotlib/lib/pytz/zoneinfo/Europe/Madrid trunk/matplotlib/lib/pytz/zoneinfo/Europe/Malta trunk/matplotlib/lib/pytz/zoneinfo/Europe/Mariehamn trunk/matplotlib/lib/pytz/zoneinfo/Europe/Minsk trunk/matplotlib/lib/pytz/zoneinfo/Europe/Monaco trunk/matplotlib/lib/pytz/zoneinfo/Europe/Moscow trunk/matplotlib/lib/pytz/zoneinfo/Europe/Nicosia trunk/matplotlib/lib/pytz/zoneinfo/Europe/Oslo trunk/matplotlib/lib/pytz/zoneinfo/Europe/Paris trunk/matplotlib/lib/pytz/zoneinfo/Europe/Podgorica trunk/matplotlib/lib/pytz/zoneinfo/Europe/Prague trunk/matplotlib/lib/pytz/zoneinfo/Europe/Riga trunk/matplotlib/lib/pytz/zoneinfo/Europe/Rome trunk/matplotlib/lib/pytz/zoneinfo/Europe/Samara trunk/matplotlib/lib/pytz/zoneinfo/Europe/San_Marino trunk/matplotlib/lib/pytz/zoneinfo/Europe/Sarajevo trunk/matplotlib/lib/pytz/zoneinfo/Europe/Simferopol trunk/matplotlib/lib/pytz/zoneinfo/Europe/Skopje trunk/matplotlib/lib/pytz/zoneinfo/Europe/Sofia trunk/matplotlib/lib/pytz/zoneinfo/Europe/Stockholm trunk/matplotlib/lib/pytz/zoneinfo/Europe/Tallinn trunk/matplotlib/lib/pytz/zoneinfo/Europe/Tirane trunk/matplotlib/lib/pytz/zoneinfo/Europe/Tiraspol trunk/matplotlib/lib/pytz/zoneinfo/Europe/Uzhgorod trunk/matplotlib/lib/pytz/zoneinfo/Europe/Vaduz trunk/matplotlib/lib/pytz/zoneinfo/Europe/Vatican trunk/matplotlib/lib/pytz/zoneinfo/Europe/Vienna trunk/matplotlib/lib/pytz/zoneinfo/Europe/Vilnius trunk/matplotlib/lib/pytz/zoneinfo/Europe/Volgograd trunk/matplotlib/lib/pytz/zoneinfo/Europe/Warsaw trunk/matplotlib/lib/pytz/zoneinfo/Europe/Zagreb trunk/matplotlib/lib/pytz/zoneinfo/Europe/Zaporozhye trunk/matplotlib/lib/pytz/zoneinfo/Europe/Zurich trunk/matplotlib/lib/pytz/zoneinfo/Factory trunk/matplotlib/lib/pytz/zoneinfo/GB trunk/matplotlib/lib/pytz/zoneinfo/GB-Eire trunk/matplotlib/lib/pytz/zoneinfo/GMT trunk/matplotlib/lib/pytz/zoneinfo/GMT+0 trunk/matplotlib/lib/pytz/zoneinfo/GMT-0 trunk/matplotlib/lib/pytz/zoneinfo/GMT0 trunk/matplotlib/lib/pytz/zoneinfo/Greenwich trunk/matplotlib/lib/pytz/zoneinfo/HST trunk/matplotlib/lib/pytz/zoneinfo/Hongkong trunk/matplotlib/lib/pytz/zoneinfo/Iceland trunk/matplotlib/lib/pytz/zoneinfo/Indian/ trunk/matplotlib/lib/pytz/zoneinfo/Indian/Antananarivo trunk/matplotlib/lib/pytz/zoneinfo/Indian/Chagos trunk/matplotlib/lib/pytz/zoneinfo/Indian/Christmas trunk/matplotlib/lib/pytz/zoneinfo/Indian/Cocos trunk/matplotlib/lib/pytz/zoneinfo/Indian/Comoro trunk/matplotlib/lib/pytz/zoneinfo/Indian/Kerguelen trunk/matplotlib/lib/pytz/zoneinfo/Indian/Mahe trunk/matplotlib/lib/pytz/zoneinfo/Indian/Maldives trunk/matplotlib/lib/pytz/zoneinfo/Indian/Mauritius trunk/matplotlib/lib/pytz/zoneinfo/Indian/Mayotte trunk/matplotlib/lib/pytz/zoneinfo/Indian/Reunion trunk/matplotlib/lib/pytz/zoneinfo/Iran trunk/matplotlib/lib/pytz/zoneinfo/Israel trunk/matplotlib/lib/pytz/zoneinfo/Jamaica trunk/matplotlib/lib/pytz/zoneinfo/Japan trunk/matplotlib/lib/pytz/zoneinfo/Kwajalein trunk/matplotlib/lib/pytz/zoneinfo/Libya trunk/matplotlib/lib/pytz/zoneinfo/MET trunk/matplotlib/lib/pytz/zoneinfo/MST trunk/matplotlib/lib/pytz/zoneinfo/MST7MDT trunk/matplotlib/lib/pytz/zoneinfo/Mexico/ trunk/matplotlib/lib/pytz/zoneinfo/Mexico/BajaNorte trunk/matplotlib/lib/pytz/zoneinfo/Mexico/BajaSur trunk/matplotlib/lib/pytz/zoneinfo/Mexico/General trunk/matplotlib/lib/pytz/zoneinfo/Mideast/ trunk/matplotlib/lib/pytz/zoneinfo/Mideast/Riyadh87 trunk/matplotlib/lib/pytz/zoneinfo/Mideast/Riyadh88 trunk/matplotlib/lib/pytz/zoneinfo/Mideast/Riyadh89 trunk/matplotlib/lib/pytz/zoneinfo/NZ trunk/matplotlib/lib/pytz/zoneinfo/NZ-CHAT trunk/matplotlib/lib/pytz/zoneinfo/Navajo trunk/matplotlib/lib/pytz/zoneinfo/PRC trunk/matplotlib/lib/pytz/zoneinfo/PST8PDT trunk/matplotlib/lib/pytz/zoneinfo/Pacific/ trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Apia trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Auckland trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Chatham trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Easter trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Efate trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Enderbury trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Fakaofo trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Fiji trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Funafuti trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Galapagos trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Gambier trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Guadalcanal trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Guam trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Honolulu trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Johnston trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Kiritimati trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Kosrae trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Kwajalein trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Majuro trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Marquesas trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Midway trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Nauru trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Niue trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Norfolk trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Noumea trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Pago_Pago trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Palau trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Pitcairn trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Ponape trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Port_Moresby trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Rarotonga trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Saipan trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Samoa trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Tahiti trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Tarawa trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Tongatapu trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Truk trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Wake trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Wallis trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Yap trunk/matplotlib/lib/pytz/zoneinfo/Poland trunk/matplotlib/lib/pytz/zoneinfo/Portugal trunk/matplotlib/lib/pytz/zoneinfo/ROC trunk/matplotlib/lib/pytz/zoneinfo/ROK trunk/matplotlib/lib/pytz/zoneinfo/Singapore trunk/matplotlib/lib/pytz/zoneinfo/Turkey trunk/matplotlib/lib/pytz/zoneinfo/UCT trunk/matplotlib/lib/pytz/zoneinfo/US/ trunk/matplotlib/lib/pytz/zoneinfo/US/Alaska trunk/matplotlib/lib/pytz/zoneinfo/US/Aleutian trunk/matplotlib/lib/pytz/zoneinfo/US/Arizona trunk/matplotlib/lib/pytz/zoneinfo/US/Central trunk/matplotlib/lib/pytz/zoneinfo/US/East-Indiana trunk/matplotlib/lib/pytz/zoneinfo/US/Eastern trunk/matplotlib/lib/pytz/zoneinfo/US/Hawaii trunk/matplotlib/lib/pytz/zoneinfo/US/Indiana-Starke trunk/matplotlib/lib/pytz/zoneinfo/US/Michigan trunk/matplotlib/lib/pytz/zoneinfo/US/Mountain trunk/matplotlib/lib/pytz/zoneinfo/US/Pacific trunk/matplotlib/lib/pytz/zoneinfo/US/Pacific-New trunk/matplotlib/lib/pytz/zoneinfo/US/Samoa trunk/matplotlib/lib/pytz/zoneinfo/UTC trunk/matplotlib/lib/pytz/zoneinfo/Universal trunk/matplotlib/lib/pytz/zoneinfo/W-SU trunk/matplotlib/lib/pytz/zoneinfo/WET trunk/matplotlib/lib/pytz/zoneinfo/Zulu trunk/matplotlib/lib/pytz/zoneinfo/iso3166.tab trunk/matplotlib/lib/pytz/zoneinfo/localtime trunk/matplotlib/lib/pytz/zoneinfo/posixrules trunk/matplotlib/lib/pytz/zoneinfo/zone.tab Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-09 01:37:02 UTC (rev 4172) +++ trunk/matplotlib/CHANGELOG 2007-11-09 01:40:54 UTC (rev 4173) @@ -1,5 +1,7 @@ -2007-11-08 Update pyparsing to version 1.4.8 - DSD +2007-11-08 Updated pytz to version 2007g - DSD +2007-11-08 Updated pyparsing to version 1.4.8 - DSD + 2007-11-08 Moved csv2rec to recutils and added other record array utilities - JDH Added: trunk/matplotlib/lib/pytz/CHANGES.txt =================================================================== --- trunk/matplotlib/lib/pytz/CHANGES.txt (rev 0) +++ trunk/matplotlib/lib/pytz/CHANGES.txt 2007-11-09 01:40:54 UTC (rev 4173) @@ -0,0 +1,46 @@ +2004-07-25 + + - Improved localtime handling, and added a localize() method enabling + correct creation of local times. + +2005-02-16 + + - Made available under the Zope Public Licence 2.1 (ZPL) and checked + into the Zope3 project. pytz may now be used and redistributed + under either the original MIT license or the ZPL 2.1. + +2005-05-13 + + - Move UTC into the top level pytz module and provide special + case pickle support for this singleton. + +2005-08-14 + + - Ensure all tzinfo instances are efficiently picklable. + +2005-12-31 + + - Add fixed offset timezone classes required by Zope 3 + - Generate and distribute a PO template file listing all timezone + names. Translations are not yet available. + +2007-03-03 + + - Import work by James Henstridge, making pytz load timezone + information from zic compiled binaries at runtime rather than + processing them into Python classes. + +2007-03-26 + + - Update database to version 2007d + - Fix windows incompatibilities, working around limitations on that + platform. + - Fix 2.3 incompatibilities. Installation now requires distutils. + - Passing an invalid timezone name to timezone() now raises an + UnknownTimezoneError, which is a KeyError subclass for backwards + compatibility. + +2007-03-27 + + - Ensure API can accept Unicode strings (Bug #96957) + Added: trunk/matplotlib/lib/pytz/LICENSE.txt =================================================================== --- trunk/matplotlib/lib/pytz/LICENSE.txt (rev 0) +++ trunk/matplotlib/lib/pytz/LICENSE.txt 2007-11-09 01:40:54 UTC (rev 4173) @@ -0,0 +1,19 @@ +Copyright (c) 2003-2007 Stuart Bishop <st...@st...> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. Added: trunk/matplotlib/lib/pytz/README.txt =================================================================== --- trunk/matplotlib/lib/pytz/README.txt (rev 0) +++ trunk/matplotlib/lib/pytz/README.txt 2007-11-09 01:40:54 UTC (rev 4173) @@ -0,0 +1,326 @@ +pytz - World Timezone Definitions for Python +============================================ + +:Author: Stuart Bishop <st...@st...> + +Introduction +~~~~~~~~~~~~ + +pytz brings the Olson tz database into Python. This library allows +accurate and cross platform timezone calculations using Python 2.3 +or higher. It also solves the issue of ambiguous times at the end +of daylight savings, which you can read more about in the Python +Library Reference (datetime.tzinfo). + +Amost all (over 540) of the Olson timezones are supported [*]_. + +Note that if you perform date arithmetic on local times that cross +DST boundaries, the results may be in an incorrect timezone (ie. +subtract 1 minute from 2002-10-27 1:00 EST and you get 2002-10-27 +0:59 EST instead of the correct 2002-10-27 1:59 EDT). This cannot +be resolved without modifying the Python datetime implementation. +However, these tzinfo classes provide a normalize() method which +allows you to correct these values. + + +Installation +~~~~~~~~~~~~ + +This is a standard Python distutils distribution. To install the +package, run the following command as an administrative user:: + + python setup.py install + + +Example & Usage +~~~~~~~~~~~~~~~ + +>>> from datetime import datetime, timedelta +>>> from pytz import timezone +>>> import pytz +>>> utc = pytz.utc +>>> utc.zone +'UTC' +>>> eastern = timezone('US/Eastern') +>>> eastern.zone +'US/Eastern' +>>> fmt = '%Y-%m-%d %H:%M:%S %Z%z' + +The preferred way of dealing with times is to always work in UTC, +converting to localtime only when generating output to be read +by humans. + +>>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc) +>>> loc_dt = utc_dt.astimezone(eastern) +>>> loc_dt.strftime(fmt) +'2002-10-27 01:00:00 EST-0500' + +This library also allows you to do date arithmetic using local +times, although it is more complicated than working in UTC as you +need to use the `normalize` method to handle daylight savings time +and other timezone transitions. In this example, `loc_dt` is set +to the instant when daylight savings time ends in the US/Eastern +timezone. + +>>> before = loc_dt - timedelta(minutes=10) +>>> before.strftime(fmt) +'2002-10-27 00:50:00 EST-0500' +>>> eastern.normalize(before).strftime(fmt) +'2002-10-27 01:50:00 EDT-0400' +>>> after = eastern.normalize(before + timedelta(minutes=20)) +>>> after.strftime(fmt) +'2002-10-27 01:10:00 EST-0500' + +Creating localtimes is also tricky, and the reason why working with +local times is not recommended. Unfortunately, you cannot just pass +a 'tzinfo' argument when constructing a datetime (see the next section +for more details) + +>>> dt = datetime(2002, 10, 27, 1, 30, 0) +>>> dt1 = eastern.localize(dt, is_dst=True) +>>> dt1.strftime(fmt) +'2002-10-27 01:30:00 EDT-0400' +>>> dt2 = eastern.localize(dt, is_dst=False) +>>> dt2.strftime(fmt) +'2002-10-27 01:30:00 EST-0500' + +Converting between timezones also needs special attention. This also needs +to use the normalize method to ensure the conversion is correct. + +>>> utc_dt = utc.localize(datetime.utcfromtimestamp(1143408899)) +>>> utc_dt.strftime(fmt) +'2006-03-26 21:34:59 UTC+0000' +>>> au_tz = timezone('Australia/Sydney') +>>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz)) +>>> au_dt.strftime(fmt) +'2006-03-27 08:34:59 EST+1100' +>>> utc_dt2 = utc.normalize(au_dt.astimezone(utc)) +>>> utc_dt2.strftime(fmt) +'2006-03-26 21:34:59 UTC+0000' + +You can also take shortcuts when dealing with the UTC side of timezone +conversions. Normalize and localize are not really necessary because there +are no daylight savings time transitions to deal with. + +>>> utc_dt = datetime.utcfromtimestamp(1143408899).replace(tzinfo=utc) +>>> utc_dt.strftime(fmt) +'2006-03-26 21:34:59 UTC+0000' +>>> au_tz = timezone('Australia/Sydney') +>>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz)) +>>> au_dt.strftime(fmt) +'2006-03-27 08:34:59 EST+1100' +>>> utc_dt2 = au_dt.astimezone(utc) +>>> utc_dt2.strftime(fmt) +'2006-03-26 21:34:59 UTC+0000' + + +Problems with Localtime +~~~~~~~~~~~~~~~~~~~~~~~ + +The major problem we have to deal with is that certain datetimes +may occur twice in a year. For example, in the US/Eastern timezone +on the last Sunday morning in October, the following sequence +happens: + + - 01:00 EDT occurs + - 1 hour later, instead of 2:00am the clock is turned back 1 hour + and 01:00 happens again (this time 01:00 EST) + +In fact, every instant between 01:00 and 02:00 occurs twice. This means +that if you try and create a time in the US/Eastern timezone using +the standard datetime syntax, there is no way to specify if you meant +before of after the end-of-daylight-savings-time transition. + +>>> loc_dt = datetime(2002, 10, 27, 1, 30, 00, tzinfo=eastern) +>>> loc_dt.strftime(fmt) +'2002-10-27 01:30:00 EST-0500' + +As you can see, the system has chosen one for you and there is a 50% +chance of it being out by one hour. For some applications, this does +not matter. However, if you are trying to schedule meetings with people +in different timezones or analyze log files it is not acceptable. + +The best and simplest solution is to stick with using UTC. The pytz package +encourages using UTC for internal timezone representation by including a +special UTC implementation based on the standard Python reference +implementation in the Python documentation. This timezone unpickles to be +the same instance, and pickles to a relatively small size. The UTC +implementation can be obtained as pytz.utc, pytz.UTC, or +pytz.timezone('UTC'). Note that this instance is not the same +instance (or implementation) as other timezones with the same meaning +(GMT, Greenwich, Universal, etc.). + +>>> import pickle, pytz +>>> dt = datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc) +>>> naive = dt.replace(tzinfo=None) +>>> p = pickle.dumps(dt, 1) +>>> naive_p = pickle.dumps(naive, 1) +>>> len(p), len(naive_p), len(p) - len(naive_p) +(60, 43, 17) +>>> new = pickle.loads(p) +>>> new == dt +True +>>> new is dt +False +>>> new.tzinfo is dt.tzinfo +True +>>> pytz.utc is pytz.UTC is pytz.timezone('UTC') +True +>>> utc is pytz.timezone('GMT') +False + +If you insist on working with local times, this library provides a +facility for constructing them almost unambiguously. + +>>> loc_dt = datetime(2002, 10, 27, 1, 30, 00) +>>> est_dt = eastern.localize(loc_dt, is_dst=True) +>>> edt_dt = eastern.localize(loc_dt, is_dst=False) +>>> print est_dt.strftime(fmt), '/', edt_dt.strftime(fmt) +2002-10-27 01:30:00 EDT-0400 / 2002-10-27 01:30:00 EST-0500 + +Note that although this handles many cases, it is still not possible +to handle all. In cases where countries change their timezone definitions, +cases like the end-of-daylight-savings-time occur with no way of resolving +the ambiguity. For example, in 1915 Warsaw switched from Warsaw time to +Central European time. So at the stroke of midnight on August 4th 1915 +the clocks were wound back 24 minutes creating a ambiguous time period +that cannot be specified without referring to the timezone abbreviation +or the actual UTC offset. + +The 'Standard' Python way of handling all these ambiguities is not to, +such as demonstrated in this example using the US/Eastern timezone +definition from the Python documentation (Note that this implementation +only works for dates between 1987 and 2006 - it is included for tests only!): + +>>> from pytz.reference import Eastern # pytz.reference only for tests +>>> dt = datetime(2002, 10, 27, 0, 30, tzinfo=Eastern) +>>> str(dt) +'2002-10-27 00:30:00-04:00' +>>> str(dt + timedelta(hours=1)) +'2002-10-27 01:30:00-05:00' +>>> str(dt + timedelta(hours=2)) +'2002-10-27 02:30:00-05:00' +>>> str(dt + timedelta(hours=3)) +'2002-10-27 03:30:00-05:00' + +Notice the first two results? At first glance you might think they are +correct, but taking the UTC offset into account you find that they are +actually two hours appart instead of the 1 hour we asked for. + +>>> from pytz.reference import UTC # pytz.reference only for tests +>>> str(dt.astimezone(UTC)) +'2002-10-27 04:30:00+00:00' +>>> str((dt + timedelta(hours=1)).astimezone(UTC)) +'2002-10-27 06:30:00+00:00' + + +What is UTC +~~~~~~~~~~~ + +`UTC` is Universal Time, formerly known as Greenwich Mean Time or GMT. +All other timezones are given as offsets from UTC. No daylight savings +time occurs in UTC, making it a useful timezone to perform date arithmetic +without worrying about the confusion and ambiguities caused by daylight +savings time transitions, your country changing its timezone, or mobile +computers that move roam through multiple timezones. + + +Helpers +~~~~~~~ + +There are two lists of timezones provided. + +`all_timezones` is the exhaustive list of the timezone names that can be used. + +>>> from pytz import all_timezones +>>> len(all_timezones) >= 500 +True +>>> 'Etc/Greenwich' in all_timezones +True + +`common_timezones` is a list of useful, current timezones. It doesn't +contain deprecated zones or historical zones. It is also a sequence of +strings. + +>>> from pytz import common_timezones +>>> len(common_timezones) < len(all_timezones) +True +>>> 'Etc/Greenwich' in common_timezones +False + +You can also retrieve lists of timezones used by particular countries +using the `country_timezones()` method. It requires an ISO-3166 two letter +country code. + +>>> from pytz import country_timezones +>>> country_timezones('ch') +['Europe/Zurich'] +>>> country_timezones('CH') +['Europe/Zurich'] + +License +~~~~~~~ + +MIT license. + +This code is also available as part of Zope 3 under the Zope Public +License, Version 2.1 (ZPL). + +I'm happy to relicense this code if necessary for inclusion in other +open source projects. + +Latest Versions +~~~~~~~~~~~~~~~ + +This package will be updated after releases of the Olson timezone database. +The latest version can be downloaded from the Python Cheeseshop_ or +Sourceforge_. The code that is used to generate this distribution is +available using the Bazaar_ revision control system using:: + + bzr branch http://bazaar.launchpad.net/~stub/pytz/devel + +.. _Cheeseshop: http://cheeseshop.python.org/pypi/pytz/ +.. _Sourceforge: http://sourceforge.net/projects/pytz/ +.. _Bazaar: http://bazaar-vcs.org/ + +Bugs, Feature Requests & Patches +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Bugs can be reported using Launchpad at +https://bugs.launchpad.net/products/pytz + +Issues & Limitations +~~~~~~~~~~~~~~~~~~~~ + +- Offsets from UTC are rounded to the nearest whole minute, so timezones + such as Europe/Amsterdam pre 1937 will be up to 30 seconds out. This is + a limitation of the Python datetime library. + +- If you think a timezone definition is incorrect, I probably can't fix + it. pytz is a direct translation of the Olson timezone database, and + changes to the timezone definitions need to be made to this source. + If you find errors they should be reported to the time zone mailing + list, linked from http://www.twinsun.com/tz/tz-link.htm + +Further Reading +~~~~~~~~~~~~~~~ + +More info than you want to know about timezones: +http://www.twinsun.com/tz/tz-link.htm + + +Contact +~~~~~~~ + +Stuart Bishop <st...@st...> + +.. [*] The missing few are for Riyadh Solar Time in 1987, 1988 and 1989. + As Saudi Arabia gave up trying to cope with their timezone + definition, I see no reason to complicate my code further + to cope with them. (I understand the intention was to set + sunset to 0:00 local time, the start of the Islamic day. + In the best case caused the DST offset to change daily and + worst case caused the DST offset to change each instant + depending on how you interpreted the ruling.) + + Property changes on: trunk/matplotlib/lib/pytz/README.txt ___________________________________________________________________ Name: svn:eol-style + CRLF Added: trunk/matplotlib/lib/pytz/__init__.py =================================================================== --- trunk/matplotlib/lib/pytz/__init__.py (rev 0) +++ trunk/matplotlib/lib/pytz/__init__.py 2007-11-09 01:40:54 UTC (rev 4173) @@ -0,0 +1,1396 @@ +''' +datetime.tzinfo timezone definitions generated from the +Olson timezone database: + + ftp://elsie.nci.nih.gov/pub/tz*.tar.gz + +See the datetime section of the Python Library Reference for information +on how to use these modules. +''' + +# The Olson database has historically been updated about 4 times a year +OLSON_VERSION = '2007g' +VERSION = OLSON_VERSION +#VERSION = OLSON_VERSION + '.2' +__version__ = OLSON_VERSION + +OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling + +__all__ = [ + 'timezone', 'utc', 'country_timezones', + 'AmbiguousTimeError', 'UnknownTimeZoneError', + 'all_timezones', 'all_timezones_set', + 'common_timezones', 'common_timezones_set', + ] + +import sys, datetime, os.path, gettext + +try: + from pkg_resources import resource_stream +except ImportError: + resource_stream = None + +from tzinfo import AmbiguousTimeError, unpickler +from tzfile import build_tzinfo + +# Use 2.3 sets module implementation if set builtin is not available +try: + set +except NameError: + from sets import Set as set + + +def open_resource(name): + """Open a resource from the zoneinfo subdir for reading. + + Uses the pkg_resources module if available. + """ + if resource_stream is not None: + return resource_stream(__name__, 'zoneinfo/' + name) + else: + name_parts = name.lstrip('/').split('/') + for part in name_parts: + if part == os.path.pardir or os.path.sep in part: + raise ValueError('Bad path segment: %r' % part) + filename = os.path.join(os.path.dirname(__file__), + 'zoneinfo', *name_parts) + return open(filename, 'rb') + + +# Enable this when we get some translations? +# We want an i18n API that is useful to programs using Python's gettext +# module, as well as the Zope3 i18n package. Perhaps we should just provide +# the POT file and translations, and leave it up to callers to make use +# of them. +# +# t = gettext.translation( +# 'pytz', os.path.join(os.path.dirname(__file__), 'locales'), +# fallback=True +# ) +# def _(timezone_name): +# """Translate a timezone name using the current locale, returning Unicode""" +# return t.ugettext(timezone_name) + + +class UnknownTimeZoneError(KeyError): + '''Exception raised when pytz is passed an unknown timezone. + + >>> isinstance(UnknownTimeZoneError(), LookupError) + True + + This class is actually a subclass of KeyError to provide backwards + compatibility with code relying on the undocumented behavior of earlier + pytz releases. + + >>> isinstance(UnknownTimeZoneError(), KeyError) + True + ''' + pass + + +_tzinfo_cache = {} + +def timezone(zone): + r''' Return a datetime.tzinfo implementation for the given timezone + + >>> from datetime import datetime, timedelta + >>> utc = timezone('UTC') + >>> eastern = timezone('US/Eastern') + >>> eastern.zone + 'US/Eastern' + >>> timezone(u'US/Eastern') is eastern + True + >>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc) + >>> loc_dt = utc_dt.astimezone(eastern) + >>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)' + >>> loc_dt.strftime(fmt) + '2002-10-27 01:00:00 EST (-0500)' + >>> (loc_dt - timedelta(minutes=10)).strftime(fmt) + '2002-10-27 00:50:00 EST (-0500)' + >>> eastern.normalize(loc_dt - timedelta(minutes=10)).strftime(fmt) + '2002-10-27 01:50:00 EDT (-0400)' + >>> (loc_dt + timedelta(minutes=10)).strftime(fmt) + '2002-10-27 01:10:00 EST (-0500)' + + Raises UnknownTimeZoneError if passed an unknown zone. + + >>> timezone('Asia/Shangri-La') + Traceback (most recent call last): + ... + UnknownTimeZoneError: 'Asia/Shangri-La' + + >>> timezone(u'\N{TRADE MARK SIGN}') + Traceback (most recent call last): + ... + UnknownTimeZoneError: u'\u2122' + ''' + if zone.upper() == 'UTC': + return utc + + try: + zone = zone.encode('US-ASCII') + except UnicodeEncodeError: + # All valid timezones are ASCII + raise UnknownTimeZoneError(zone) + + zone = _unmunge_zone(zone) + if zone not in _tzinfo_cache: + if zone in all_timezones_set: + _tzinfo_cache[zone] = build_tzinfo(zone, open_resource(zone)) + else: + raise UnknownTimeZoneError(zone) + + return _tzinfo_cache[zone] + + +def _unmunge_zone(zone): + """Undo the time zone name munging done by older versions of pytz.""" + return zone.replace('_plus_', '+').replace('_minus_', '-') + + +ZERO = datetime.timedelta(0) +HOUR = datetime.timedelta(hours=1) + + +class UTC(datetime.tzinfo): + """UTC + + Identical to the reference UTC implementation given in Python docs except + that it unpickles using the single module global instance defined beneath + this class declaration. + + Also contains extra attributes and methods to match other pytz tzinfo + instances. + """ + zone = "UTC" + + def utcoffset(self, dt): + return ZERO + + def tzname(self, dt): + return "UTC" + + def dst(self, dt): + return ZERO + + def __reduce__(self): + return _UTC, () + + def localize(self, dt, is_dst=False): + '''Convert naive time to local time''' + if dt.tzinfo is not None: + raise ValueError, 'Not naive datetime (tzinfo is already set)' + return dt.replace(tzinfo=self) + + def normalize(self, dt, is_dst=False): + '''Correct the timezone information on the given datetime''' + if dt.tzinfo is None: + raise ValueError, 'Naive time - no tzinfo set' + return dt.replace(tzinfo=self) + + def __repr__(self): + return "<UTC>" + + def __str__(self): + return "UTC" + + +UTC = utc = UTC() # UTC is a singleton + + +def _UTC(): + """Factory function for utc unpickling. + + Makes sure that unpickling a utc instance always returns the same + module global. + + These examples belong in the UTC class above, but it is obscured; or in + the README.txt, but we are not depending on Python 2.4 so integrating + the README.txt examples with the unit tests is not trivial. + + >>> import datetime, pickle + >>> dt = datetime.datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc) + >>> naive = dt.replace(tzinfo=None) + >>> p = pickle.dumps(dt, 1) + >>> naive_p = pickle.dumps(naive, 1) + >>> len(p), len(naive_p), len(p) - len(naive_p) + (60, 43, 17) + >>> new = pickle.loads(p) + >>> new == dt + True + >>> new is dt + False + >>> new.tzinfo is dt.tzinfo + True + >>> utc is UTC is timezone('UTC') + True + >>> utc is timezone('GMT') + False + """ + return utc +_UTC.__safe_for_unpickling__ = True + + +def _p(*args): + """Factory function for unpickling pytz tzinfo instances. + + Just a wrapper around tzinfo.unpickler to save a few bytes in each pickle + by shortening the path. + """ + return unpickler(*args) +_p.__safe_for_unpickling__ = True + +_country_timezones_cache = {} + +def country_timezones(iso3166_code): + """Return a list of timezones used in a particular country. + + iso3166_code is the two letter code used to identify the country. + + >>> country_timezones('ch') + ['Europe/Zurich'] + >>> country_timezones('CH') + ['Europe/Zurich'] + >>> country_timezones(u'ch') + ['Europe/Zurich'] + >>> country_timezones('XXX') + Traceback (most recent call last): + ... + KeyError: 'XXX' + """ + iso3166_code = iso3166_code.upper() + if not _country_timezones_cache: + zone_tab = open_resource('zone.tab') + for line in zone_tab: + if line.startswith('#'): + continue + code, coordinates, zone = line.split(None, 4)[:3] + try: + _country_timezones_cache[code].append(zone) + except KeyError: + _country_timezones_cache[code] = [zone] + return _country_timezones_cache[iso3166_code] + + +# Time-zone info based solely on fixed offsets + +class _FixedOffset(datetime.tzinfo): + + zone = None # to match the standard pytz API + + def __init__(self, minutes): + if abs(minutes) >= 1440: + raise ValueError("absolute offset is too large", minutes) + self._minutes = minutes + self._offset = datetime.timedelta(minutes=minutes) + + def utcoffset(self, dt): + return self._offset + + def __reduce__(self): + return FixedOffset, (self._minutes, ) + + def dst(self, dt): + return None + + def tzname(self, dt): + return None + + def __repr__(self): + return 'pytz.FixedOffset(%d)' % self._minutes + + def localize(self, dt, is_dst=False): + '''Convert naive time to local time''' + if dt.tzinfo is not None: + raise ValueError, 'Not naive datetime (tzinfo is already set)' + return dt.replace(tzinfo=self) + + def normalize(self, dt, is_dst=False): + '''Correct the timezone information on the given datetime''' + if dt.tzinfo is None: + raise ValueError, 'Naive time - no tzinfo set' + return dt.replace(tzinfo=self) + + +def FixedOffset(offset, _tzinfos = {}): + """return a fixed-offset timezone based off a number of minutes. + + >>> one = FixedOffset(-330) + >>> one + pytz.FixedOffset(-330) + >>> one.utcoffset(datetime.datetime.now()) + datetime.timedelta(-1, 66600) + + >>> two = FixedOffset(1380) + >>> two + pytz.FixedOffset(1380) + >>> two.utcoffset(datetime.datetime.now()) + datetime.timedelta(0, 82800) + + The datetime.timedelta must be between the range of -1 and 1 day, + non-inclusive. + + >>> FixedOffset(1440) + Traceback (most recent call last): + ... + ValueError: ('absolute offset is too large', 1440) + + >>> FixedOffset(-1440) + Traceback (most recent call last): + ... + ValueError: ('absolute offset is too large', -1440) + + An offset of 0 is special-cased to return UTC. + + >>> FixedOffset(0) is UTC + True + + There should always be only one instance of a FixedOffset per timedelta. + This should be true for multiple creation calls. + + >>> FixedOffset(-330) is one + True + >>> FixedOffset(1380) is two + True + + It should also be true for pickling. + + >>> import pickle + >>> pickle.loads(pickle.dumps(one)) is one + True + >>> pickle.loads(pickle.dumps(two)) is two + True + """ + if offset == 0: + return UTC + + info = _tzinfos.get(offset) + if info is None: + # We haven't seen this one before. we need to save it. + + # Use setdefault to avoid a race condition and make sure we have + # only one + info = _tzinfos.setdefault(offset, _FixedOffset(offset)) + + return info + +FixedOffset.__safe_for_unpickling__ = True + + +def _test(): + import doctest, os, sys + sys.path.insert(0, os.pardir) + import pytz + return doctest.testmod(pytz) + +if __name__ == '__main__': + _test() + +common_timezones = \ +['Africa/Abidjan', + 'Africa/Accra', + 'Africa/Addis_Ababa', + 'Africa/Algiers', + 'Africa/Asmara', + 'Africa/Asmera', + 'Africa/Bamako', + 'Africa/Bangui', + 'Africa/Banjul', + 'Africa/Bissau', + 'Africa/Blantyre', + 'Africa/Brazzaville', + 'Africa/Bujumbura', + 'Africa/Cairo', + 'Africa/Casablanca', + 'Africa/Ceuta', + 'Africa/Conakry', + 'Africa/Dakar', + 'Africa/Dar_es_Salaam', + 'Africa/Djibouti', + 'Africa/Douala', + 'Africa/El_Aaiun', + 'Africa/Freetown', + 'Africa/Gaborone', + 'Africa/Harare', + 'Africa/Johannesburg', + 'Africa/Kampala', + 'Africa/Khartoum', + 'Africa/Kigali', + 'Africa/Kinshasa', + 'Africa/Lagos', + 'Africa/Libreville', + 'Africa/Lome', + 'Africa/Luanda', + 'Africa/Lubumbashi', + 'Africa/Lusaka', + 'Africa/Malabo', + 'Africa/Maputo', + 'Africa/Maseru', + 'Africa/Mbabane', + 'Africa/Mogadishu', + 'Africa/Monrovia', + 'Africa/Nairobi', + 'Africa/Ndjamena', + 'Africa/Niamey', + 'Africa/Nouakchott', + 'Africa/Ouagadougou', + 'Africa/Porto-Novo', + 'Africa/Sao_Tome', + 'Africa/Timbuktu', + 'Africa/Tripoli', + 'Africa/Tunis', + 'Africa/Windhoek', + 'America/Adak', + 'America/Anchorage', + 'America/Anguilla', + 'America/Antigua', + 'America/Araguaina', + 'America/Aruba', + 'America/Asuncion', + 'America/Atikokan', + 'America/Atka', + 'America/Bahia', + 'America/Barbados', + 'America/Belem', + 'America/B... [truncated message content] |
From: <ds...@us...> - 2007-11-09 01:37:04
|
Revision: 4172 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4172&view=rev Author: dsdale Date: 2007-11-08 17:37:02 -0800 (Thu, 08 Nov 2007) Log Message: ----------- remove old version of pytz Modified Paths: -------------- trunk/matplotlib/lib/dateutil/__init__.py trunk/matplotlib/setup.py Removed Paths: ------------- trunk/matplotlib/lib/pytz/ Modified: trunk/matplotlib/lib/dateutil/__init__.py =================================================================== --- trunk/matplotlib/lib/dateutil/__init__.py 2007-11-09 00:31:48 UTC (rev 4171) +++ trunk/matplotlib/lib/dateutil/__init__.py 2007-11-09 01:37:02 UTC (rev 4172) @@ -6,3 +6,4 @@ """ __author__ = "Gustavo Niemeyer <gu...@ni...>" __license__ = "PSF License" +__version__ = "1.2" Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2007-11-09 00:31:48 UTC (rev 4171) +++ trunk/matplotlib/setup.py 2007-11-09 01:37:02 UTC (rev 4172) @@ -197,13 +197,23 @@ # only install pytz and dateutil if the user hasn't got them def add_pytz(): packages.append('pytz') + resources = ['zone.tab', 'locales/pytz.pot'] # install pytz subdirs - for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz','zoneinfo')): + for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz', + 'zoneinfo')): if '.svn' not in dirpath: - packages.append('/'.join(dirpath.split(os.sep)[1:])) + # remove the 'lib/pytz' part of the path + basepath = dirpath.split(os.path.sep, 2)[2] + resources.extend([os.path.join(basepath, filename) + for filename in filenames]) + package_data['pytz'] = resources + assert len(resources) > 10, 'pytz zoneinfo files not found!' +# packages.append('/'.join(dirpath.split(os.sep)[1:])) def add_dateutil(): packages.append('dateutil') + packages.append('dateutil/zoneinfo') + package_data['dateutil'] = ['zoneinfo/zoneinfo*.tar.*'] haspytz = check_for_pytz() hasdateutil = check_for_dateutil() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 00:31:50
|
Revision: 4171 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4171&view=rev Author: dsdale Date: 2007-11-08 16:31:48 -0800 (Thu, 08 Nov 2007) Log Message: ----------- note pyparsing change to API_CHANGES Modified Paths: -------------- trunk/matplotlib/API_CHANGES Modified: trunk/matplotlib/API_CHANGES =================================================================== --- trunk/matplotlib/API_CHANGES 2007-11-09 00:22:03 UTC (rev 4170) +++ trunk/matplotlib/API_CHANGES 2007-11-09 00:31:48 UTC (rev 4171) @@ -1,3 +1,7 @@ + Removed matplotlib.pyparsing. We now use the system's pyparsing + if it is available, and if not, we install pyparsing directly into + site-packages + Moved mlab.csv2rec -> recutils.csv2rec Added ax kwarg to pyplot.colorbar and Figure.colorbar so that This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 00:22:08
|
Revision: 4170 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4170&view=rev Author: dsdale Date: 2007-11-08 16:22:03 -0800 (Thu, 08 Nov 2007) Log Message: ----------- added checks that also print version numbers for pyparsing, pytz, dateutil, configobj Modified Paths: -------------- trunk/matplotlib/setup.py trunk/matplotlib/setupext.py Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2007-11-09 00:19:45 UTC (rev 4169) +++ trunk/matplotlib/setup.py 2007-11-09 00:22:03 UTC (rev 4170) @@ -80,9 +80,10 @@ build_ft2font, build_image, build_windowing, build_transforms, \ build_contour, build_nxutils, build_traits, build_swigagg, build_gdk, \ build_subprocess, build_ttconv, print_line, print_status, print_message, \ - print_raw, check_for_freetype, check_for_libpng, check_for_gtk, check_for_tk, \ - check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, check_for_cairo, \ - check_for_traits + print_raw, check_for_freetype, check_for_libpng, check_for_gtk, \ + check_for_tk, check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, \ + check_for_cairo, check_for_traits, check_for_pytz, check_for_dateutil, \ + check_for_pyparsing, check_for_configobj #import distutils.sysconfig # jdh @@ -183,14 +184,16 @@ build_contour(ext_modules, packages) build_nxutils(ext_modules, packages) +if not check_for_pyparsing(): py_modules.append('pyparsing') + print_raw("") print_raw("OPTIONAL DEPENDENCIES") try: import datetime -except ImportError: havedate = False -else: havedate = True +except ImportError: hasdatetime = False +else: hasdatetime = True -if havedate: # dates require python23 datetime +if hasdatetime: # dates require python23 datetime # only install pytz and dateutil if the user hasn't got them def add_pytz(): packages.append('pytz') @@ -202,32 +205,23 @@ def add_dateutil(): packages.append('dateutil') + haspytz = check_for_pytz() + hasdateutil = check_for_dateutil() + if sys.platform=='win32': # always add these to the win32 installer add_pytz() add_dateutil() else: # only add them if we need them + if not haspytz: add_pytz() + if not hasdateutil: add_dateutil() - try: - import pytz - except ImportError: - add_pytz() - - try: - import dateutil - except ImportError: - add_dateutil() - build_swigagg(ext_modules, packages) build_transforms(ext_modules, packages) -try: import pyparsing -except ImportError: py_modules.append('pyparsing') - # for the traited config package: -try: import configobj -except ImportError: py_modules.append('configobj') +if not check_for_configobj(): py_modules.append('configobj') if not check_for_traits(): build_traits(ext_modules, packages) Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2007-11-09 00:19:45 UTC (rev 4169) +++ trunk/matplotlib/setupext.py 2007-11-09 00:22:03 UTC (rev 4170) @@ -323,7 +323,51 @@ return False else: print_status("Cairo", cairo.version) + return True +def check_for_pyparsing(): + try: + import pyparsing + except ImportError: + print_status("pyparsing", "mpl-provided") + return False + else: + print_status("pyparsing", pyparsing.__version__) + return True + +def check_for_pytz(): + try: + import pytz + except ImportError: + print_status("pytz", "mpl-provided") + return False + else: + print_status("pytz", pytz.__version__) + return True + +def check_for_dateutil(): + try: + import dateutil + except ImportError: + print_status("dateutil", "mpl-provided") + return False + else: + try: + print_status("dateutil", dateutil.__version) + except AttributeError: + print_status("dateutil", "present, version unknown") + return True + +def check_for_configobj(): + try: + import configobj + except ImportError: + print_status("configobj", "mpl-provided") + return False + else: + print_status("configobj", configobj.__version__) + return True + def check_for_traits(): gotit = False try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-09 00:19:52
|
Revision: 4169 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4169&view=rev Author: dsdale Date: 2007-11-08 16:19:45 -0800 (Thu, 08 Nov 2007) Log Message: ----------- updated pyparsing to version 1.4.8 Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/pyparsing.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-08 23:29:46 UTC (rev 4168) +++ trunk/matplotlib/CHANGELOG 2007-11-09 00:19:45 UTC (rev 4169) @@ -1,3 +1,5 @@ +2007-11-08 Update pyparsing to version 1.4.8 - DSD + 2007-11-08 Moved csv2rec to recutils and added other record array utilities - JDH Modified: trunk/matplotlib/lib/pyparsing.py =================================================================== --- trunk/matplotlib/lib/pyparsing.py 2007-11-08 23:29:46 UTC (rev 4168) +++ trunk/matplotlib/lib/pyparsing.py 2007-11-09 00:19:45 UTC (rev 4169) @@ -57,8 +57,9 @@ - quoted strings - embedded comments """ -__version__ = "1.4.6" -__versionTime__ = "11 April 2007 16:41" + +__version__ = "1.4.8" +__versionTime__ = "7 October 2007 00:25" __author__ = "Paul McGuire <pt...@us...>" import string @@ -273,13 +274,14 @@ if isinstance(i,(int,slice)): del self.__toklist[i] else: - del self._tokdict[i] + del self.__tokdict[i] def __contains__( self, k ): return self.__tokdict.has_key(k) def __len__( self ): return len( self.__toklist ) - def __nonzero__( self ): return len( self.__toklist ) > 0 + def __bool__(self): return len( self.__toklist ) > 0 + def __nonzero__( self ): return self.__bool__() def __iter__( self ): return iter( self.__toklist ) def keys( self ): """Returns all named result keys.""" @@ -598,6 +600,8 @@ """Define name for this expression, for use in debugging.""" self.name = name self.errmsg = "Expected " + self.name + if hasattr(self,"exception"): + self.exception.msg = self.errmsg return self def setResultsName( self, name, listAllMatches=False ): @@ -612,6 +616,24 @@ newself.modalResults = not listAllMatches return newself + def setBreak(self,breakFlag = True): + """Method to invoke the Python pdb debugger when this element is + about to be parsed. Set breakFlag to True to enable, False to + disable. + """ + if breakFlag: + _parseMethod = self._parse + def breaker(instring, loc, doActions=True, callPreParse=True): + import pdb + pdb.set_trace() + _parseMethod( instring, loc, doActions, callPreParse ) + breaker._originalParseMethod = _parseMethod + self._parse = breaker + else: + if hasattr(self._parse,"_originalParseMethod"): + self._parse = self._parse._originalParseMethod + return self + def normalizeParseActionArgs( f ): """Internal method used to decorate parse actions that take fewer than 3 arguments, so that all parse actions can be called as f(s,l,t).""" @@ -774,7 +796,7 @@ self.failAction( instring, tokensStart, self, err ) raise else: - if callPreParse: + if callPreParse and self.callPreparse: preloc = self.preParse( instring, loc ) else: preloc = loc @@ -827,8 +849,6 @@ # this method gets repeatedly called during backtracking with the same arguments - # we can cache these arguments and save ourselves the trouble of re-parsing the contained expression def _parseCache( self, instring, loc, doActions=True, callPreParse=True ): - #if doActions and self.parseAction: - # return self._parseNoCache( instring, loc, doActions, callPreParse ) lookup = (self,instring,loc,callPreParse,doActions) if lookup in ParserElement._exprArgCache: value = ParserElement._exprArgCache[ lookup ] @@ -836,11 +856,11 @@ if isinstance(value,ParseBaseException): value.loc = loc raise value - return value + return (value[0],value[1].copy()) else: try: - ParserElement._exprArgCache[ lookup ] = \ - value = self._parseNoCache( instring, loc, doActions, callPreParse ) + value = self._parseNoCache( instring, loc, doActions, callPreParse ) + ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy()) return value except ParseBaseException, pe: ParserElement._exprArgCache[ lookup ] = pe @@ -1046,6 +1066,14 @@ """Implementation of ~ operator - returns NotAny""" return NotAny( self ) + def __call__(self, name): + """Shortcut for setResultsName, with listAllMatches=default:: + userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno") + could be written as:: + userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") + """ + return self.setResultsName(name) + def suppress( self ): """Suppresses the output of this ParserElement; useful to keep punctuation from cluttering up returned output. @@ -1096,7 +1124,8 @@ return self def setDebug( self, flag=True ): - """Enable display of debugging messages while doing pattern matching.""" + """Enable display of debugging messages while doing pattern matching. + Set flag to True to enable, False to disable.""" if flag: self.setDebugActions( _defaultStartDebugAction, _defaultSuccessDebugAction, _defaultExceptionDebugAction ) else: @@ -1134,20 +1163,29 @@ f.close() return self.parseString(file_contents) + def getException(self): + return ParseException("",0,self.errmsg,self) + + def __getattr__(self,aname): + if aname == "myException": + self.myException = ret = self.getException(); + return ret; + else: + raise AttributeError, "no such attribute " + aname class Token(ParserElement): """Abstract ParserElement subclass, for defining atomic matching patterns.""" def __init__( self ): super(Token,self).__init__( savelist=False ) - self.myException = ParseException("",0,"",self) + #self.myException = ParseException("",0,"",self) def setName(self, name): s = super(Token,self).setName(name) self.errmsg = "Expected " + self.name - s.myException.msg = self.errmsg + #s.myException.msg = self.errmsg return s + - class Empty(Token): """An empty token, will always match.""" def __init__( self ): @@ -1165,7 +1203,7 @@ self.mayReturnEmpty = True self.mayIndexError = False self.errmsg = "Unmatchable token" - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg def parseImpl( self, instring, loc, doActions=True ): exc = self.myException @@ -1189,7 +1227,7 @@ self.name = '"%s"' % _ustr(self.match) self.errmsg = "Expected " + self.name self.mayReturnEmpty = False - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg self.mayIndexError = False # Performance tuning: this routine gets called a *lot* @@ -1230,7 +1268,7 @@ self.name = '"%s"' % self.match self.errmsg = "Expected " + self.name self.mayReturnEmpty = False - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg self.mayIndexError = False self.caseless = caseless if caseless: @@ -1279,7 +1317,7 @@ self.returnString = matchString self.name = "'%s'" % self.returnString self.errmsg = "Expected " + self.name - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg def parseImpl( self, instring, loc, doActions=True ): if instring[ loc:loc+self.matchLen ].upper() == self.match: @@ -1309,7 +1347,9 @@ Defined with string containing all allowed initial characters, an optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, - maximum, and/or exact length. + maximum, and/or exact length. The default value for min is 1 (a + minimum value < 1 is not valid); the default values for max and exact + are 0, meaning no maximum or exact length restriction. """ def __init__( self, initChars, bodyChars=None, min=1, max=0, exact=0, asKeyword=False ): super(Word,self).__init__() @@ -1323,6 +1363,9 @@ self.bodyChars = _str2dict(initChars) self.maxSpecified = max > 0 + + if min < 1: + raise ValueError, "cannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permitted" self.minLen = min @@ -1337,7 +1380,7 @@ self.name = _ustr(self) self.errmsg = "Expected " + self.name - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg self.mayIndexError = False self.asKeyword = asKeyword @@ -1452,7 +1495,7 @@ self.name = _ustr(self) self.errmsg = "Expected " + self.name - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg self.mayIndexError = False self.mayReturnEmpty = True @@ -1557,7 +1600,7 @@ self.name = _ustr(self) self.errmsg = "Expected " + self.name - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg self.mayIndexError = False self.mayReturnEmpty = True @@ -1603,13 +1646,18 @@ class CharsNotIn(Token): """Token for matching words composed of characters *not* in a given set. Defined with string containing all disallowed characters, and an optional - minimum, maximum, and/or exact length. + minimum, maximum, and/or exact length. The default value for min is 1 (a + minimum value < 1 is not valid); the default values for max and exact + are 0, meaning no maximum or exact length restriction. """ def __init__( self, notChars, min=1, max=0, exact=0 ): super(CharsNotIn,self).__init__() self.skipWhitespace = False self.notChars = notChars + if min < 1: + raise ValueError, "cannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permitted" + self.minLen = min if max > 0: @@ -1624,7 +1672,7 @@ self.name = _ustr(self) self.errmsg = "Expected " + self.name self.mayReturnEmpty = ( self.minLen == 0 ) - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg self.mayIndexError = False def parseImpl( self, instring, loc, doActions=True ): @@ -1687,7 +1735,7 @@ self.name = ("".join([White.whiteStrs[c] for c in self.matchWhite])) self.mayReturnEmpty = True self.errmsg = "Expected " + self.name - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg self.minLen = min @@ -1760,7 +1808,7 @@ super(LineStart,self).__init__() self.setWhitespaceChars( " \t" ) self.errmsg = "Expected start of line" - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg def preParse( self, instring, loc ): preloc = super(LineStart,self).preParse(instring,loc) @@ -1785,7 +1833,7 @@ super(LineEnd,self).__init__() self.setWhitespaceChars( " \t" ) self.errmsg = "Expected end of line" - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg def parseImpl( self, instring, loc, doActions=True ): if loc<len(instring): @@ -1810,7 +1858,7 @@ def __init__( self ): super(StringStart,self).__init__() self.errmsg = "Expected start of text" - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg def parseImpl( self, instring, loc, doActions=True ): if loc != 0: @@ -1828,7 +1876,7 @@ def __init__( self ): super(StringEnd,self).__init__() self.errmsg = "Expected end of text" - self.myException.msg = self.errmsg + #self.myException.msg = self.errmsg def parseImpl( self, instring, loc, doActions=True ): if loc < len(instring): @@ -1839,6 +1887,8 @@ raise exc elif loc == len(instring): return loc+1, [] + elif loc > len(instring): + return loc, [] else: exc = self.myException exc.loc = loc @@ -2104,6 +2154,7 @@ for e in self.exprs: e.checkRecursion( subRecCheckList ) + class Each(ParseExpression): """Requires all given ParseExpressions to be found, but in any order. Expressions may be separated by whitespace. @@ -2198,6 +2249,7 @@ self.setWhitespaceChars( expr.whiteChars ) self.skipWhitespace = expr.skipWhitespace self.saveAsList = expr.saveAsList + self.callPreparse = expr.callPreparse def parseImpl( self, instring, loc, doActions=True ): if self.expr is not None: @@ -2280,7 +2332,7 @@ self.skipWhitespace = False # do NOT use self.leaveWhitespace(), don't want to propagate to exprs self.mayReturnEmpty = True self.errmsg = "Found unwanted token, "+_ustr(self.expr) - self.myException = ParseException("",0,self.errmsg,self) + #self.myException = ParseException("",0,self.errmsg,self) def parseImpl( self, instring, loc, doActions=True ): try: @@ -2431,7 +2483,7 @@ self.includeMatch = include self.asList = False self.errmsg = "No match found for "+_ustr(self.expr) - self.myException = ParseException("",0,self.errmsg,self) + #self.myException = ParseException("",0,self.errmsg,self) def parseImpl( self, instring, loc, doActions=True ): startLoc = loc @@ -2601,7 +2653,11 @@ def postParse( self, instring, loc, tokenlist ): for i,tok in enumerate(tokenlist): - ikey = _ustr(tok[0]).strip() + if len(tok) == 0: + continue + ikey = tok[0] + if isinstance(ikey,int): + ikey = _ustr(tok[0]).strip() if len(tok)==1: tokenlist[ikey] = _ParseResultsWithOffset("",i) elif len(tok)==2 and not isinstance(tok[1],ParseResults): @@ -2940,7 +2996,7 @@ tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printablesLessRAbrack) openTag = Suppress("<") + tagStr + \ Dict(ZeroOrMore(Group( tagAttrName.setParseAction(downcaseTokens) + \ - Suppress("=") + tagAttrValue ))) + \ + Optional( Suppress("=") + tagAttrValue ) ))) + \ Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") closeTag = Combine("</" + tagStr + ">") @@ -2957,10 +3013,47 @@ """Helper to construct opening and closing tag expressions for XML, given a tag name""" return _makeTags( tagStr, True ) +def withAttribute(*args,**attrDict): + """Helper to create a validating parse action to be used with start tags created + with makeXMLTags or makeHTMLTags. Use withAttribute to qualify a starting tag + with a required attribute value, to avoid false matches on common tags such as + <TD> or <DIV>. + + Call withAttribute with a series of attribute names and values. Specify the list + of filter attributes names and values as: + - keyword arguments, as in (class="Customer",align="right"), or + - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) + For attribute names with a namespace prefix, you must use the second form. Attribute + names are matched insensitive to upper/lower case. + """ + if args: + attrs = args[:] + else: + attrs = attrDict.items() + attrs = [(k.lower(),v) for k,v in attrs] + def pa(s,l,tokens): + for attrName,attrValue in attrs: + if attrName not in tokens: + raise ParseException(s,l,"no matching attribute " + attrName) + if tokens[attrName] != attrValue: + raise ParseException(s,l,"attribute '%s' has value '%s', must be '%s'" % + (attrName, tokens[attrName], attrValue)) + return pa + opAssoc = _Constants() opAssoc.LEFT = object() opAssoc.RIGHT = object() +def _flattenOpPrecTokens(tokens): + if isinstance(tokens,ParseResults): + if len(tokens)==1: + if isinstance(tokens[0],ParseResults): + return _flattenOpPrecTokens(tokens[0]) + else: + return tokens[0] + return map(_flattenOpPrecTokens,tokens) + return tokens + def operatorPrecedence( baseExpr, opList ): """Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or @@ -2969,7 +3062,8 @@ Parameters: - baseExpr - expression representing the most basic element for the nested - - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form + - opList - list of tuples, one for each operator precedence level in the + expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal @@ -2986,12 +3080,12 @@ lastExpr = baseExpr | ( Suppress('(') + ret + Suppress(')') ) for i,operDef in enumerate(opList): opExpr,arity,rightLeftAssoc,pa = (operDef + (None,))[:4] - thisExpr = Forward().setName("expr%d" % i) + thisExpr = Forward()#.setName("expr%d" % i) if rightLeftAssoc == opAssoc.LEFT: if arity == 1: - matchExpr = Group( lastExpr + opExpr ) + matchExpr = Group( lastExpr + ZeroOrMore( opExpr ) ) elif arity == 2: - matchExpr = Group( lastExpr + OneOrMore( opExpr + lastExpr ) ) + matchExpr = Group( lastExpr + ZeroOrMore( opExpr + lastExpr ) ) else: raise ValueError, "operator must be unary (1) or binary (2)" elif rightLeftAssoc == opAssoc.RIGHT: @@ -3000,26 +3094,63 @@ if not isinstance(opExpr, Optional): opExpr = Optional(opExpr) matchExpr = FollowedBy(opExpr.expr + thisExpr) + Group( opExpr + thisExpr ) + matchExpr |= lastExpr elif arity == 2: - matchExpr = Group( lastExpr + OneOrMore( opExpr + thisExpr ) ) + matchExpr = Group( lastExpr + ZeroOrMore( opExpr + thisExpr ) ) else: raise ValueError, "operator must be unary (1) or binary (2)" else: raise ValueError, "operator must indicate right or left associativity" if pa: matchExpr.setParseAction( pa ) - thisExpr << ( matchExpr | lastExpr ) + thisExpr << ( matchExpr ) lastExpr = thisExpr ret << lastExpr + ret.setParseAction(_flattenOpPrecTokens) + return Group(ret) + +dblQuotedString = Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\.))*"').setName("string enclosed in double quotes") +sglQuotedString = Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\.))*'").setName("string enclosed in single quotes") +quotedString = Regex(r'''(?:"(?:[^"\n\r\\]|(?:"")|(?:\\.))*")|(?:'(?:[^'\n\r\\]|(?:'')|(?:\\.))*')''').setName("quotedString using single or double quotes") + +def nestedExpr(opener="(", closer=")", content=None, ignoreExpr=quotedString): + """Helper method for defining nested lists enclosed in opening and closing + delimiters ("(" and ")" are the default). + + Parameters: + - opener - opening character for a nested list (default="("); can also be a pyparsing expression + - closer - closing character for a nested list (default=")"); can also be a pyparsing expression + - content - expression for items within the nested lists (default=None) + - ignoreExpr - expression for ignoring opening and closing delimiters (default=quotedString) + + If an expression is not provided for the content argument, the nested + expression will capture all whitespace-delimited content between delimiters + as a list of separate values. + + Use the ignoreExpr argument to define expressions that may contain + opening or closing characters that should not be treated as opening + or closing characters for nesting, such as quotedString or a comment + expression. Specify multiple expressions using an Or or MatchFirst. + The default is quotedString, but if no expressions are to be ignored, + then pass None for this argument. + """ + if opener == closer: + raise ValueError("opening and closing strings cannot be the same") + if content is None: + if isinstance(opener,basestring) and isinstance(closer,basestring): + content = (empty+CharsNotIn(opener+closer+ParserElement.DEFAULT_WHITE_CHARS).setParseAction(lambda t:t[0].strip())) + else: + raise ValueError("opening and closing arguments must be strings if no content expression is given") + ret = Forward() + if ignoreExpr is not None: + ret << ZeroOrMore( ignoreExpr | content | Group( Suppress(opener) + ret + Suppress(closer) ) ) + else: + ret << ZeroOrMore( content | Group( Suppress(opener) + ret + Suppress(closer) ) ) return ret alphas8bit = srange(r"[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]") punc8bit = srange(r"[\0xa1-\0xbf\0xd7\0xf7]") -dblQuotedString = Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\.))*"').setName("string enclosed in double quotes") -sglQuotedString = Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\.))*'").setName("string enclosed in single quotes") -quotedString = Regex(r'''(?:"(?:[^"\n\r\\]|(?:"")|(?:\\.))*")|(?:'(?:[^'\n\r\\]|(?:'')|(?:\\.))*')''').setName("quotedString using single or double quotes") - anyOpenTag,anyCloseTag = makeHTMLTags(Word(alphas,alphanums+"_:")) commonHTMLEntity = Combine("&" + oneOf("gt lt amp nbsp quot").setResultsName("entity") +";") _htmlEntityMap = dict(zip("gt lt amp nbsp quot".split(),"><& '")) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2007-11-08 23:29:49
|
Revision: 4168 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4168&view=rev Author: jdh2358 Date: 2007-11-08 15:29:46 -0800 (Thu, 08 Nov 2007) Log Message: ----------- added recarray utils module Modified Paths: -------------- trunk/matplotlib/API_CHANGES trunk/matplotlib/CHANGELOG trunk/matplotlib/examples/date_index_formatter.py trunk/matplotlib/examples/loadrec.py trunk/matplotlib/examples/mathtext_examples.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/cbook.py trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/API_CHANGES =================================================================== --- trunk/matplotlib/API_CHANGES 2007-11-08 23:25:44 UTC (rev 4167) +++ trunk/matplotlib/API_CHANGES 2007-11-08 23:29:46 UTC (rev 4168) @@ -1,3 +1,5 @@ + Moved mlab.csv2rec -> recutils.csv2rec + Added ax kwarg to pyplot.colorbar and Figure.colorbar so that one can specify the axes object from which space for the colorbar is to be taken, if one does not want to make the colorbar axes Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-08 23:25:44 UTC (rev 4167) +++ trunk/matplotlib/CHANGELOG 2007-11-08 23:29:46 UTC (rev 4168) @@ -1,3 +1,6 @@ +2007-11-08 Moved csv2rec to recutils and added other record array + utilities - JDH + 2007-11-08 If available, use existing pyparsing installation - DSD 2007-11-07 Removed old enthought.traits from lib/matplotlib, added Modified: trunk/matplotlib/examples/date_index_formatter.py =================================================================== --- trunk/matplotlib/examples/date_index_formatter.py 2007-11-08 23:25:44 UTC (rev 4167) +++ trunk/matplotlib/examples/date_index_formatter.py 2007-11-08 23:29:46 UTC (rev 4168) @@ -9,7 +9,7 @@ """ import numpy -from matplotlib.mlab import csv2rec +from matplotlib.recutils import csv2rec from pylab import figure, show from matplotlib.ticker import Formatter Modified: trunk/matplotlib/examples/loadrec.py =================================================================== --- trunk/matplotlib/examples/loadrec.py 2007-11-08 23:25:44 UTC (rev 4167) +++ trunk/matplotlib/examples/loadrec.py 2007-11-08 23:29:46 UTC (rev 4168) @@ -1,4 +1,4 @@ -from matplotlib.mlab import csv2rec +from matplotlib.recutils import csv2rec from pylab import figure, show a = csv2rec('data/msft.csv') Modified: trunk/matplotlib/examples/mathtext_examples.py =================================================================== --- trunk/matplotlib/examples/mathtext_examples.py 2007-11-08 23:25:44 UTC (rev 4167) +++ trunk/matplotlib/examples/mathtext_examples.py 2007-11-08 23:29:46 UTC (rev 4168) @@ -49,7 +49,7 @@ r'$\widehat{abc}\widetilde{def}$', r'$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$', r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$', - ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$' + #ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$' ] from pylab import * @@ -63,12 +63,13 @@ axis([0, 3, -len(tests), 0]) yticks(arange(len(tests)) * -1) for i, s in enumerate(tests): - print "%02d: %s" % (i, s) + print (i, s) text(0.1, -i, s, fontsize=20) - savefig('mathtext_example') - close('all') - + #savefig('mathtext_example') + #close('all') + show() + if '--latex' in sys.argv: fd = open("mathtext_examples.ltx", "w") fd.write("\\documentclass{article}\n") Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2007-11-08 23:25:44 UTC (rev 4167) +++ trunk/matplotlib/lib/matplotlib/axes.py 2007-11-08 23:29:46 UTC (rev 4168) @@ -4068,6 +4068,8 @@ Optional kwargs control the PatchCollection properties: %(PatchCollection)s + + A Collection instance is returned """ if not self._hold: self.cla() Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2007-11-08 23:25:44 UTC (rev 4167) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2007-11-08 23:29:46 UTC (rev 4168) @@ -853,6 +853,7 @@ raise ValueError(_safezip_msg % (Nx, i+1, len(arg))) return zip(*args) + class MemoryMonitor: def __init__(self, nmax=20000): self._nmax = nmax @@ -895,12 +896,14 @@ x = npy.arange(i0, self._n, isub) return x, self._mem[i0:self._n:isub] - def plot(self, i0=0, isub=1): - from pylab import figure, show - fig = figure() + def plot(self, i0=0, isub=1, fig=None): + if fig is None: + from pylab import figure, show + fig = figure() + ax = fig.add_subplot(111) ax.plot(*self.xy(i0, isub)) - show() + fig.canvas.draw() def print_cycles(objects, outstream=sys.stdout, show_progress=False): Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2007-11-08 23:25:44 UTC (rev 4167) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2007-11-08 23:29:46 UTC (rev 4168) @@ -1257,415 +1257,7 @@ if unpack: return X.transpose() else: return X -def csv2rec(fname, comments='#', skiprows=0, checkrows=5, delimiter=',', - converterd=None, names=None, missing=None): - """ - Load data from comma/space/tab delimited file in fname into a - numpy record array and return the record array. - If names is None, a header row is required to automatically assign - the recarray names. The headers will be lower cased, spaces will - be converted to underscores, and illegal attribute name characters - removed. If names is not None, it is a sequence of names to use - for the column names. In this case, it is assumed there is no header row. - - - fname - can be a filename or a file handle. Support for gzipped - files is automatic, if the filename ends in .gz - - comments - the character used to indicate the start of a comment - in the file - - skiprows - is the number of rows from the top to skip - - checkrows - is the number of rows to check to validate the column - data type. When set to zero all rows are validated. - - converterd, if not None, is a dictionary mapping column number or - munged column name to a converter function - - names, if not None, is a list of header names. In this case, no - header will be read from the file - - if no rows are found, None is returned See examples/loadrec.py - """ - - if converterd is None: - converterd = dict() - - import dateutil.parser - parsedate = dateutil.parser.parse - - - fh = cbook.to_filehandle(fname) - - - class FH: - """ - for space delimited files, we want different behavior than - comma or tab. Generally, we want multiple spaces to be - treated as a single separator, whereas with comma and tab we - want multiple commas to return multiple (empty) fields. The - join/strip trick below effects this - """ - def __init__(self, fh): - self.fh = fh - - def close(self): - self.fh.close() - - def seek(self, arg): - self.fh.seek(arg) - - def fix(self, s): - return ' '.join(s.split()) - - - def next(self): - return self.fix(self.fh.next()) - - def __iter__(self): - for line in self.fh: - yield self.fix(line) - - if delimiter==' ': - fh = FH(fh) - - reader = csv.reader(fh, delimiter=delimiter) - def process_skiprows(reader): - if skiprows: - for i, row in enumerate(reader): - if i>=(skiprows-1): break - - return fh, reader - - process_skiprows(reader) - - - def myfloat(x): - if x==missing: - return npy.nan - else: - return float(x) - - def get_func(item, func): - # promote functions in this order - funcmap = {int:myfloat, myfloat:dateutil.parser.parse, dateutil.parser.parse:str} - try: func(item) - except: - if func==str: - raise ValueError('Could not find a working conversion function') - else: return get_func(item, funcmap[func]) # recurse - else: return func - - - # map column names that clash with builtins -- TODO - extend this list - itemd = { - 'return' : 'return_', - 'file' : 'file_', - 'print' : 'print_', - } - - def get_converters(reader): - - converters = None - for i, row in enumerate(reader): - if i==0: - converters = [int]*len(row) - if checkrows and i>checkrows: - break - #print i, len(names), len(row) - #print 'converters', zip(converters, row) - for j, (name, item) in enumerate(zip(names, row)): - func = converterd.get(j) - if func is None: - func = converterd.get(name) - if func is None: - if not item.strip(): continue - func = converters[j] - if len(item.strip()): - func = get_func(item, func) - converters[j] = func - return converters - - # Get header and remove invalid characters - needheader = names is None - if needheader: - headers = reader.next() - # remove these chars - delete = set("""~!@#$%^&*()-=+~\|]}[{';: /?.>,<""") - delete.add('"') - - names = [] - seen = dict() - for i, item in enumerate(headers): - item = item.strip().lower().replace(' ', '_') - item = ''.join([c for c in item if c not in delete]) - if not len(item): - item = 'column%d'%i - - item = itemd.get(item, item) - cnt = seen.get(item, 0) - if cnt>0: - names.append(item + '%d'%cnt) - else: - names.append(item) - seen[item] = cnt+1 - - # get the converter functions by inspecting checkrows - converters = get_converters(reader) - if converters is None: - raise ValueError('Could not find any valid data in CSV file') - - # reset the reader and start over - fh.seek(0) - process_skiprows(reader) - if needheader: - skipheader = reader.next() - - # iterate over the remaining rows and convert the data to date - # objects, ints, or floats as approriate - rows = [] - for i, row in enumerate(reader): - if not len(row): continue - if row[0].startswith(comments): continue - rows.append([func(val) for func, val in zip(converters, row)]) - fh.close() - - if not len(rows): - return None - r = npy.rec.fromrecords(rows, names=names) - return r - - -def rec2csv(r, fname, delimiter=','): - """ - Save the data from numpy record array r into a comma/space/tab - delimited file. The record array dtype names will be used for - column headers. - - - fname - can be a filename or a file handle. Support for gzipped - files is automatic, if the filename ends in .gz - """ - fh = cbook.to_filehandle(fname, 'w') - writer = csv.writer(fh, delimiter=delimiter, quoting=csv.QUOTE_NONNUMERIC) - header = r.dtype.names - writer.writerow(header) - for row in r: - writer.writerow(map(str, row)) - fh.close() - -try: - import pyExcelerator as excel -except ImportError: - pass -else: - - class Format: - xlstyle = None - def convert(self, x): - return x - - class FormatFloat(Format): - def __init__(self, precision=4): - self.xlstyle = excel.XFStyle() - zeros = ''.join(['0']*precision) - self.xlstyle.num_format_str = '#,##0.%s;[RED]-#,##0.%s'%(zeros, zeros) - - class FormatInt(Format): - convert = int - def __init__(self): - - self.xlstyle = excel.XFStyle() - self.xlstyle.num_format_str = '#,##;[RED]-#,##' - - class FormatPercent(Format): - def __init__(self, precision=4): - self.xlstyle = excel.XFStyle() - zeros = ''.join(['0']*precision) - self.xlstyle.num_format_str = '0.%s%;[RED]-0.%s%'%(zeros, zeros) - - class FormatThousands(FormatFloat): - def __init__(self, precision=1): - FormatFloat.__init__(self, precision) - - def convert(self, x): - return x/1e3 - - class FormatMillions(FormatFloat): - def __init__(self, precision=1): - FormatFloat.__init__(self, precision) - - def convert(self, x): - return x/1e6 - - class FormatDate(Format): - def __init__(self, fmt='%Y-%m-%d'): - self.fmt = fmt - - def convert(self, val): - return val.strftime(self.fmt) - - class FormatDatetime(Format): - def __init__(self, fmt='%Y-%m-%d %H:%M:%S'): - self.fmt = fmt - - def convert(self, val): - return val.strftime(self.fmt) - - class FormatObject(Format): - - def convert(self, x): - return str(x) - - def rec2excel(ws, r, formatd=None, rownum=0): - """ - save record array r to excel pyExcelerator worksheet ws - starting at rownum - - formatd is a dictionary mapping dtype name -> Format instances - """ - - if formatd is None: - formatd = dict() - - formats = [] - for i, name in enumerate(r.dtype.names): - dt = r.dtype[name] - format = formatd.get(name) - if format is None: - format = rec2excel.formatd.get(dt.type, FormatObject()) - - ws.write(rownum, i, name) - formats.append(format) - - rownum+=1 - - ind = npy.arange(len(r.dtype.names)) - for row in r: - for i in ind: - val = row[i] - format = formats[i] - val = format.convert(val) - if format.xlstyle is None: - ws.write(rownum, i, val) - else: - ws.write(rownum, i, val, format.xlstyle) - rownum += 1 - rec2excel.formatd = { - npy.int16 : FormatInt(), - npy.int32 : FormatInt(), - npy.int64 : FormatInt(), - npy.float32 : FormatFloat(), - npy.float64 : FormatFloat(), - npy.object_ : FormatObject(), - npy.string_ : Format(), - } - - - -# some record array helpers -def rec_append_field(rec, name, arr, dtype=None): - 'return a new record array with field name populated with data from array arr' - arr = npy.asarray(arr) - if dtype is None: - dtype = arr.dtype - newdtype = npy.dtype(rec.dtype.descr + [(name, dtype)]) - newrec = npy.empty(rec.shape, dtype=newdtype) - for field in rec.dtype.fields: - newrec[field] = rec[field] - newrec[name] = arr - return newrec.view(npy.recarray) - - -def rec_drop_fields(rec, names): - 'return a new numpy record array with fields in names dropped' - - names = set(names) - Nr = len(rec) - - newdtype = npy.dtype([(name, rec.dtype[name]) for name in rec.dtype.names - if name not in names]) - - newrec = npy.empty(Nr, dtype=newdtype) - for field in newdtype.names: - newrec[field] = rec[field] - - return newrec.view(npy.recarray) - - -def rec_join(key, r1, r2): - """ - join record arrays r1 and r2 on key; key is a tuple of field - names. if r1 and r2 have equal values on all the keys in the key - tuple, then their fields will be merged into a new record array - containing the union of the fields of r1 and r2 - """ - - for name in key: - if name not in r1.dtype.names: - raise ValueError('r1 does not have key field %s'%name) - if name not in r2.dtype.names: - raise ValueError('r2 does not have key field %s'%name) - - def makekey(row): - return tuple([row[name] for name in key]) - - - names = list(r1.dtype.names) + [name for name in r2.dtype.names if name not in set(r1.dtype.names)] - - - - r1d = dict([(makekey(row),i) for i,row in enumerate(r1)]) - r2d = dict([(makekey(row),i) for i,row in enumerate(r2)]) - - r1keys = set(r1d.keys()) - r2keys = set(r2d.keys()) - - keys = r1keys & r2keys - - r1ind = [r1d[k] for k in keys] - r2ind = [r2d[k] for k in keys] - - - r1 = r1[r1ind] - r2 = r2[r2ind] - - r2 = rec_drop_fields(r2, r1.dtype.names) - - - def key_desc(name): - 'if name is a string key, use the larger size of r1 or r2 before merging' - dt1 = r1.dtype[name] - if dt1.type != npy.string_: - return (name, dt1.descr[0][1]) - - dt2 = r1.dtype[name] - assert dt2==dt1 - if dt1.num>dt2.num: - return (name, dt1.descr[0][1]) - else: - return (name, dt2.descr[0][1]) - - - - keydesc = [key_desc(name) for name in key] - - newdtype = npy.dtype(keydesc + - [desc for desc in r1.dtype.descr if desc[0] not in key ] + - [desc for desc in r2.dtype.descr if desc[0] not in key ] ) - - - newrec = npy.empty(len(r1), dtype=newdtype) - for field in r1.dtype.names: - newrec[field] = r1[field] - - for field in r2.dtype.names: - newrec[field] = r2[field] - - return newrec.view(npy.recarray) - def slopes(x,y): """ SLOPES calculate the slope y'(x) Given data vectors X and Y SLOPES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-08 23:25:53
|
Revision: 4167 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4167&view=rev Author: dsdale Date: 2007-11-08 15:25:44 -0800 (Thu, 08 Nov 2007) Log Message: ----------- move pyparsing from lib/matplotlib/ to lib/ install pyparsing only if not already available Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py trunk/matplotlib/lib/matplotlib/mathtext.py trunk/matplotlib/setup.py Added Paths: ----------- trunk/matplotlib/lib/pyparsing.py Removed Paths: ------------- trunk/matplotlib/lib/matplotlib/pyparsing.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-08 22:29:29 UTC (rev 4166) +++ trunk/matplotlib/CHANGELOG 2007-11-08 23:25:44 UTC (rev 4167) @@ -1,3 +1,10 @@ +2007-11-08 If available, use existing pyparsing installation - DSD + +2007-11-07 Removed old enthought.traits from lib/matplotlib, added + Gael Varoquaux's enthought.traits-2.6b1, which is stripped + of setuptools. The package is installed to site-packages + if not already available - DSD + 2007-11-02 Commited Phil Thompson's patch 1599876, fixes to Qt4Agg backend and qt4 blitting demo - DSD Modified: trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py =================================================================== --- trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py 2007-11-08 22:29:29 UTC (rev 4166) +++ trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py 2007-11-08 23:25:44 UTC (rev 4167) @@ -18,8 +18,8 @@ License : matplotlib license (PSF compatible) """ import re -from matplotlib.pyparsing import Literal, OneOrMore, ZeroOrMore, \ - Optional, Regex, StringEnd, ParseException, Suppress +from pyparsing import Literal, OneOrMore, ZeroOrMore, Optional, Regex, \ + StringEnd, ParseException, Suppress family_punc = r'\\\-:,' family_unescape = re.compile(r'\\([%s])' % family_punc).sub Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-08 22:29:29 UTC (rev 4166) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-08 23:25:44 UTC (rev 4167) @@ -134,11 +134,11 @@ from numpy import inf, isinf from matplotlib import verbose -from matplotlib.pyparsing import Literal, Word, OneOrMore, ZeroOrMore, \ - Combine, Group, Optional, Forward, NotAny, alphas, nums, alphanums, \ - StringStart, StringEnd, ParseFatalException, FollowedBy, Regex, \ - operatorPrecedence, opAssoc, ParseResults, Or, Suppress, oneOf, \ - ParseException, MatchFirst, NoMatch, Empty +from pyparsing import Literal, Word, OneOrMore, ZeroOrMore, Combine, Group, \ + Optional, Forward, NotAny, alphas, nums, alphanums, StringStart, \ + StringEnd, ParseFatalException, FollowedBy, Regex, operatorPrecedence, \ + opAssoc, ParseResults, Or, Suppress, oneOf, ParseException, MatchFirst, \ + NoMatch, Empty from matplotlib.afm import AFM from matplotlib.cbook import enumerate, iterable, Bunch, get_realpath_and_stat, \ Deleted: trunk/matplotlib/lib/matplotlib/pyparsing.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyparsing.py 2007-11-08 22:29:29 UTC (rev 4166) +++ trunk/matplotlib/lib/matplotlib/pyparsing.py 2007-11-08 23:25:44 UTC (rev 4167) @@ -1,3086 +0,0 @@ -# module pyparsing.py -# -# Copyright (c) 2003-2007 Paul T. McGuire -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -#from __future__ import generators - -__doc__ = \ -""" -pyparsing module - Classes and methods to define and execute parsing grammars - -The pyparsing module is an alternative approach to creating and executing simple grammars, -vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you -don't need to learn a new syntax for defining grammars or matching expressions - the parsing module -provides a library of classes that you use to construct the grammar directly in Python. - -Here is a program to parse "Hello, World!" (or any greeting of the form "<salutation>, <addressee>!"):: - - from pyparsing import Word, alphas - - # define grammar of a greeting - greet = Word( alphas ) + "," + Word( alphas ) + "!" - - hello = "Hello, World!" - print hello, "->", greet.parseString( hello ) - -The program outputs the following:: - - Hello, World! -> ['Hello', ',', 'World', '!'] - -The Python representation of the grammar is quite readable, owing to the self-explanatory -class names, and the use of '+', '|' and '^' operators. - -The parsed results returned from parseString() can be accessed as a nested list, a dictionary, or an -object with named attributes. - -The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - - quoted strings - - embedded comments -""" -__version__ = "1.4.6" -__versionTime__ = "11 April 2007 16:41" -__author__ = "Paul McGuire <pt...@us...>" - -import string -from weakref import ref as wkref -import copy,sys -import warnings -import re -import sre_constants -import xml.sax.saxutils -#~ sys.stderr.write( "testing pyparsing module, version %s, %s\n" % (__version__,__versionTime__ ) ) - -def _ustr(obj): - """Drop-in replacement for str(obj) that tries to be Unicode friendly. It first tries - str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It - then < returns the unicode object | encodes it with the default encoding | ... >. - """ - try: - # If this works, then _ustr(obj) has the same behaviour as str(obj), so - # it won't break any existing code. - return str(obj) - - except UnicodeEncodeError, e: - # The Python docs (http://docs.python.org/ref/customization.html#l2h-182) - # state that "The return value must be a string object". However, does a - # unicode object (being a subclass of basestring) count as a "string - # object"? - # If so, then return a unicode object: - return unicode(obj) - # Else encode it... but how? There are many choices... :) - # Replace unprintables with escape codes? - #return unicode(obj).encode(sys.getdefaultencoding(), 'backslashreplace_errors') - # Replace unprintables with question marks? - #return unicode(obj).encode(sys.getdefaultencoding(), 'replace') - # ... - -def _str2dict(strg): - return dict( [(c,0) for c in strg] ) - #~ return set( [c for c in strg] ) - -class _Constants(object): - pass - -alphas = string.lowercase + string.uppercase -nums = string.digits -hexnums = nums + "ABCDEFabcdef" -alphanums = alphas + nums - -class ParseBaseException(Exception): - """base exception class for all parsing runtime exceptions""" - __slots__ = ( "loc","msg","pstr","parserElement" ) - # Performance tuning: we construct a *lot* of these, so keep this - # constructor as small and fast as possible - def __init__( self, pstr, loc=0, msg=None, elem=None ): - self.loc = loc - if msg is None: - self.msg = pstr - self.pstr = "" - else: - self.msg = msg - self.pstr = pstr - self.parserElement = elem - - def __getattr__( self, aname ): - """supported attributes by name are: - - lineno - returns the line number of the exception text - - col - returns the column number of the exception text - - line - returns the line containing the exception text - """ - if( aname == "lineno" ): - return lineno( self.loc, self.pstr ) - elif( aname in ("col", "column") ): - return col( self.loc, self.pstr ) - elif( aname == "line" ): - return line( self.loc, self.pstr ) - else: - raise AttributeError, aname - - def __str__( self ): - return "%s (at char %d), (line:%d, col:%d)" % \ - ( self.msg, self.loc, self.lineno, self.column ) - def __repr__( self ): - return _ustr(self) - def markInputline( self, markerString = ">!<" ): - """Extracts the exception line from the input string, and marks - the location of the exception with a special symbol. - """ - line_str = self.line - line_column = self.column - 1 - if markerString: - line_str = "".join( [line_str[:line_column], - markerString, line_str[line_column:]]) - return line_str.strip() - -class ParseException(ParseBaseException): - """exception thrown when parse expressions don't match class; - supported attributes by name are: - - lineno - returns the line number of the exception text - - col - returns the column number of the exception text - - line - returns the line containing the exception text - """ - pass - -class ParseFatalException(ParseBaseException): - """user-throwable exception thrown when inconsistent parse content - is found; stops all parsing immediately""" - pass - -#~ class ReparseException(ParseBaseException): - #~ """Experimental class - parse actions can raise this exception to cause - #~ pyparsing to reparse the input string: - #~ - with a modified input string, and/or - #~ - with a modified start location - #~ Set the values of the ReparseException in the constructor, and raise the - #~ exception in a parse action to cause pyparsing to use the new string/location. - #~ Setting the values as None causes no change to be made. - #~ """ - #~ def __init_( self, newstring, restartLoc ): - #~ self.newParseText = newstring - #~ self.reparseLoc = restartLoc - -class RecursiveGrammarException(Exception): - """exception thrown by validate() if the grammar could be improperly recursive""" - def __init__( self, parseElementList ): - self.parseElementTrace = parseElementList - - def __str__( self ): - return "RecursiveGrammarException: %s" % self.parseElementTrace - -class _ParseResultsWithOffset(object): - def __init__(self,p1,p2): - self.tup = (p1,p2) - def __getitem__(self,i): - return self.tup[i] - def __repr__(self): - return repr(self.tup) - -class ParseResults(object): - """Structured parse results, to provide multiple means of access to the parsed data: - - as a list (len(results)) - - by list index (results[0], results[1], etc.) - - by attribute (results.<resultsName>) - """ - __slots__ = ( "__toklist", "__tokdict", "__doinit", "__name", "__parent", "__accumNames", "__weakref__" ) - def __new__(cls, toklist, name=None, asList=True, modal=True ): - if isinstance(toklist, cls): - return toklist - retobj = object.__new__(cls) - retobj.__doinit = True - return retobj - - # Performance tuning: we construct a *lot* of these, so keep this - # constructor as small and fast as possible - def __init__( self, toklist, name=None, asList=True, modal=True ): - if self.__doinit: - self.__doinit = False - self.__name = None - self.__parent = None - self.__accumNames = {} - if isinstance(toklist, list): - self.__toklist = toklist[:] - else: - self.__toklist = [toklist] - self.__tokdict = dict() - - # this line is related to debugging the asXML bug - #~ asList = False - - if name: - if not modal: - self.__accumNames[name] = 0 - if isinstance(name,int): - name = _ustr(name) # will always return a str, but use _ustr for consistency - self.__name = name - if not toklist in (None,'',[]): - if isinstance(toklist,basestring): - toklist = [ toklist ] - if asList: - if isinstance(toklist,ParseResults): - self[name] = _ParseResultsWithOffset(toklist.copy(),-1) - else: - self[name] = _ParseResultsWithOffset(ParseResults(toklist[0]),-1) - self[name].__name = name - else: - try: - self[name] = toklist[0] - except (KeyError,TypeError): - self[name] = toklist - - def __getitem__( self, i ): - if isinstance( i, (int,slice) ): - return self.__toklist[i] - else: - if i not in self.__accumNames: - return self.__tokdict[i][-1][0] - else: - return ParseResults([ v[0] for v in self.__tokdict[i] ]) - - def __setitem__( self, k, v ): - if isinstance(v,_ParseResultsWithOffset): - self.__tokdict[k] = self.__tokdict.get(k,list()) + [v] - sub = v[0] - elif isinstance(k,int): - self.__toklist[k] = v - sub = v - else: - self.__tokdict[k] = self.__tokdict.get(k,list()) + [(v,0)] - sub = v - if isinstance(sub,ParseResults): - sub.__parent = wkref(self) - - def __delitem__( self, i ): - if isinstance(i,(int,slice)): - del self.__toklist[i] - else: - del self._tokdict[i] - - def __contains__( self, k ): - return self.__tokdict.has_key(k) - - def __len__( self ): return len( self.__toklist ) - def __nonzero__( self ): return len( self.__toklist ) > 0 - def __iter__( self ): return iter( self.__toklist ) - def keys( self ): - """Returns all named result keys.""" - return self.__tokdict.keys() - - def items( self ): - """Returns all named result keys and values as a list of tuples.""" - return [(k,self[k]) for k in self.__tokdict.keys()] - - def values( self ): - """Returns all named result values.""" - return [ v[-1][0] for v in self.__tokdict.values() ] - - def __getattr__( self, name ): - if name not in self.__slots__: - if self.__tokdict.has_key( name ): - if name not in self.__accumNames: - return self.__tokdict[name][-1][0] - else: - return ParseResults([ v[0] for v in self.__tokdict[name] ]) - else: - return "" - return None - - def __add__( self, other ): - ret = self.copy() - ret += other - return ret - - def __iadd__( self, other ): - if other.__tokdict: - offset = len(self.__toklist) - addoffset = ( lambda a: (a<0 and offset) or (a+offset) ) - otheritems = other.__tokdict.items() - otherdictitems = [(k, _ParseResultsWithOffset(v[0],addoffset(v[1])) ) - for (k,vlist) in otheritems for v in vlist] - for k,v in otherdictitems: - self[k] = v - if isinstance(v[0],ParseResults): - v[0].__parent = wkref(self) - self.__toklist += other.__toklist - self.__accumNames.update( other.__accumNames ) - del other - return self - - def __repr__( self ): - return "(%s, %s)" % ( repr( self.__toklist ), repr( self.__tokdict ) ) - - def __str__( self ): - out = "[" - sep = "" - for i in self.__toklist: - if isinstance(i, ParseResults): - out += sep + _ustr(i) - else: - out += sep + repr(i) - sep = ", " - out += "]" - return out - - def _asStringList( self, sep='' ): - out = [] - for item in self.__toklist: - if out and sep: - out.append(sep) - if isinstance( item, ParseResults ): - out += item._asStringList() - else: - out.append( _ustr(item) ) - return out - - def asList( self ): - """Returns the parse results as a nested list of matching tokens, all converted to strings.""" - out = [] - for res in self.__toklist: - if isinstance(res,ParseResults): - out.append( res.asList() ) - else: - out.append( res ) - return out - - def asDict( self ): - """Returns the named parse results as dictionary.""" - return dict( self.items() ) - - def copy( self ): - """Returns a new copy of a ParseResults object.""" - ret = ParseResults( self.__toklist ) - ret.__tokdict = self.__tokdict.copy() - ret.__parent = self.__parent - ret.__accumNames.update( self.__accumNames ) - ret.__name = self.__name - return ret - - def asXML( self, doctag=None, namedItemsOnly=False, indent="", formatted=True ): - """Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.""" - nl = "\n" - out = [] - namedItems = dict( [ (v[1],k) for (k,vlist) in self.__tokdict.items() - for v in vlist ] ) - nextLevelIndent = indent + " " - - # collapse out indents if formatting is not desired - if not formatted: - indent = "" - nextLevelIndent = "" - nl = "" - - selfTag = None - if doctag is not None: - selfTag = doctag - else: - if self.__name: - selfTag = self.__name - - if not selfTag: - if namedItemsOnly: - return "" - else: - selfTag = "ITEM" - - out += [ nl, indent, "<", selfTag, ">" ] - - worklist = self.__toklist - for i,res in enumerate(worklist): - if isinstance(res,ParseResults): - if i in namedItems: - out += [ res.asXML(namedItems[i], - namedItemsOnly and doctag is None, - nextLevelIndent, - formatted)] - else: - out += [ res.asXML(None, - namedItemsOnly and doctag is None, - nextLevelIndent, - formatted)] - else: - # individual token, see if there is a name for it - resTag = None - if i in namedItems: - resTag = namedItems[i] - if not resTag: - if namedItemsOnly: - continue - else: - resTag = "ITEM" - xmlBodyText = xml.sax.saxutils.escape(_ustr(res)) - out += [ nl, nextLevelIndent, "<", resTag, ">", - xmlBodyText, - "</", resTag, ">" ] - - out += [ nl, indent, "</", selfTag, ">" ] - return "".join(out) - - def __lookup(self,sub): - for k,vlist in self.__tokdict.items(): - for v,loc in vlist: - if sub is v: - return k - return None - - def getName(self): - """Returns the results name for this token expression.""" - if self.__name: - return self.__name - elif self.__parent: - par = self.__parent() - if par: - return par.__lookup(self) - else: - return None - elif (len(self) == 1 and - len(self.__tokdict) == 1 and - self.__tokdict.values()[0][0][1] in (0,-1)): - return self.__tokdict.keys()[0] - else: - return None - - def dump(self,indent='',depth=0): - """Diagnostic method for listing out the contents of a ParseResults. - Accepts an optional indent argument so that this string can be embedded - in a nested display of other data.""" - out = [] - out.append( indent+_ustr(self.asList()) ) - keys = self.items() - keys.sort() - for k,v in keys: - if out: - out.append('\n') - out.append( "%s%s- %s: " % (indent,(' '*depth), k) ) - if isinstance(v,ParseResults): - if v.keys(): - #~ out.append('\n') - out.append( v.dump(indent,depth+1) ) - #~ out.append('\n') - else: - out.append(_ustr(v)) - else: - out.append(_ustr(v)) - #~ out.append('\n') - return "".join(out) - - # add support for pickle protocol - def __getstate__(self): - return ( self.__toklist, - ( self.__tokdict.copy(), - self.__parent is not None and self.__parent() or None, - self.__accumNames, - self.__name ) ) - - def __setstate__(self,state): - self.__toklist = state[0] - self.__tokdict, \ - par, \ - inAccumNames, \ - self.__name = state[1] - self.__accumNames = {} - self.__accumNames.update(inAccumNames) - if par is not None: - self.__parent = wkref(par) - else: - self.__parent = None - - -def col (loc,strg): - """Returns current column within a string, counting newlines as line separators. - The first column is number 1. - - Note: the default parsing behavior is to expand tabs in the input string - before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information - on parsing strings containing <TAB>s, and suggested methods to maintain a - consistent view of the parsed string, the parse location, and line and column - positions within the parsed string. - """ - return (loc<len(strg) and strg[loc] == '\n') and 1 or loc - strg.rfind("\n", 0, loc) - -def lineno(loc,strg): - """Returns current line number within a string, counting newlines as line separators. - The first line is number 1. - - Note: the default parsing behavior is to expand tabs in the input string - before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information - on parsing strings containing <TAB>s, and suggested methods to maintain a - consistent view of the parsed string, the parse location, and line and column - positions within the parsed string. - """ - return strg.count("\n",0,loc) + 1 - -def line( loc, strg ): - """Returns the line of text containing loc within a string, counting newlines as line separators. - """ - lastCR = strg.rfind("\n", 0, loc) - nextCR = strg.find("\n", loc) - if nextCR > 0: - return strg[lastCR+1:nextCR] - else: - return strg[lastCR+1:] - -def _defaultStartDebugAction( instring, loc, expr ): - print "Match",_ustr(expr),"at loc",loc,"(%d,%d)" % ( lineno(loc,instring), col(loc,instring) ) - -def _defaultSuccessDebugAction( instring, startloc, endloc, expr, toks ): - print "Matched",_ustr(expr),"->",toks.asList() - -def _defaultExceptionDebugAction( instring, loc, expr, exc ): - print "Exception raised:", _ustr(exc) - -def nullDebugAction(*args): - """'Do-nothing' debug action, to suppress debugging output during parsing.""" - pass - -class ParserElement(object): - """Abstract base level parser element class.""" - DEFAULT_WHITE_CHARS = " \n\t\r" - - def setDefaultWhitespaceChars( chars ): - """Overrides the default whitespace chars - """ - ParserElement.DEFAULT_WHITE_CHARS = chars - setDefaultWhitespaceChars = staticmethod(setDefaultWhitespaceChars) - - def __init__( self, savelist=False ): - self.parseAction = list() - self.failAction = None - #~ self.name = "<unknown>" # don't define self.name, let subclasses try/except upcall - self.strRepr = None - self.resultsName = None - self.saveAsList = savelist - self.skipWhitespace = True - self.whiteChars = ParserElement.DEFAULT_WHITE_CHARS - self.copyDefaultWhiteChars = True - self.mayReturnEmpty = False # used when checking for left-recursion - self.keepTabs = False - self.ignoreExprs = list() - self.debug = False - self.streamlined = False - self.mayIndexError = True # used to optimize exception handling for subclasses that don't advance parse index - self.errmsg = "" - self.modalResults = True # used to mark results names as modal (report only last) or cumulative (list all) - self.debugActions = ( None, None, None ) #custom debug actions - self.re = None - self.callPreparse = True # used to avoid redundant calls to preParse - self.callDuringTry = False - - def copy( self ): - """Make a copy of this ParserElement. Useful for defining different parse actions - for the same parsing pattern, using copies of the original parse element.""" - cpy = copy.copy( self ) - cpy.parseAction = self.parseAction[:] - cpy.ignoreExprs = self.ignoreExprs[:] - if self.copyDefaultWhiteChars: - cpy.whiteChars = ParserElement.DEFAULT_WHITE_CHARS - return cpy - - def setName( self, name ): - """Define name for this expression, for use in debugging.""" - self.name = name - self.errmsg = "Expected " + self.name - return self - - def setResultsName( self, name, listAllMatches=False ): - """Define name for referencing matching tokens as a nested attribute - of the returned parse results. - NOTE: this returns a *copy* of the original ParserElement object; - this is so that the client can define a basic element, such as an - integer, and reference it in multiple places with different names. - """ - newself = self.copy() - newself.resultsName = name - newself.modalResults = not listAllMatches - return newself - - def normalizeParseActionArgs( f ): - """Internal method used to decorate parse actions that take fewer than 3 arguments, - so that all parse actions can be called as f(s,l,t).""" - STAR_ARGS = 4 - - try: - restore = None - if isinstance(f,type): - restore = f - f = f.__init__ - if f.func_code.co_flags & STAR_ARGS: - return f - numargs = f.func_code.co_argcount - if hasattr(f,"im_self"): - numargs -= 1 - if restore: - f = restore - except AttributeError: - try: - # not a function, must be a callable object, get info from the - # im_func binding of its bound __call__ method - if f.__call__.im_func.func_code.co_flags & STAR_ARGS: - return f - numargs = f.__call__.im_func.func_code.co_argcount - if hasattr(f.__call__,"im_self"): - numargs -= 1 - except AttributeError: - # not a bound method, get info directly from __call__ method - if f.__call__.func_code.co_flags & STAR_ARGS: - return f - numargs = f.__call__.func_code.co_argcount - if hasattr(f.__call__,"im_self"): - numargs -= 1 - - #~ print "adding function %s with %d args" % (f.func_name,numargs) - if numargs == 3: - return f - else: - if numargs == 2: - def tmp(s,l,t): - return f(l,t) - elif numargs == 1: - def tmp(s,l,t): - return f(t) - else: #~ numargs == 0: - def tmp(s,l,t): - return f() - try: - tmp.__name__ = f.__name__ - except AttributeError: - # no need for special handling if attribute doesnt exist - pass - try: - tmp.__doc__ = f.__doc__ - except AttributeError: - # no need for special handling if attribute doesnt exist - pass - try: - tmp.__dict__.update(f.__dict__) - except AttributeError: - # no need for special handling if attribute doesnt exist - pass - return tmp - normalizeParseActionArgs = staticmethod(normalizeParseActionArgs) - - def setParseAction( self, *fns, **kwargs ): - """Define action to perform when successfully matching parse element definition. - Parse action fn is a callable method with 0-3 arguments, called as fn(s,loc,toks), - fn(loc,toks), fn(toks), or just fn(), where: - - s = the original string being parsed (see note below) - - loc = the location of the matching substring - - toks = a list of the matched tokens, packaged as a ParseResults object - If the functions in fns modify the tokens, they can return them as the return - value from fn, and the modified list of tokens will replace the original. - Otherwise, fn does not need to return any value. - - Note: the default parsing behavior is to expand tabs in the input string - before starting the parsing process. See L{I{parseString}<parseString>} for more information - on parsing strings containing <TAB>s, and suggested methods to maintain a - consistent view of the parsed string, the parse location, and line and column - positions within the parsed string. - """ - self.parseAction = map(self.normalizeParseActionArgs, list(fns)) - self.callDuringTry = ("callDuringTry" in kwargs and kwargs["callDuringTry"]) - return self - - def addParseAction( self, *fns, **kwargs ): - """Add parse action to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}.""" - self.parseAction += map(self.normalizeParseActionArgs, list(fns)) - self.callDuringTry = self.callDuringTry or ("callDuringTry" in kwargs and kwargs["callDuringTry"]) - return self - - def setFailAction( self, fn ): - """Define action to perform if parsing fails at this expression. - Fail acton fn is a callable function that takes the arguments - fn(s,loc,expr,err) where: - - s = string being parsed - - loc = location where expression match was attempted and failed - - expr = the parse expression that failed - - err = the exception thrown - The function returns no value. It may throw ParseFatalException - if it is desired to stop parsing immediately.""" - self.failAction = fn - return self - - def skipIgnorables( self, instring, loc ): - exprsFound = True - while exprsFound: - exprsFound = False - for e in self.ignoreExprs: - try: - while 1: - loc,dummy = e._parse( instring, loc ) - exprsFound = True - except ParseException: - pass - return loc - - def preParse( self, instring, loc ): - if self.ignoreExprs: - loc = self.skipIgnorables( instring, loc ) - - if self.skipWhitespace: - wt = self.whiteChars - instrlen = len(instring) - while loc < instrlen and instring[loc] in wt: - loc += 1 - - return loc - - def parseImpl( self, instring, loc, doActions=True ): - return loc, [] - - def postParse( self, instring, loc, tokenlist ): - return tokenlist - - #~ @profile - def _parseNoCache( self, instring, loc, doActions=True, callPreParse=True ): - debugging = ( self.debug ) #and doActions ) - - if debugging or self.failAction: - #~ print "Match",self,"at loc",loc,"(%d,%d)" % ( lineno(loc,instring), col(loc,instring) ) - if (self.debugActions[0] ): - self.debugActions[0]( instring, loc, self ) - if callPreParse and self.callPreparse: - preloc = self.preParse( instring, loc ) - else: - preloc = loc - tokensStart = loc - try: - try: - loc,tokens = self.parseImpl( instring, preloc, doActions ) - except IndexError: - raise ParseException( instring, len(instring), self.errmsg, self ) - except ParseException, err: - #~ print "Exception raised:", err - if self.debugActions[2]: - self.debugActions[2]( instring, tokensStart, self, err ) - if self.failAction: - self.failAction( instring, tokensStart, self, err ) - raise - else: - if callPreParse: - preloc = self.preParse( instring, loc ) - else: - preloc = loc - tokensStart = loc - if self.mayIndexError or loc >= len(instring): - try: - loc,tokens = self.parseImpl( instring, preloc, doActions ) - except IndexError: - raise ParseException( instring, len(instring), self.errmsg, self ) - else: - loc,tokens = self.parseImpl( instring, preloc, doActions ) - - tokens = self.postParse( instring, loc, tokens ) - - retTokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList, modal=self.modalResults ) - if self.parseAction and (doActions or self.callDuringTry): - if debugging: - try: - for fn in self.parseAction: - tokens = fn( instring, tokensStart, retTokens ) - if tokens is not None: - retTokens = ParseResults( tokens, - self.resultsName, - asList=self.saveAsList and isinstance(tokens,(ParseResults,list)), - modal=self.modalResults ) - except ParseException, err: - #~ print "Exception raised in user parse action:", err - if (self.debugActions[2] ): - self.debugActions[2]( instring, tokensStart, self, err ) - raise - else: - for fn in self.parseAction: - tokens = fn( instring, tokensStart, retTokens ) - if tokens is not None: - retTokens = ParseResults( tokens, - self.resultsName, - asList=self.saveAsList and isinstance(tokens,(ParseResults,list)), - modal=self.modalResults ) - - if debugging: - #~ print "Matched",self,"->",retTokens.asList() - if (self.debugActions[1] ): - self.debugActions[1]( instring, tokensStart, loc, self, retTokens ) - - return loc, retTokens - - def tryParse( self, instring, loc ): - return self._parse( instring, loc, doActions=False )[0] - - # this method gets repeatedly called during backtracking with the same arguments - - # we can cache these arguments and save ourselves the trouble of re-parsing the contained expression - def _parseCache( self, instring, loc, doActions=True, callPreParse=True ): - #if doActions and self.parseAction: - # return self._parseNoCache( instring, loc, doActions, callPreParse ) - lookup = (self,instring,loc,callPreParse,doActions) - if lookup in ParserElement._exprArgCache: - value = ParserElement._exprArgCache[ lookup ] - if isinstance(value,Exception): - if isinstance(value,ParseBaseException): - value.loc = loc - raise value - return value - else: - try: - ParserElement._exprArgCache[ lookup ] = \ - value = self._parseNoCache( instring, loc, doActions, callPreParse ) - return value - except ParseBaseException, pe: - ParserElement._exprArgCache[ lookup ] = pe - raise - - _parse = _parseNoCache - - # argument cache for optimizing repeated calls when backtracking through recursive expressions - _exprArgCache = {} - def resetCache(): - ParserElement._exprArgCache.clear() - resetCache = staticmethod(resetCache) - - _packratEnabled = False - def enablePackrat(): - """Enables "packrat" parsing, which adds memoizing to the parsing logic. - Repeated parse attempts at the same string location (which happens - often in many complex grammars) can immediately return a cached value, - instead of re-executing parsing/validating code. Memoizing is done of - both valid results and parsing exceptions. - - This speedup may break existing programs that use parse actions that - have side-effects. For this reason, packrat parsing is disabled when - you first import pyparsing. To activate the packrat feature, your - program must call the class method ParserElement.enablePackrat(). If - your program uses psyco to "compile as you go", you must call - enablePackrat before calling psyco.full(). If you do not do this, - Python will crash. For best results, call enablePackrat() immediately - after importing pyparsing. - """ - if not ParserElement._packratEnabled: - ParserElement._packratEnabled = True - ParserElement._parse = ParserElement._parseCache - enablePackrat = staticmethod(enablePackrat) - - def parseString( self, instring ): - """Execute the parse expression with the given string. - This is the main interface to the client code, once the complete - expression has been built. - - Note: parseString implicitly calls expandtabs() on the input string, - in order to report proper column numbers in parse actions. - If the input string contains tabs and - the grammar uses parse actions that use the loc argument to index into the - string being parsed, you can ensure you have a consistent view of the input - string by: - - calling parseWithTabs on your grammar before calling parseString - (see L{I{parseWithTabs}<parseWithTabs>}) - - define your parse action using the full (s,loc,toks) signature, and - reference the input string using the parse action's s argument - - explictly expand the tabs in your input string before calling - parseString - """ - ParserElement.resetCache() - if not self.streamlined: - self.streamline() - #~ self.saveAsList = True - for e in self.ignoreExprs: - e.streamline() - if self.keepTabs: - loc, tokens = self._parse( instring, 0 ) - else: - loc, tokens = self._parse( instring.expandtabs(), 0 ) - return tokens - - def scanString( self, instring, maxMatches=sys.maxint ): - """Scan the input string for expression matches. Each match will return the - matching tokens, start location, and end location. May be called with optional - maxMatches argument, to clip scanning after 'n' matches are found. - - Note that the start and end locations are reported relative to the string - being parsed. See L{I{parseString}<parseString>} for more information on parsing - strings with embedded tabs.""" - if not self.streamlined: - self.streamline() - for e in self.ignoreExprs: - e.streamline() - - if not self.keepTabs: - instring = _ustr(instring).expandtabs() - instrlen = len(instring) - loc = 0 - preparseFn = self.preParse - parseFn = self._parse - ParserElement.resetCache() - matches = 0 - while loc <= instrlen and matches < maxMatches: - try: - preloc = preparseFn( instring, loc ) - nextLoc,tokens = parseFn( instring, preloc, callPreParse=False ) - except ParseException: - loc = preloc+1 - else: - matches += 1 - yield tokens, preloc, nextLoc - loc = nextLoc - - def transformString( self, instring ): - """Extension to scanString, to modify matching text with modified tokens that may - be returned from a parse action. To use transformString, define a grammar and - attach a parse action to it that modifies the returned token list. - Invoking transformString() on a target string will then scan for matches, - and replace the matched text patterns according to the logic in the parse - action. transformString() returns the resulting transformed string.""" - out = [] - lastE = 0 - # force preservation of <TAB>s, to minimize unwanted transformation of string, and to - # keep string locs straight between transformString and scanString - self.keepTabs = True - for t,s,e in self.scanString( instring ): - out.append( instring[lastE:s] ) - if t: - if isinstance(t,ParseResults): - out += t.asList() - elif isinstance(t,list): - out += t - else: - out.append(t) - lastE = e - out.append(instring[lastE:]) - return "".join(map(_ustr,out)) - - def searchString( self, instring, maxMatches=sys.maxint ): - """Another extension to scanString, simplifying the access to the tokens found - to match the given parse expression. May be called with optional - maxMatches argument, to clip searching after 'n' matches are found. - """ - return ParseResults([ t for t,s,e in self.scanString( instring, maxMatches ) ]) - - def __add__(self, other ): - """Implementation of + operator - returns And""" - if isinstance( other, basestring ): - other = Literal( other ) - if not isinstance( other, ParserElement ): - warnings.warn("Cannot add element of type %s to ParserElement" % type(other), - SyntaxWarning, stacklevel=2) - return And( [ self, other ] ) - - def __radd__(self, other ): - """Implementation of += operator""" - if isinstance( other, basestring ): - other = Literal( other ) - if not isinstance( other, ParserElement ): - warnings.warn("Cannot add element of type %s to ParserElement" % type(other), - SyntaxWarning, stacklevel=2) - return other + self - - def __or__(self, other ): - """Implementation of | operator - returns MatchFirst""" - if isinstance( other, basestring ): - other = Literal( other ) - if not isinstance( other, ParserElement ): - warnings.warn("Cannot add element of type %s to ParserElement" % type(other), - SyntaxWarning, stacklevel=2) - return MatchFirst( [ self, other ] ) - - def __ror__(self, other ): - """Implementation of |= operator""" - if isinstance( other, basestring ): - other = Literal( other ) - if not isinstance( other, ParserElement ): - warnings.warn("Cannot add element of type %s to ParserElement" % type(other), - SyntaxWarning, stacklevel=2) - return other | self - - def __xor__(self, other ): - """Implementation of ^ operator - returns Or""" - if isinstance( other, basestring ): - other = Literal( other ) - if not isinstance( other, ParserElement ): - warnings.warn("Cannot add element of type %s to ParserElement" % type(other), - SyntaxWarning, stacklevel=2) - return Or( [ self, other ] ) - - def __rxor__(self, other ): - """Implementation of ^= operator""" - if isinstance( other, basestring ): - other = Literal( other ) - if not isinstance( other, ParserElement ): - warnings.warn("Cannot add element of type %s to ParserElement" % type(other), - SyntaxWarning, stacklevel=2) - return other ^ self - - def __and__(self, other ): - """Implementation of & operator - returns Each""" - if isinstance( other, basestring ): - other = Literal( other ) - if not isinstance( other, ParserElement ): - warnings.warn("Cannot add element of type %s to ParserElement" % type(other), - SyntaxWarning, stacklevel=2) - return Each( [ self, other ] ) - - def __rand__(self, other ): - """Implementation of right-& operator""" - if isinstance( other, basestring ): - other = Literal( other ) - if not isinstance( other, ParserElement ): - warnings.warn("Cannot add element of type %s to ParserElement" % type(other), - SyntaxWarning, stacklevel=2) - return other & self - - def __invert__( self ): - """Implementation of ~ operator - returns NotAny""" - return NotAny( self ) - - def suppress( self ): - """Suppresses the output of this ParserElement; useful to keep punctuation from - cluttering up returned output. - """ - return Suppress( self ) - - def leaveWhitespace( self ): - """Disables the skipping of whitespace before matching the characters in the - ParserElement's defined pattern. This is normally only used internally by - the pyparsing module, but may be needed in some whitespace-sensitive grammars. - """ - self.skipWhitespace = False - return self - - def setWhitespaceChars( self, chars ): - """Overrides the default whitespace chars - """ - self.skipWhitespace = True - self.whiteChars = chars - self.copyDefaultWhiteChars = False - return self - - def parseWithTabs( self ): - """Overrides default behavior to expand <TAB>s to spaces before parsing the input string. - Must be called before parseString when the input grammar contains elements that - match <TAB> characters.""" - self.keepTabs = True - return self - - def ignore( self, other ): - """Define expression to be ignored (e.g., comments) while doing pattern - matching; may be called repeatedly, to define multiple comment or other - ignorable patterns. - """ - if isinstance( other, Suppress ): - if other not in self.ignoreExprs: - self.ignoreExprs.append( other ) - else: - self.ignoreExprs.append( Suppress( other ) ) - return self - - def setDebugActions( self, startAction, successAction, exceptionAction ): - """Enable display of debugging messages while doing pattern matching.""" - self.debugActions = (startAction or _defaultStartDebugAction, - successAction or _defaultSuccessDebugAction, - exceptionAction or _defaultExceptionDebugAction) - self.debug = True - return self - - def setDebug( self, flag=True ): - """Enable display of debugging messages while doing pattern matching.""" - if flag: - self.setDebugActions( _defaultStartDebugAction, _defaultSuccessDebugAction, _defaultExceptionDebugAction ) - else: - self.debug = False - return self - - def __str__( self ): - return self.name - - def __repr__( self ): - return _ustr(self) - - def streamline( self ): - self.streamlined = True - self.strRepr = None - return self - - def checkRecursion( self, parseElementList ): - pass - - def validate( self, validateTrace=[] ): - """Check defined expressions for valid structure, check for infinite recursive definitions.""" - self.checkRecursion( [] ) - - def parseFile( self, file_or_filename ): - """Execute the parse expression on the given file or filename. - If a filename is specified (instead of a file object), - the entire file is opened, read, and closed before parsing. - """ - try: - file_contents = file_or_filename.read() - except AttributeError: - f = open(file_or_filename, "rb") - file_contents = f.read() - f.close() - return self.parseString(file_contents) - - -class Token(ParserElement): - """Abstract ParserElement subclass, for defining atomic matching patterns.""" - def __init__( self ): - super(Token,self).__init__( savelist=False ) - self.myException = ParseException("",0,"",self) - - def setName(self, name): - s = super(Token,self).setName(name) - self.errmsg = "Expected " + self.name - s.myException.msg = self.errmsg - return s - - -class Empty(Token): - """An empty token, will always match.""" - def __init__( self ): - super(Empty,self).__init__() - self.name = "Empty" - self.mayReturnEmpty = True - self.mayIndexError = False - - -class NoMatch(Token): - """A token that will never match.""" - def __init__( self ): - super(NoMatch,self).__init__() - self.name = "NoMatch" - self.mayReturnEmpty = True - self.mayIndexError = False - self.errmsg = "Unmatchable token" - self.myException.msg = self.errmsg - - def parseImpl( self, instring, loc, doActions=True ): - exc = self.myException - exc.loc = loc - exc.pstr = instring - raise exc - - -class Literal(Token): - """Token to exactly match a specified string.""" - def __init__( self, matchString ): - super(Literal,self).__init__() - self.match = matchString - self.matchLen = len(matchString) - try: - self.firstMatchChar = matchString[0] - except IndexError: - warnings.warn("null string passed to Literal; use Empty() instead", - SyntaxWarning, stacklevel=2) - self.__class__ = Empty - self.name = '"%s"' % _ustr(self.match) - self.errmsg = "Expected " + self.name - self.mayReturnEmpty = False - self.myException.msg = self.errmsg - self.mayIndexError = False - - # Performance tuning: this routine gets called a *lot* - # if this is a single character match string and the first character matches, - # short-circuit as quickly as possible, and avoid calling startswith - #~ @profile - def parseImpl( self, instring, loc, doActions=True ): - if (instring[loc] == self.firstMatchChar and - (self.matchLen==1 or instring.startswith(self.match,loc)) ): - return loc+self.matchLen, self.match - #~ raise ParseException( instring, loc, self.errmsg ) - exc = self.myException - exc.loc = loc - exc.pstr = instring - raise exc - -class Keyword(Token): - """Token to exactly match a specified string as a keyword, that is, it must be - immediately followed by a non-keyword character. Compare with Literal:: - Literal("if") will match the leading 'if' in 'ifAndOnlyIf'. - Keyword("if") will not; it will only match the leading 'if in 'if x=1', or 'if(y==2)' - Accepts two optional constructor arguments in addition to the keyword string: - identChars is a string of characters that would be valid identifier characters, - defaulting to all alphanumerics + "_" and "$"; caseless allows case-insensitive - matching, default is False. - """ - DEFAULT_KEYWORD_CHARS = alphanums+"_$" - - def __init__( self, matchString, identChars=DEFAULT_KEYWORD_CHARS, caseless=False ): - super(Keyword,self).__init__() - self.match = matchString - self.matchLen = len(matchString) - try: - self.firstMatchChar = matchString[0] - except IndexError: - warnings.warn("null string passed to Keyword; use Empty() instead", - SyntaxWarning, stacklevel=2) - self.name = '"%s"' % self.match - self.errmsg = "Expected " + self.name - self.mayReturnEmpty = False - self.myException.msg = self.errmsg - self.mayIndexError = False - self.caseless = caseless - if caseless: - self.caselessmatch = matchString.upper() - identChars = identChars.upper() - self.identChars = _str2dict(identChars) - - def parseImpl( self, instring, loc, doActions=True ): - if self.caseless: - if ( (instring[ loc:loc+self.matchLen ].upper() == self.caselessmatch) and - (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen].upper() not in self.identChars) and - (loc == 0 or instring[loc-1].upper() not in self.identChars) ): - return loc+self.matchLen, self.match - else: - if (instring[loc] == self.firstMatchChar and - (self.matchLen==1 or instring.startswith(self.match,loc)) and - (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen] not in self.identChars) and - (loc == 0 or instring[loc-1] not in self.identChars) ): - return loc+self.matchLen, self.match - #~ raise ParseException( instring, loc, self.errmsg ) - exc = self.myException - exc.loc = loc - exc.pstr = instring - raise exc - - def copy(self): - c = super(Keyword,self).copy() - c.identChars = Keyword.DEFAULT_KEYWORD_CHARS - return c - - def setDefaultKeywordChars( chars ): - """Overrides the default Keyword chars - """ - Keyword.DEFAULT_KEYWORD_CHARS = chars - setDefaultKeywordChars = staticmethod(setDefaultKeywordChars) - - -class CaselessLiteral(Literal): - """Token to match a specified string, ignoring case of letters. - Note: the matched results will always be in the case of the given - match string, NOT the case of the input text. - """ - def __init__( self, matchString ): - super(CaselessLiteral,self).__init__( matchString.upper() ) - # Preserve the defining literal. - self.returnString = matchString - self.name = "'%s'" % self.returnString - self.errmsg = "Expected " + self.name - self.myException.msg = self.errmsg - - def parseImpl( self, instring, loc, doActions=True ): - if instring[ loc:loc+self.matchLen ].upper() == self.match: - return loc+self.matchLen, self.returnString - #~ raise ParseException( instring, loc, self.errmsg ) - exc = self.myException - exc.loc = loc - exc.pstr = instring - raise exc - -class CaselessKeyword(Keyword): - def __init__( self, matchString, identChars=Keyword.DEFAULT_KEYWORD_CHARS ): - super(CaselessKeyword,self).__init__( matchString, identChars, caseless=True ) - - def parseImpl( self, instring, loc, doActions=True ): - if ( (instring[ loc:loc+self.matchLen ].upper() == self.caselessmatch) and - (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen].upper() not in self.identChars) ): - return loc+self.matchLen, self.match - #~ raise ParseException( instring, loc, self.errmsg ) - exc = self.myException - exc.loc = loc - exc.pstr = instring - raise exc - -class Word(Token): - """Token for matching words composed of allowed character sets. - Defined with string containing all allowed initial characters, - an optional string containing allowed body characters (if omitted, - defaults to the initial character set), and an optional minimum, - maximum, and/or exact length. - """ - def __init__( self, initChars, bodyChars=None, min=1, max=0, exact=0, asKeyword=False ): - super(Word,self).__init__() - self.initCharsOrig = initChars - self.initChars = _str2dict(initChars) - if bodyChars : - self.bodyCharsOrig = bodyChars - self.bodyChars = _str2dict(bodyChars) - else: - self.bodyCharsOrig = initChars - self.bodyChars = _str2dict(initChars) - - self.maxSpecified = max > 0 - - self.minLen = min - - if max > 0: - self.maxLen = max - else: - self.maxLen = sys.maxint - - if exact > 0: - self.maxLen = exact - self.minLen = exact - - self.name = _ustr(self) - self.errmsg = "Expected " + self.name - self.myException.msg = self.errmsg - self.mayIndexError = False - self.asKeyword = asKeyword - - if ' ' not in self.initCharsOrig+self.bodyCharsOrig and (min==1 and max==0 and exact==0): - if self.bodyCharsOrig == self.initCharsOrig: - self.reString = "[%s]+" % _escapeRegexRangeChars(self.initCharsOrig) - elif len(self.bodyCharsOrig) == 1: - self.reString = "%s[%s]*" % \ - (re.escape(self.initCharsOrig), - _escapeRegexRangeChars(self.bodyCharsOrig),) - else: - self.reString = "[%s][%s]*" % \ - (_escapeRegexRangeChars(self.initCharsOrig), - _escapeRegexRangeChars(self.bodyCharsOrig),) - if self.asKeyword: - self.reString = r"\b"+self.reString+r"\b" - try: - self.re = re.compile( self.reString ) - except: - self.re = None - - def parseImpl( self, instring, loc, doActions=True ): - if self.re: - result = self.re.match(instring,loc) - ... [truncated message content] |
From: <js...@us...> - 2007-11-08 22:29:32
|
Revision: 4166 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4166&view=rev Author: jswhit Date: 2007-11-08 14:29:29 -0800 (Thu, 08 Nov 2007) Log Message: ----------- make data files float32 binary, not float64 (save yet more space) lats and lons are truncated to 3 decimal places, so they gzip better too. Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhs_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhs_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhs_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhs_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhsmeta_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhsmeta_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhsmeta_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhsmeta_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/rivers_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/rivers_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/rivers_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/rivers_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/riversmeta_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/riversmeta_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/riversmeta_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/riversmeta_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/states_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/states_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/states_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/states_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/statesmeta_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/statesmeta_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/statesmeta_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/statesmeta_l.dat Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-08 22:11:50 UTC (rev 4165) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-08 22:29:29 UTC (rev 4166) @@ -792,7 +792,7 @@ # numpy array (first column is lons, second is lats). polystring = bdatfile.read(bytecount) # binary data is little endian. - b = npy.reshape(npy.fromstring(polystring,dtype='<f8'),(npts,2)) + b = npy.reshape(npy.fromstring(polystring,dtype='<f4'),(npts,2)) # if map boundary polygon is a valid one in lat/lon # coordinates (i.e. it does not contain either pole), # the intersections of the boundary geometries @@ -819,7 +819,7 @@ lats.append(-90.) poly = PolygonShape(zip(lons,lats)) antart = True - b = npy.empty((len(lons),2),npy.float64) + b = npy.empty((len(lons),2),npy.float32) b[:,0] = lons; b[:,1] = lats else: antart = False Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_c.dat =================================================================== (Binary files differ) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_h.dat =================================================================== (Binary files differ) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_i.dat =================================================================== (Binary files differ) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_l.dat =================================================================== (Binary files differ) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_c.dat =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_c.dat 2007-11-08 22:11:50 UTC (rev 4165) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_c.dat 2007-11-08 22:29:29 UTC (rev 4166) @@ -1,565 +1,565 @@ --1 -1 2 70.00000 70.06710 0 32 --1 -1 2 70.00000 70.08820 32 32 --1 -1 7 50.00000 51.01900 64 112 --1 -1 7 50.00000 53.60750 176 112 --1 -1 2 54.46630 54.47670 288 32 --1 -1 2 50.00000 50.32320 320 32 --1 -1 18 58.90490 68.50860 352 288 --1 -1 3 50.00000 50.16690 640 48 --1 -1 2 50.00000 51.09100 688 32 --1 -1 4 50.86580 53.27000 720 64 --1 -1 3 50.75650 51.48650 784 48 --1 -1 2 50.00000 50.12660 832 32 --1 -1 2 54.76570 55.08640 864 32 --1 -1 6 50.00000 54.46630 896 96 --1 -1 2 68.40670 69.05760 992 32 --1 -1 8 65.51320 70.00000 1024 128 --1 -1 7 62.91430 69.05060 1152 112 --1 -1 4 55.67540 56.45060 1264 64 --1 -1 4 55.67540 56.45060 1328 64 --1 -1 3 53.94780 54.97720 1392 48 --1 -1 3 53.94780 54.97720 1440 48 --1 -1 4 50.00000 50.95950 1488 64 --1 -1 3 51.84390 52.36700 1552 48 --1 -1 3 57.53580 58.08450 1600 48 --1 -1 2 55.60310 56.14940 1648 32 --1 -1 2 55.60310 56.14940 1680 32 --1 -1 2 51.37510 51.63030 1712 32 --1 -1 2 60.54760 62.91250 1744 32 --1 -1 2 56.15120 57.53640 1776 32 --1 -1 4 69.02950 70.00000 1808 64 --1 -1 2 54.46080 55.60310 1872 32 --1 -1 2 51.53110 51.92260 1904 32 --1 -1 2 51.63030 51.92080 1936 32 --1 -1 2 52.10820 53.12110 1968 32 --1 -1 2 53.12110 53.43880 2000 32 --1 -1 3 54.97720 55.67480 2032 48 --1 -1 3 54.97720 55.67480 2080 48 --1 -1 2 50.95950 51.25950 2128 32 --1 -1 2 51.25280 51.37510 2160 32 --1 -1 2 53.43850 53.80440 2192 32 --1 -1 2 51.25310 51.94430 2224 32 --1 -1 2 55.07210 55.24880 2256 32 --1 -1 2 54.36500 55.07180 2288 32 --1 -1 2 58.00980 59.15970 2320 32 --1 -1 2 51.94430 52.10820 2352 32 --1 -1 2 51.36900 51.84330 2384 32 --1 -1 2 57.53580 58.00980 2416 32 --1 -1 2 54.00210 54.46020 2448 32 --1 -1 2 55.67510 55.82650 2480 32 --1 -1 2 55.67510 55.82650 2512 32 --1 -1 2 55.79200 56.14940 2544 32 --1 -1 2 55.79200 56.14940 2576 32 --1 -1 2 53.80320 54.00210 2608 32 --1 -1 2 59.15970 59.35260 2640 32 --1 -1 2 55.79200 55.82650 2672 32 --1 -1 2 55.79200 55.82650 2704 32 --1 -1 2 51.25950 51.36900 2736 32 --1 -1 2 59.35260 59.47860 2768 32 --1 -1 2 60.25530 60.54550 2800 32 --1 -1 3 50.00000 51.76910 2832 48 --1 -1 2 50.00000 50.37510 2880 32 --1 -1 6 50.52830 51.12000 2912 96 --1 -1 3 50.47820 51.15600 3008 48 --1 -1 4 51.45480 51.78100 3056 64 --1 -1 2 50.00000 50.37690 3120 32 --1 -1 2 50.52860 51.50670 3152 32 --1 -1 2 51.46430 51.50670 3184 32 --1 -1 2 51.08490 51.15600 3216 32 --1 -1 2 51.08460 51.12000 3248 32 --1 -1 9 52.00080 54.18250 3280 144 --1 -1 4 50.79260 51.26470 3424 64 --1 -1 2 50.85330 51.66930 3488 32 --1 -1 6 53.43600 54.38790 3520 96 --1 -1 3 54.64520 55.36720 3616 48 --1 -1 4 53.34570 54.47550 3664 64 --1 -1 2 54.39090 54.64300 3728 32 --1 -1 2 54.39090 54.64300 3760 32 --1 -1 3 54.19320 55.29670 3792 48 --1 -1 2 55.29730 55.36840 3840 32 --1 -1 2 51.61990 52.00080 3872 32 --1 -1 3 53.43600 54.11110 3904 48 --1 -1 2 51.66930 53.34540 3952 32 --1 -1 2 54.19780 54.39250 3984 32 --1 -1 2 51.42820 51.61990 4016 32 --1 -1 2 54.18250 54.19680 4048 32 --1 -1 2 51.26680 51.43010 4080 32 --1 -1 5 50.00000 50.87460 4112 80 --1 -1 5 50.00000 52.14360 4192 80 --1 -1 3 50.00000 51.00250 4272 48 --1 -1 4 50.73610 51.31440 4320 64 --1 -1 3 50.00000 50.28410 4384 48 --1 -1 6 50.00000 51.88020 4432 96 --1 -1 2 50.00000 51.12950 4528 32 --1 -1 7 50.20840 53.55410 4560 112 --1 -1 2 50.00000 50.20290 4672 32 --1 -1 3 60.30750 69.64570 4704 48 --1 -1 9 54.70770 60.35230 4752 144 --1 -1 3 54.09950 55.07060 4896 48 --1 -1 4 49.23280 50.00000 4944 64 --1 -1 5 45.76780 46.87100 5008 80 --1 -1 4 47.58510 50.00000 5088 64 --1 -1 6 30.00000 33.17240 5152 96 --1 -1 14 43.78870 47.54060 5248 224 --1 -1 10 47.27470 50.00000 5472 160 --1 -1 6 46.86920 48.15460 5632 96 --1 -1 6 45.93220 47.80700 5728 96 --1 -1 2 39.80700 39.84480 5824 32 --1 -1 3 41.85050 42.62590 5856 48 --1 -1 2 48.61690 49.51810 5904 32 --1 -1 3 49.46010 50.00000 5936 48 --1 -1 3 49.98020 50.00000 5984 48 --1 -1 6 45.59810 47.09470 6032 96 --1 -1 7 30.23380 36.94350 6128 112 --1 -1 5 48.14420 49.01880 6240 80 --1 -1 2 42.60210 42.70920 6320 32 --1 -1 2 49.54500 50.00000 6352 32 --1 -1 2 42.43460 42.50690 6384 32 --1 -1 3 42.50690 42.56550 6416 48 --1 -1 2 42.95280 43.18230 6464 32 --1 -1 2 39.87010 39.93060 6496 32 --1 -1 2 43.91350 43.91620 6528 32 --1 -1 2 47.06420 47.27410 6560 32 --1 -1 2 48.01240 48.14360 6592 32 --1 -1 2 42.46110 42.46230 6624 32 --1 -1 2 42.48650 42.66290 6656 32 --1 -1 2 41.34140 41.41070 6688 32 --1 -1 2 43.72950 43.75750 6720 32 --1 -1 2 47.69310 47.69310 6752 32 --1 -1 10 42.54600 45.18640 6784 160 --1 -1 2 43.12340 43.53440 6944 32 --1 -1 3 44.85310 45.90750 6976 48 --1 -1 4 45.45860 46.48370 7024 64 --1 -1 4 49.07840 49.43690 7088 64 --1 -1 9 43.62480 46.15140 7152 144 --1 -1 8 30.00000 33.37800 7296 128 --1 -1 3 30.00000 31.64710 7424 48 --1 -1 9 45.21200 48.26380 7472 144 --1 -1 4 48.41180 50.00000 7616 64 --1 -1 3 47.95350 48.57600 7680 48 --1 -1 6 40.73530 41.75010 7728 96 --1 -1 5 35.92660 36.83360 7824 80 --1 -1 5 39.66900 42.53990 7904 80 --1 -1 2 30.00000 31.32270 7984 32 --1 -1 6 41.34140 44.22630 8016 96 --1 -1 5 30.00000 31.83290 8112 80 --1 -1 2 49.90330 50.00000 8192 32 --1 -1 2 31.98670 32.75000 8224 32 --1 -1 2 46.55120 48.00990 8256 32 --1 -1 2 49.62310 49.90420 8288 32 --1 -1 3 41.71250 42.08820 8320 48 --1 -1 2 33.37530 33.94480 8368 32 --1 -1 2 31.93850 32.23610 8400 32 --1 -1 3 47.83140 48.36760 8432 48 --1 -1 3 47.10930 47.86830 8480 48 --1 -1 2 48.58820 49.06550 8528 32 --1 -1 2 48.07130 48.46490 8560 32 --1 -1 2 48.25860 48.46490 8592 32 --1 -1 2 33.09390 33.24900 8624 32 --1 -1 2 36.02980 36.20490 8656 32 --1 -1 2 31.21740 31.59670 8688 32 --1 -1 2 48.00960 48.07130 8720 32 --1 -1 2 48.36760 48.58820 8752 32 --1 -1 2 37.64870 37.83950 8784 32 --1 -1 2 36.46920 36.49150 8816 32 --1 -1 2 45.13730 45.43180 8848 32 --1 -1 2 46.41570 46.55120 8880 32 --1 -1 2 36.56290 36.76650 8912 32 --1 -1 2 37.25170 37.50470 8944 32 --1 -1 2 38.11230 38.32440 8976 32 --1 -1 2 39.38740 39.39860 9008 32 --1 -1 2 36.93000 37.06400 9040 32 --1 -1 2 39.81400 40.03620 9072 32 --1 -1 2 36.62970 36.64130 9104 32 --1 -1 2 38.48400 38.70130 9136 32 --1 -1 2 40.25440 40.40360 9168 32 --1 -1 2 38.88040 39.07550 9200 32 --1 -1 2 31.80760 31.80820 9232 32 --1 -1 2 33.20710 33.25170 9264 32 --1 -1 2 43.90430 43.92900 9296 32 --1 -1 2 41.94230 42.32650 9328 32 --1 -1 3 42.56340 43.12340 9360 48 --1 -1 14 30.00000 39.64860 9408 224 --1 -1 2 36.83360 37.32160 9632 32 --1 -1 7 36.95200 38.28200 9664 112 --1 -1 8 41.26270 42.79770 9776 128 --1 -1 5 39.63270 41.58310 9904 80 --1 -1 6 38.44530 39.71970 9984 96 --1 -1 3 49.94200 50.00000 10080 48 --1 -1 5 38.87800 41.29870 10128 80 --1 -1 5 36.97060 37.38480 10208 80 --1 -1 4 41.89680 42.89910 10288 64 --1 -1 4 41.89680 42.89910 10352 64 --1 -1 4 41.89680 42.89910 10416 64 --1 -1 6 46.34550 48.24860 10480 96 --1 -1 4 41.28680 42.33720 10576 64 --1 -1 2 49.60510 49.62310 10640 32 --1 -1 3 42.89910 43.54570 10672 48 --1 -1 3 42.89910 43.54570 10720 48 --1 -1 3 41.05000 41.89590 10768 48 --1 -1 3 41.19620 41.89720 10816 48 --1 -1 4 33.94480 37.06190 10864 64 --1 -1 3 30.00000 31.93850 10928 48 --1 -1 3 38.84200 39.70570 10976 48 --1 -1 3 48.24860 50.00000 11024 48 --1 -1 2 49.06550 49.18390 11072 32 --1 -1 3 30.00000 30.01530 11104 48 --1 -1 2 41.11070 41.29780 11152 32 --1 -1 2 41.11070 41.29780 11184 32 --1 -1 2 41.32620 45.00300 11216 32 --1 -1 3 45.00240 45.57120 11248 48 --1 -1 2 37.05970 37.31980 11296 32 --1 -1 2 49.18390 49.60050 11328 32 --1 -1 2 40.66480 40.66510 11360 32 --1 -1 2 30.00000 30.00790 11392 32 --1 -1 2 41.00420 41.00570 11424 32 --1 -1 17 33.40760 41.93130 11456 272 --1 -1 3 44.86230 44.92970 11728 48 --1 -1 23 30.00000 38.47210 11776 368 --1 -1 12 30.00000 37.02560 12144 192 --1 -1 7 30.86490 33.40520 12336 112 --1 -1 3 30.00000 31.59640 12448 48 --1 -1 4 35.60520 36.95200 12496 64 --1 -1 4 41.23430 42.22400 12560 64 --1 -1 7 32.30320 35.50030 12624 112 --1 -1 3 37.36550 40.03100 12736 48 --1 -1 3 37.36550 40.03100 12784 48 --1 -1 6 41.00420 42.25270 12832 96 --1 -1 4 40.14570 41.00600 12928 64 --1 -1 6 42.25330 43.26860 12992 96 --1 -1 3 42.33050 42.80630 13088 48 --1 -1 4 39.50760 40.24490 13136 64 --1 -1 5 40.60750 42.25270 13200 80 --1 -1 4 39.19200 39.62020 13280 64 --1 -1 4 37.18580 39.29430 13344 64 --1 -1 5 40.22450 41.05030 13408 80 --1 -1 4 39.29370 40.14910 13488 64 --1 -1 3 40.03070 41.23550 13552 48 --1 -1 5 42.42420 43.73770 13600 80 --1 -1 5 42.42420 43.73770 13680 80 --1 -1 2 31.59910 32.30410 13760 32 --1 -1 2 42.80630 43.26860 13792 32 --1 -1 3 39.89330 40.16310 13824 48 --1 -1 2 43.48620 44.60530 13872 32 --1 -1 4 41.14370 42.42390 13904 64 --1 -1 2 41.14340 41.19430 13968 32 --1 -1 2 39.88750 39.88820 14000 32 --1 -1 2 40.42980 40.72470 14032 32 --1 -1 2 40.18480 40.22450 14064 32 --1 -1 2 41.05150 41.19430 14096 32 --1 -1 2 40.99930 41.00110 14128 32 --1 -1 2 40.14180 40.14910 14160 32 --1 -1 6 41.93130 44.86230 14192 96 --1 -1 19 42.68790 49.17300 14288 304 --1 -1 2 49.17050 50.00000 14592 32 --1 -1 3 49.73450 50.00000 14624 48 --1 -1 3 30.00000 30.86490 14672 48 --1 -1 5 49.09210 50.00000 14720 80 --1 -1 2 42.19650 42.33050 14800 32 --1 -1 3 30.00000 30.34210 14832 48 --1 -1 19 41.58130 50.00000 14880 304 --1 -1 5 49.14210 50.00000 15184 80 --1 -1 2 49.94350 50.00000 15264 32 --1 -1 2 49.99050 50.00000 15296 32 --1 -1 3 49.50770 49.98930 15328 48 --1 -1 8 40.09290 43.00560 15376 128 --1 -1 8 42.29540 48.26750 15504 128 --1 -1 6 47.68550 50.00000 15632 96 --1 -1 2 38.22490 38.30640 15728 32 --1 -1 2 38.30640 38.62100 15760 32 --1 -1 2 39.82930 40.09600 15792 32 --1 -1 2 38.00060 38.22490 15824 32 --1 -1 2 37.69540 37.83280 15856 32 --1 -1 2 37.83220 38.00060 15888 32 --1 -1 2 37.75860 38.02500 15920 32 --1 -1 2 37.75860 37.99660 15952 32 --1 -1 2 37.65700 37.66430 15984 32 --1 -1 2 37.99660 38.02500 16016 32 --1 -1 4 48.27820 48.99960 16048 64 --1 -1 9 30.00000 32.71820 16112 144 --1 -1 3 48.99960 48.99960 16256 48 --1 -1 5 48.09600 49.37650 16304 80 --1 -1 4 41.67560 42.54990 16384 64 --1 -1 8 43.01630 48.31240 16448 128 --1 -1 2 42.55420 43.01320 16576 32 --1 -1 8 42.48280 46.12240 16608 128 --1 -1 5 45.59320 47.36450 16736 80 --1 -1 3 46.11960 47.47130 16816 48 --1 -1 2 45.18390 45.59470 16864 32 --1 -1 7 30.00000 35.08580 16896 112 --1 -1 8 37.18820 41.99850 17008 128 --1 -1 2 42.70980 43.39710 17136 32 --1 -1 2 35.27350 35.32910 17168 32 --1 -1 2 35.84180 35.91590 17200 32 --1 -1 2 36.15150 36.15150 17232 32 --1 -1 13 10.00000 13.89040 17264 208 --1 -1 11 21.49830 30.00000 17472 176 --1 -1 7 15.35710 21.81540 17648 112 --1 -1 2 10.00000 10.27340 17760 32 --1 -1 4 10.00000 12.39350 17792 64 --1 -1 6 13.71710 23.00100 17856 96 --1 -1 4 10.00000 12.82960 17952 64 --1 -1 3 10.00000 10.99580 18016 48 --1 -1 7 11.89520 15.00190 18064 112 --1 -1 4 11.02480 11.67850 18176 64 --1 -1 2 20.84640 23.52160 18240 32 --1 -1 3 11.67910 12.39600 18272 48 --1 -1 2 14.99180 15.35930 18320 32 --1 -1 3 11.69380 13.89200 18352 48 --1 -1 3 19.14660 20.85220 18400 48 --1 -1 2 10.27340 10.60490 18448 32 --1 -1 2 12.82780 13.08170 18480 32 --1 -1 2 10.96410 11.09680 18512 32 --1 -1 2 10.00000 10.92160 18544 32 --1 -1 10 10.00000 17.99270 18576 160 --1 -1 4 29.18880 30.00000 18736 64 --1 -1 6 19.50030 30.00000 18800 96 --1 -1 8 10.00000 19.49970 18896 128 --1 -1 2 29.48550 30.00000 19024 32 --1 -1 5 21.99850 22.23220 19056 80 --1 -1 2 29.55110 30.00000 19136 32 --1 -1 3 21.76810 23.12610 19168 48 --1 -1 2 29.54620 29.57610 19216 32 --1 -1 3 10.00000 11.47710 19248 48 --1 -1 2 29.85320 30.00000 19296 32 --1 -1 8 12.69110 15.10570 19328 128 --1 -1 5 22.69980 24.97950 19456 80 --1 -1 4 28.54520 29.47450 19536 64 --1 -1 4 16.37740 17.45710 19600 64 --1 -1 3 29.45950 30.00000 19664 48 --1 -1 5 10.98210 12.70880 19712 80 --1 -1 3 25.77510 26.72600 19792 48 --1 -1 2 29.10430 30.00000 19840 32 --1 -1 2 27.17740 28.69840 19872 32 --1 -1 2 27.17740 28.69840 19904 32 --1 -1 3 28.77470 29.20530 19936 48 --1 -1 3 16.63100 18.99890 19984 48 --1 -1 9 15.61680 25.47910 20032 144 --1 -1 9 15.61680 25.47910 20176 144 --1 -1 2 25.63620 26.06560 20320 32 --1 -1 2 25.63620 26.06560 20352 32 --1 -1 2 25.63780 25.79000 20384 32 --1 -1 2 29.90110 30.00000 20416 32 --1 -1 2 24.55590 24.62030 20448 32 --1 -1 9 25.19310 30.00000 20480 144 --1 -1 4 29.38840 30.00000 20624 64 --1 -1 11 24.26900 30.00000 20688 176 --1 -1 3 23.64830 24.32120 20864 48 --1 -1 19 21.14090 26.63200 20912 304 --1 -1 12 10.34490 20.38830 21216 192 --1 -1 7 26.53280 30.00000 21408 112 --1 -1 17 21.98230 29.46750 21520 272 --1 -1 14 22.04850 28.54920 21792 224 --1 -1 9 26.37260 28.32490 22016 144 --1 -1 4 27.76490 29.32710 22160 64 --1 -1 4 27.86430 30.00000 22224 64 --1 -1 2 21.96980 22.05040 22288 32 --1 -1 2 10.00000 10.35190 22320 32 --1 -1 14 21.14270 23.37790 22352 224 --1 -1 2 20.34620 20.35230 22576 32 --1 -1 10 13.92070 18.42110 22608 160 --1 -1 12 19.61200 22.39770 22768 192 --1 -1 4 11.63550 14.35070 22960 64 --1 -1 4 16.62730 19.69250 23024 64 --1 -1 5 17.52760 20.15520 23088 80 --1 -1 5 10.42240 11.66990 23168 80 --1 -1 5 14.70530 16.62850 23248 80 --1 -1 4 20.15760 21.68290 23328 64 --1 -1 3 11.86950 13.79610 23392 48 --1 -1 4 17.53030 18.21420 23440 64 --1 -1 3 14.32410 14.70680 23504 48 --1 -1 4 10.03200 10.42390 23552 64 --1 -1 5 22.14370 22.60940 23616 80 --1 -1 2 13.92980 14.70800 23696 32 --1 -1 2 21.43270 21.96980 23728 32 --1 -1 2 21.43480 21.68540 23760 32 --1 -1 2 22.20330 22.20390 23792 32 --1 -1 2 21.44910 21.66740 23824 32 --1 -1 2 11.66480 11.87080 23856 32 --1 -1 2 13.79580 13.93350 23888 32 --1 -1 6 28.14420 30.00000 23920 96 --1 -1 10 14.54840 17.81990 24016 160 --1 -1 4 25.96640 28.14420 24176 64 --1 -1 8 12.99990 14.99310 24240 128 --1 -1 3 10.70830 11.06290 24368 48 --1 -1 3 13.81870 14.43150 24416 48 --1 -1 2 14.27440 15.07360 24464 32 --1 -1 3 17.81900 18.48770 24496 48 --1 -1 2 13.74610 14.22740 24544 32 --1 -1 2 15.07360 15.72460 24576 32 --1 -1 2 13.40520 13.81810 24608 32 --1 -1 2 12.98680 12.99990 24640 32 --1 -1 3 10.00000 11.85310 24672 48 --1 -1 2 18.04210 19.70600 24720 32 --1 -1 9 20.76490 30.00000 24752 144 --1 -1 7 10.00000 13.50410 24896 112 --1 -1 4 14.72480 16.63860 25008 64 --1 -1 5 12.32330 13.70790 25072 80 --1 -1 6 10.00000 12.00810 25152 96 --1 -1 6 13.06100 13.82640 25248 96 --1 -1 7 14.72600 15.70470 25344 112 --1 -1 6 15.49840 27.29030 25456 96 --1 -1 2 10.00000 11.00400 25552 32 --1 -1 4 10.95800 12.15520 25584 64 --1 -1 4 10.15110 10.66470 25648 64 --1 -1 6 13.27640 15.09010 25712 96 --1 -1 3 11.89580 12.25190 25808 48 --1 -1 4 11.89390 12.40790 25856 64 --1 -1 2 11.00130 11.10930 25920 32 --1 -1 2 21.82510 25.00020 25952 32 --1 -1 2 13.70890 14.76420 25984 32 --1 -1 3 10.25700 10.72140 26016 48 --1 -1 2 12.00810 12.50340 26064 32 --1 -1 2 10.25820 10.43370 26096 32 --1 -1 2 27.66660 27.66690 26128 32 --1 -1 2 12.15400 12.29340 26160 32 --1 -1 2 12.25010 12.50430 26192 32 --1 -1 2 12.29400 12.67580 26224 32 --1 -1 2 10.60820 10.91800 26256 32 --1 -1 2 11.09860 11.13920 26288 32 --1 -1 2 10.92840 10.96070 26320 32 --1 -1 7 -8.09812 -5.85657 26352 112 --1 -1 7 4.68162 10.00000 26464 112 --1 -1 18 -3.92325 2.26642 26576 288 --1 -1 5 7.98520 9.08598 26864 80 --1 -1 4 3.47890 5.13542 26944 64 --1 -1 9 -5.01427 2.42390 27008 144 --1 -1 7 1.72198 7.52956 27152 112 --1 -1 4 6.58839 10.00000 27264 64 --1 -1 7 7.52682 9.98993 27328 112 --1 -1 4 7.89364 10.00000 27440 64 --1 -1 4 2.22156 3.64187 27504 64 --1 -1 2 9.99237 10.00000 27568 32 --1 -1 4 0.97551 2.34485 27600 64 --1 -1 4 6.28077 10.00000 27664 64 --1 -1 4 -5.77966 -4.63371 27728 64 --1 -1 2 6.36469 7.89548 27792 32 --1 -1 2 7.54574 7.98672 27824 32 --1 -1 2 -6.05249 -5.85626 27856 32 --1 -1 2 2.42725 3.07424 27888 32 --1 -1 2 6.10040 6.59236 27920 32 --1 -1 2 6.21820 6.28016 27952 32 --1 -1 3 -10.00000 -8.48142 27984 48 --1 -1 4 -10.00000 -7.05531 28032 64 --1 -1 23 -4.67094 10.00000 28096 368 --1 -1 13 3.40658 10.00000 28464 208 --1 -1 4 -10.00000 -9.39605 28672 64 --1 -1 3 9.08598 10.00000 28736 48 --1 -1 9 4.12680 5.38140 28784 144 --1 -1 10 -4.46098 -2.30945 28928 160 --1 -1 4 -8.47929 -4.44938 29088 64 --1 -1 6 3.49111 4.61936 29152 96 --1 -1 4 1.11254 4.22263 29248 64 --1 -1 2 -9.40612 -8.19303 29312 32 --1 -1 3 -2.39796 -1.06126 29344 48 --1 -1 3 4.60105 5.02373 29392 48 --1 -1 2 -2.73854 -1.69268 29440 32 --1 -1 2 0.23484 1.11376 29472 32 --1 -1 2 -1.00114 0.23667 29504 32 --1 -1 2 -1.69268 -1.38445 29536 32 --1 -1 9 3.72335 10.00000 29568 144 --1 -1 3 -1.67224 2.82094 29712 48 --1 -1 2 2.83284 3.99008 29760 32 --1 -1 2 6.41993 6.42145 29792 32 --1 -1 2 9.52819 10.00000 29824 32 --1 -1 9 0.85374 4.36118 29856 144 --1 -1 7 5.63104 6.71107 30000 112 --1 -1 3 4.01877 4.89586 30112 48 --1 -1 3 4.31418 4.90257 30160 48 --1 -1 2 1.27825 1.31121 30208 32 --1 -1 2 -9.10155 -2.60548 30240 32 --1 -1 2 -4.37064 -4.28275 30272 32 --1 -1 3 8.02914 9.56847 30304 48 --1 -1 4 -4.42802 -3.36934 30352 64 --1 -1 13 -4.22416 1.43786 30416 208 --1 -1 4 -10.00000 -9.69207 30624 64 --1 -1 9 -10.00000 -4.14603 30688 144 --1 -1 4 -10.00000 -9.42992 30832 64 --1 -1 3 4.38285 5.23217 30896 48 --1 -1 9 6.11872 10.00000 30944 144 --1 -1 8 -4.99565 -0.10788 31088 128 --1 -1 8 0.64958 4.22202 31216 128 --1 -1 6 3.56039 5.20592 31344 96 --1 -1 5 7.22896 8.67491 31440 80 --1 -1 7 5.20348 7.84665 31520 112 --1 -1 4 2.79225 6.19318 31632 64 --1 -1 6 1.22484 2.14374 31696 96 --1 -1 3 1.22210 2.79011 31792 48 --1 -1 4 0.61875 1.71374 31840 64 --1 -1 2 7.84543 8.11643 31904 32 --1 -1 11 1.18547 5.48547 31936 176 --1 -1 8 1.89319 4.03494 32112 128 --1 -1 4 2.32959 5.76501 32240 64 --1 -1 3 8.11643 8.53513 32304 48 --1 -1 4 9.48180 10.00000 32352 64 --1 -1 4 8.37827 10.00000 32416 64 --1 -1 5 4.35355 7.56008 32480 80 --1 -1 5 8.27543 9.99756 32560 80 --1 -1 7 7.19387 8.44663 32640 112 --1 -1 3 7.41817 8.56840 32752 48 --1 -1 2 8.78080 10.00000 32800 32 --1 -1 2 6.92653 8.48814 32832 32 --1 -1 4 5.59014 8.77989 32864 64 --1 -1 2 5.10033 5.58862 32928 32 --1 -1 2 5.08598 5.11406 32960 32 --1 -1 6 -17.90330 -16.96880 32992 96 --1 -1 3 -23.97570 -22.00120 33088 48 --1 -1 6 -28.96090 -28.02850 33136 96 --1 -1 2 -28.42560 -26.45530 33232 32 --1 -1 3 -23.23960 -22.68510 33264 48 --1 -1 17 -13.45400 -10.00000 33312 272 --1 -1 20 -17.13540 -10.00000 33584 320 --1 -1 2 -11.56500 -10.00000 33904 32 --1 -1 8 -17.95940 -14.01250 33936 128 --1 -1 2 -18.01430 -17.90330 34064 32 --1 -1 5 -26.89570 -25.29960 34096 80 --1 -1 5 -17.62550 -10.87130 34176 80 --1 -1 4 -22.00120 -17.99880 34256 64 --1 -1 4 -26.89660 -23.97570 34320 64 --1 -1 4 -20.51010 -17.47840 34384 64 --1 -1 3 -24.63190 -22.19230 34448 48 --1 -1 4 -30.00000 -28.61330 34496 64 --1 -1 10 -27.31620 -22.41810 34560 160 --1 -1 5 -21.34510 -18.40470 34720 80 --1 -1 4 -17.34600 -15.63360 34800 64 --1 -1 3 -18.48520 -17.79770 34864 48 --1 -1 3 -22.06560 -20.50740 34912 48 --1 -1 3 -22.41600 -21.34720 34960 48 --1 -1 2 -11.41600 -10.68970 35008 32 --1 -1 3 -29.64170 -28.61420 35040 48 --1 -1 2 -26.45530 -24.76620 35088 32 --1 -1 2 -18.41140 -17.35760 35120 32 --1 -1 2 -18.01620 -17.47940 35152 32 --1 -1 2 -30.00000 -29.64290 35184 32 --1 -1 2 -25.62430 -24.73960 35216 32 --1 -1 2 -26.83960 -25.95760 35248 32 --1 -1 2 -24.74450 -24.63070 35280 32 --1 -1 2 -22.19200 -22.06320 35312 32 --1 -1 2 -10.68970 -10.47940 35344 32 --1 -1 13 -30.00000 -17.50530 35376 208 --1 -1 2 -10.69180 -10.00000 35584 32 --1 -1 10 -16.26440 -10.00000 35616 160 --1 -1 3 -10.00400 -10.00000 35776 48 --1 -1 4 -11.13470 -10.00000 35824 64 --1 -1 7 -18.34790 -10.95120 35888 112 --1 -1 8 -24.16620 -21.78760 36000 128 --1 -1 3 -22.23930 -19.29880 36128 48 --1 -1 5 -20.16860 -16.26440 36176 80 --1 -1 3 -30.00000 -27.17160 36256 48 --1 -1 6 -27.43400 -22.08550 36304 96 --1 -1 2 -24.34870 -24.16620 36400 32 --1 -1 3 -27.29490 -24.24860 36432 48 --1 -1 5 -22.08970 -19.29700 36480 80 --1 -1 3 -27.17160 -25.57370 36560 48 --1 -1 2 -27.43250 -27.29640 36608 32 --1 -1 2 -22.08910 -22.08240 36640 32 --1 -1 4 -30.65890 -30.00000 36672 64 --1 -1 2 -30.31770 -30.00000 36736 32 --1 -1 2 -30.40440 -30.31710 36768 32 --1 -1 21 -50.00000 -30.00000 36800 336 --1 -1 3 -32.45000 -30.00000 37136 48 --1 -1 8 -33.74580 -30.10990 37184 128 --1 -1 2 -34.17360 -32.45400 37312 32 --1 -1 5 -51.99770 -50.00000 37344 80 --1 -1 2 -54.88590 -52.64350 37424 32 --1 -1 2 -52.37800 -51.99560 37456 32 +-1 -1 2 70.00000 70.06710 0 16 +-1 -1 2 70.00000 70.08820 16 16 +-1 -1 7 50.00000 51.01900 32 56 +-1 -1 7 50.00000 53.60750 88 56 +-1 -1 2 54.46630 54.47670 144 16 +-1 -1 2 50.00000 50.32320 160 16 +-1 -1 18 58.90490 68.50860 176 144 +-1 -1 3 50.00000 50.16690 320 24 +-1 -1 2 50.00000 51.09100 344 16 +-1 -1 4 50.86580 53.27000 360 32 +-1 -1 3 50.75650 51.48650 392 24 +-1 -1 2 50.00000 50.12660 416 16 +-1 -1 2 54.76570 55.08640 432 16 +-1 -1 6 50.00000 54.46630 448 48 +-1 -1 2 68.40670 69.05760 496 16 +-1 -1 8 65.51320 70.00000 512 64 +-1 -1 7 62.91430 69.05060 576 56 +-1 -1 4 55.67540 56.45060 632 32 +-1 -1 4 55.67540 56.45060 664 32 +-1 -1 3 53.94780 54.97720 696 24 +-1 -1 3 53.94780 54.97720 720 24 +-1 -1 4 50.00000 50.95950 744 32 +-1 -1 3 51.84390 52.36700 776 24 +-1 -1 3 57.53580 58.08450 800 24 +-1 -1 2 55.60310 56.14940 824 16 +-1 -1 2 55.60310 56.14940 840 16 +-1 -1 2 51.37510 51.63030 856 16 +-1 -1 2 60.54760 62.91250 872 16 +-1 -1 2 56.15120 57.53640 888 16 +-1 -1 4 69.02950 70.00000 904 32 +-1 -1 2 54.46080 55.60310 936 16 +-1 -1 2 51.53110 51.92260 952 16 +-1 -1 2 51.63030 51.92080 968 16 +-1 -1 2 52.10820 53.12110 984 16 +-1 -1 2 53.12110 53.43880 1000 16 +-1 -1 3 54.97720 55.67480 1016 24 +-1 -1 3 54.97720 55.67480 1040 24 +-1 -1 2 50.95950 51.25950 1064 16 +-1 -1 2 51.25280 51.37510 1080 16 +-1 -1 2 53.43850 53.80440 1096 16 +-1 -1 2 51.25310 51.94430 1112 16 +-1 -1 2 55.07210 55.24880 1128 16 +-1 -1 2 54.36500 55.07180 1144 16 +-1 -1 2 58.00980 59.15970 1160 16 +-1 -1 2 51.94430 52.10820 1176 16 +-1 -1 2 51.36900 51.84330 1192 16 +-1 -1 2 57.53580 58.00980 1208 16 +-1 -1 2 54.00210 54.46020 1224 16 +-1 -1 2 55.67510 55.82650 1240 16 +-1 -1 2 55.67510 55.82650 1256 16 +-1 -1 2 55.79200 56.14940 1272 16 +-1 -1 2 55.79200 56.14940 1288 16 +-1 -1 2 53.80320 54.00210 1304 16 +-1 -1 2 59.15970 59.35260 1320 16 +-1 -1 2 55.79200 55.82650 1336 16 +-1 -1 2 55.79200 55.82650 1352 16 +-1 -1 2 51.25950 51.36900 1368 16 +-1 -1 2 59.35260 59.47860 1384 16 +-1 -1 2 60.25530 60.54550 1400 16 +-1 -1 3 50.00000 51.76910 1416 24 +-1 -1 2 50.00000 50.37510 1440 16 +-1 -1 6 50.52830 51.12000 1456 48 +-1 -1 3 50.47820 51.15600 1504 24 +-1 -1 4 51.45480 51.78100 1528 32 +-1 -1 2 50.00000 50.37690 1560 16 +-1 -1 2 50.52860 51.50670 1576 16 +-1 -1 2 51.46430 51.50670 1592 16 +-1 -1 2 51.08490 51.15600 1608 16 +-1 -1 2 51.08460 51.12000 1624 16 +-1 -1 9 52.00080 54.18250 1640 72 +-1 -1 4 50.79260 51.26470 1712 32 +-1 -1 2 50.85330 51.66930 1744 16 +-1 -1 6 53.43600 54.38790 1760 48 +-1 -1 3 54.64520 55.36720 1808 24 +-1 -1 4 53.34570 54.47550 1832 32 +-1 -1 2 54.39090 54.64300 1864 16 +-1 -1 2 54.39090 54.64300 1880 16 +-1 -1 3 54.19320 55.29670 1896 24 +-1 -1 2 55.29730 55.36840 1920 16 +-1 -1 2 51.61990 52.00080 1936 16 +-1 -1 3 53.43600 54.11110 1952 24 +-1 -1 2 51.66930 53.34540 1976 16 +-1 -1 2 54.19780 54.39250 1992 16 +-1 -1 2 51.42820 51.61990 2008 16 +-1 -1 2 54.18250 54.19680 2024 16 +-1 -1 2 51.26680 51.43010 2040 16 +-1 -1 5 50.00000 50.87460 2056 40 +-1 -1 5 50.00000 52.14360 2096 40 +-1 -1 3 50.00000 51.00250 2136 24 +-1 -1 4 50.73610 51.31440 2160 32 +-1 -1 3 50.00000 50.28410 2192 24 +-1 -1 6 50.00000 51.88020 2216 48 +-1 -1 2 50.00000 51.12950 2264 16 +-1 -1 7 50.20840 53.55410 2280 56 +-1 -1 2 50.00000 50.20290 2336 16 +-1 -1 3 60.30750 69.64570 2352 24 +-1 -1 9 54.70770 60.35230 2376 72 +-1 -1 3 54.09950 55.07060 2448 24 +-1 -1 4 49.23280 50.00000 2472 32 +-1 -1 5 45.76780 46.87100 2504 40 +-1 -1 4 47.58510 50.00000 2544 32 +-1 -1 6 30.00000 33.17240 2576 48 +-1 -1 14 43.78870 47.54060 2624 112 +-1 -1 10 47.27470 50.00000 2736 80 +-1 -1 6 46.86920 48.15460 2816 48 +-1 -1 6 45.93220 47.80700 2864 48 +-1 -1 2 39.80700 39.84480 2912 16 +-1 -1 3 41.85050 42.62590 2928 24 +-1 -1 2 48.61690 49.51810 2952 16 +-1 -1 3 49.46010 50.00000 2968 24 +-1 -1 3 49.98020 50.00000 2992 24 +-1 -1 6 45.59810 47.09470 3016 48 +-1 -1 7 30.23380 36.94350 3064 56 +-1 -1 5 48.14420 49.01880 3120 40 +-1 -1 2 42.60210 42.70920 3160 16 +-1 -1 2 49.54500 50.00000 3176 16 +-1 -1 2 42.43460 42.50690 3192 16 +-1 -1 3 42.50690 42.56550 3208 24 +-1 -1 2 42.95280 43.18230 3232 16 +-1 -1 2 39.87010 39.93060 3248 16 +-1 -1 2 43.91350 43.91620 3264 16 +-1 -1 2 47.06420 47.27410 3280 16 +-1 -1 2 48.01240 48.14360 3296 16 +-1 -1 2 42.46110 42.46230 3312 16 +-1 -1 2 42.48650 42.66290 3328 16 +-1 -1 2 41.34140 41.41070 3344 16 +-1 -1 2 43.72950 43.75750 3360 16 +-1 -1 2 47.69310 47.69310 3376 16 +-1 -1 10 42.54600 45.18640 3392 80 +-1 -1 2 43.12340 43.53440 3472 16 +-1 -1 3 44.85310 45.90750 3488 24 +-1 -1 4 45.45860 46.48370 3512 32 +-1 -1 4 49.07840 49.43690 3544 32 +-1 -1 9 43.62480 46.15140 3576 72 +-1 -1 8 30.00000 33.37800 3648 64 +-1 -1 3 30.00000 31.64710 3712 24 +-1 -1 9 45.21200 48.26380 3736 72 +-1 -1 4 48.41180 50.00000 3808 32 +-1 -1 3 47.95350 48.57600 3840 24 +-1 -1 6 40.73530 41.75010 3864 48 +-1 -1 5 35.92660 36.83360 3912 40 +-1 -1 5 39.66900 42.53990 3952 40 +-1 -1 2 30.00000 31.32270 3992 16 +-1 -1 6 41.34140 44.22630 4008 48 +-1 -1 5 30.00000 31.83290 4056 40 +-1 -1 2 49.90330 50.00000 4096 16 +-1 -1 2 31.98670 32.75000 4112 16 +-1 -1 2 46.55120 48.00990 4128 16 +-1 -1 2 49.62310 49.90420 4144 16 +-1 -1 3 41.71250 42.08820 4160 24 +-1 -1 2 33.37530 33.94480 4184 16 +-1 -1 2 31.93850 32.23610 4200 16 +-1 -1 3 47.83140 48.36760 4216 24 +-1 -1 3 47.10930 47.86830 4240 24 +-1 -1 2 48.58820 49.06550 4264 16 +-1 -1 2 48.07130 48.46490 4280 16 +-1 -1 2 48.25860 48.46490 4296 16 +-1 -1 2 33.09390 33.24900 4312 16 +-1 -1 2 36.02980 36.20490 4328 16 +-1 -1 2 31.21740 31.59670 4344 16 +-1 -1 2 48.00960 48.07130 4360 16 +-1 -1 2 48.36760 48.58820 4376 16 +-1 -1 2 37.64870 37.83950 4392 16 +-1 -1 2 36.46920 36.49150 4408 16 +-1 -1 2 45.13730 45.43180 4424 16 +-1 -1 2 46.41570 46.55120 4440 16 +-1 -1 2 36.56290 36.76650 4456 16 +-1 -1 2 37.25170 37.50470 4472 16 +-1 -1 2 38.11230 38.32440 4488 16 +-1 -1 2 39.38740 39.39860 4504 16 +-1 -1 2 36.93000 37.06400 4520 16 +-1 -1 2 39.81400 40.03620 4536 16 +-1 -1 2 36.62970 36.64130 4552 16 +-1 -1 2 38.48400 38.70130 4568 16 +-1 -1 2 40.25440 40.40360 4584 16 +-1 -1 2 38.88040 39.07550 4600 16 +-1 -1 2 31.80760 31.80820 4616 16 +-1 -1 2 33.20710 33.25170 4632 16 +-1 -1 2 43.90430 43.92900 4648 16 +-1 -1 2 41.94230 42.32650 4664 16 +-1 -1 3 42.56340 43.12340 4680 24 +-1 -1 14 30.00000 39.64860 4704 112 +-1 -1 2 36.83360 37.32160 4816 16 +-1 -1 7 36.95200 38.28200 4832 56 +-1 -1 8 41.26270 42.79770 4888 64 +-1 -1 5 39.63270 41.58310 4952 40 +-1 -1 6 38.44530 39.71970 4992 48 +-1 -1 3 49.94200 50.00000 5040 24 +-1 -1 5 38.87800 41.29870 5064 40 +-1 -1 5 36.97060 37.38480 5104 40 +-1 -1 4 41.89680 42.89910 5144 32 +-1 -1 4 41.89680 42.89910 5176 32 +-1 -1 4 41.89680 42.89910 5208 32 +-1 -1 6 46.34550 48.24860 5240 48 +-1 -1 4 41.28680 42.33720 5288 32 +-1 -1 2 49.60510 49.62310 5320 16 +-1 -1 3 42.89910 43.54570 5336 24 +-1 -1 3 42.89910 43.54570 5360 24 +-1 -1 3 41.05000 41.89590 5384 24 +-1 -1 3 41.19620 41.89720 5408 24 +-1 -1 4 33.94480 37.06190 5432 32 +-1 -1 3 30.00000 31.93850 5464 24 +-1 -1 3 38.84200 39.70570 5488 24 +-1 -1 3 48.24860 50.00000 5512 24 +-1 -1 2 49.06550 49.18390 5536 16 +-1 -1 3 30.00000 30.01530 5552 24 +-1 -1 2 41.11070 41.29780 5576 16 +-1 -1 2 41.11070 41.29780 5592 16 +-1 -1 2 41.32620 45.00300 5608 16 +-1 -1 3 45.00240 45.57120 5624 24 +-1 -1 2 37.05970 37.31980 5648 16 +-1 -1 2 49.18390 49.60050 5664 16 +-1 -1 2 40.66480 40.66510 5680 16 +-1 -1 2 30.00000 30.00790 5696 16 +-1 -1 2 41.00420 41.00570 5712 16 +-1 -1 17 33.40760 41.93130 5728 136 +-1 -1 3 44.86230 44.92970 5864 24 +-1 -1 23 30.00000 38.47210 5888 184 +-1 -1 12 30.00000 37.02560 6072 96 +-1 -1 7 30.86490 33.40520 6168 56 +-1 -1 3 30.00000 31.59640 6224 24 +-1 -1 4 35.60520 36.95200 6248 32 +-1 -1 4 41.23430 42.22400 6280 32 +-1 -1 7 32.30320 35.50030 6312 56 +-1 -1 3 37.36550 40.03100 6368 24 +-1 -1 3 37.36550 40.03100 6392 24 +-1 -1 6 41.00420 42.25270 6416 48 +-1 -1 4 40.14570 41.00600 6464 32 +-1 -1 6 42.25330 43.26860 6496 48 +-1 -1 3 42.33050 42.80630 6544 24 +-1 -1 4 39.50760 40.24490 6568 32 +-1 -1 5 40.60750 42.25270 6600 40 +-1 -1 4 39.19200 39.62020 6640 32 +-1 -1 4 37.18580 39.29430 6672 32 +-1 -1 5 40.22450 41.05030 6704 40 +-1 -1 4 39.29370 40.14910 6744 32 +-1 -1 3 40.03070 41.23550 6776 24 +-1 -1 5 42.42420 43.73770 6800 40 +-1 -1 5 42.42420 43.73770 6840 40 +-1 -1 2 31.59910 32.30410 6880 16 +-1 -1 2 42.80630 43.26860 6896 16 +-1 -1 3 39.89330 40.16310 6912 24 +-1 -1 2 43.48620 44.60530 6936 16 +-1 -1 4 41.14370 42.42390 6952 32 +-1 -1 2 41.14340 41.19430 6984 16 +-1 -1 2 39.88750 39.88820 7000 16 +-1 -1 2 40.42980 40.72470 7016 16 +-1 -1 2 40.18480 40.22450 7032 16 +-1 -1 2 41.05150 41.19430 7048 16 +-1 -1 2 40.99930 41.00110 7064 16 +-1 -1 2 40.14180 40.14910 7080 16 +-1 -1 6 41.93130 44.86230 7096 48 +-1 -1 19 42.68790 49.17300 7144 152 +-1 -1 2 49.17050 50.00000 7296 16 +-1 -1 3 49.73450 50.00000 7312 24 +-1 -1 3 30.00000 30.86490 7336 24 +-1 -1 5 49.09210 50.00000 7360 40 +-1 -1 2 42.19650 42.33050 7400 16 +-1 -1 3 30.00000 30.34210 7416 24 +-1 -1 19 41.58130 50.00000 7440 152 +-1 -1 5 49.14210 50.00000 7592 40 +-1 -1 2 49.94350 50.00000 7632 16 +-1 -1 2 49.99050 50.00000 7648 16 +-1 -1 3 49.50770 49.98930 7664 24 +-1 -1 8 40.09290 43.00560 7688 64 +-1 -1 8 42.29540 48.26750 7752 64 +-1 -1 6 47.68550 50.00000 7816 48 +-1 -1 2 38.22490 38.30640 7864 16 +-1 -1 2 38.30640 38.62100 7880 16 +-1 -1 2 39.82930 40.09600 7896 16 +-1 -1 2 38.00060 38.22490 7912 16 +-1 -1 2 37.69540 37.83280 7928 16 +-1 -1 2 37.83220 38.00060 7944 16 +-1 -1 2 37.75860 38.02500 7960 16 +-1 -1 2 37.75860 37.99660 7976 16 +-1 -1 2 37.65700 37.66430 7992 16 +-1 -1 2 37.99660 38.02500 8008 16 +-1 -1 4 48.27820 48.99960 8024 32 +-1 -1 9 30.00000 32.71820 8056 72 +-1 -1 3 48.99960 48.99960 8128 24 +-1 -1 5 48.09600 49.37650 8152 40 +-1 -1 4 41.67560 42.54990 8192 32 +-1 -1 8 43.01630 48.31240 8224 64 +-1 -1 2 42.55420 43.01320 8288 16 +-1 -1 8 42.48280 46.12240 8304 64 +-1 -1 5 45.59320 47.36450 8368 40 +-1 -1 3 46.11960 47.47130 8408 24 +-1 -1 2 45.18390 45.59470 8432 16 +-1 -1 7 30.00000 35.08580 8448 56 +-1 -1 8 37.18820 41.99850 8504 64 +-1 -1 2 42.70980 43.39710 8568 16 +-1 -1 2 35.27350 35.32910 8584 16 +-1 -1 2 35.84180 35.91590 8600 16 +-1 -1 2 36.15150 36.15150 8616 16 +-1 -1 13 10.00000 13.89040 8632 104 +-1 -1 11 21.49830 30.00000 8736 88 +-1 -1 7 15.35710 21.81540 8824 56 +-1 -1 2 10.00000 10.27340 8880 16 +-1 -1 4 10.00000 12.39350 8896 32 +-1 -1 6 13.71710 23.00100 8928 48 +-1 -1 4 10.00000 12.82960 8976 32 +-1 -1 3 10.00000 10.99580 9008 24 +-1 -1 7 11.89520 15.00190 9032 56 +-1 -1 4 11.02480 11.67850 9088 32 +-1 -1 2 20.84640 23.52160 9120 16 +-1 -1 3 11.67910 12.39600 9136 24 +-1 -1 2 14.99180 15.35930 9160 16 +-1 -1 3 11.69380 13.89200 9176 24 +-1 -1 3 19.14660 20.85220 9200 24 +-1 -1 2 10.27340 10.60490 9224 16 +-1 -1 2 12.82780 13.08170 9240 16 +-1 -1 2 10.96410 11.09680 9256 16 +-1 -1 2 10.00000 10.92160 9272 16 +-1 -1 10 10.00000 17.99270 9288 80 +-1 -1 4 29.18880 30.00000 9368 32 +-1 -1 6 19.50030 30.00000 9400 48 +-1 -1 8 10.00000 19.49970 9448 64 +-1 -1 2 29.48550 30.00000 9512 16 +-1 -1 5 21.99850 22.23220 9528 40 +-1 -1 2 29.55110 30.00000 9568 16 +-1 -1 3 21.76810 23.12610 9584 24 +-1 -1 2 29.54620 29.57610 9608 16 +-1 -1 3 10.00000 11.47710 9624 24 +-1 -1 2 29.85320 30.00000 9648 16 +-1 -1 8 12.69110 15.10570 9664 64 +-1 -1 5 22.69980 24.97950 9728 40 +-1 -1 4 28.54520 29.47450 9768 32 +-1 -1 4 16.37740 17.45710 9800 32 +-1 -1 3 29.45950 30.00000 9832 24 +-1 -1 5 10.98210 12.70880 9856 40 +-1 -1 3 25.77510 26.72600 9896 24 +-1 -1 2 29.10430 30.00000 9920 16 +-1 -1 2 27.17740 28.69840 9936 16 +-1 -1 2 27.17740 28.69840 9952 16 +-1 -1 3 28.77470 29.20530 9968 24 +-1 -1 3 16.63100 18.99890 9992 24 +-1 -1 9 15.61680 25.47910 10016 72 +-1 -1 9 15.61680 25.47910 10088 72 +-1 -1 2 25.63620 26.06560 10160 16 +-1 -1 2 25.63620 26.06560 10176 16 +-1 -1 2 25.63780 25.79000 10192 16 +-1 -1 2 29.90110 30.00000 10208 16 +-1 -1 2 24.55590 24.62030 10224 16 +-1 -1 9 25.19310 30.00000 10240 72 +-1 -1 4 29.38840 30.00000 10312 32 +-1 -1 11 24.26900 30.00000 10344 88 +-1 -1 3 23.64830 24.32120 10432 24 +-1 -1 19 21.14090 26.63200 10456 152 +-1 -1 12 10.34490 20.38830 10608 96 +-1 -1 7 26.53280 30.00000 10704 56 +-1 -1 17 21.98230 29.46750 10760 136 +-1 -1 14 22.04850 28.54920 10896 112 +-1 -1 9 26.37260 28.32490 11008 72 +-1 -1 4 27.76490 29.32710 11080 32 +-1 -1 4 27.86430 30.00000 11112 32 +-1 -1 2 21.96980 22.05040 11144 16 +-1 -1 2 10.00000 10.35190 11160 16 +-1 -1 14 21.14270 23.37790 11176 112 +-1 -1 2 20.34620 20.35230 11288 16 +-1 -1 10 13.92070 18.42110 11304 80 +-1 -1 12 19.61200 22.39770 11384 96 +-1 -1 4 11.63550 14.35070 11480 32 +-1 -1 4 16.62730 19.69250 11512 32 +-1 -1 5 17.52760 20.15520 11544 40 +-1 -1 5 10.42240 11.66990 11584 40 +-1 -1 5 14.70530 16.62850 11624 40 +-1 -1 4 20.15760 21.68290 11664 32 +-1 -1 3 11.86950 13.79610 11696 24 +-1 -1 4 17.53030 18.21420 11720 32 +-1 -1 3 14.32410 14.70680 11752 24 +-1 -1 4 10.03200 10.42390 11776 32 +-1 -1 5 22.14370 22.60940 11808 40 +-1 -1 2 13.92980 14.70800 11848 16 +-1 -1 2 21.43270 21.96980 11864 16 +-1 -1 2 21.43480 21.68540 11880 16 +-1 -1 2 22.20330 22.20390 11896 16 +-1 -1 2 21.44910 21.66740 11912 16 +-1 -1 2 11.66480 11.87080 11928 16 +-1 -1 2 13.79580 13.93350 11944 16 +-1 -1 6 28.14420 30.00000 11960 48 +-1 -1 10 14.54840 17.81990 12008 80 +-1 -1 4 25.96640 28.14420 12088 32 +-1 -1 8 12.99990 14.99310 12120 64 +-1 -1 3 10.70830 11.06290 12184 24 +-1 -1 3 13.81870 14.43150 12208 24 +-1 -1 2 14.27440 15.07360 12232 16 +-1 -1 3 17.81900 18.48770 12248 24 +-1 -1 2 13.74610 14.22740 12272 16 +-1 -1 2 15.07360 15.72460 12288 16 +-1 -1 2 13.40520 13.81810 12304 16 +-1 -1 2 12.98680 12.99990 12320 16 +-1 -1 3 10.00000 11.85310 12336 24 +-1 -1 2 18.04210 19.70600 12360 16 +-1 -1 9 20.76490 30.00000 12376 72 +-1 -1 7 10.00000 13.50410 12448 56 +-1 -1 4 14.72480 16.63860 12504 32 +-1 -1 5 12.32330 13.70790 12536 40 +-1 -1 6 10.00000 12.00810 12576 48 +-1 -1 6 13.06100 13.82640 12624 48 +-1 -1 7 14.72600 15.70470 12672 56 +-1 -1 6 15.49840 27.29030 12728 48 +-1 -1 2 10.00000 11.00400 12776 16 +-1 -1 4 10.95800 12.15520 12792 32 +-1 -1 4 10.15110 10.66470 12824 32 +-1 -1 6 13.27640 15.09010 12856 48 +-1 -1 3 11.89580 12.25190 12904 24 +-1 -1 4 11.89390 12.40790 12928 32 +-1 -1 2 11.00130 11.10930 12960 16 +-1 -1 2 21.82510 25.00020 12976 16 +-1 -1 2 13.70890 14.76420 12992 16 +-1 -1 3 10.25700 10.72140 13008 24 +-1 -1 2 12.00810 12.50340 13032 16 +-1 -1 2 10.25820 10.43370 13048 16 +-1 -1 2 27.66660 27.66690 13064 16 +-1 -1 2 12.15400 12.29340 13080 16 +-1 -1 2 12.25010 12.50430 13096 16 +-1 -1 2 12.29400 12.67580 13112 16 +-1 -1 2 10.60820 10.91800 13128 16 +-1 -1 2 11.09860 11.13920 13144 16 +-1 -1 2 10.92840 10.96070 13160 16 +-1 -1 7 -8.09812 -5.85657 13176 56 +-1 -1 7 4.68162 10.00000 13232 56 +-1 -1 18 -3.92325 2.26642 13288 144 +-1 -1 5 7.98520 9.08598 13432 40 +-1 -1 4 3.47890 5.13542 13472 32 +-1 -1 9 -5.01427 2.42390 13504 72 +-1 -1 7 1.72198 7.52956 13576 56 +-1 -1 4 6.58839 10.00000 13632 32 +-1 -1 7 7.52682 9.98993 13664 56 +-1 -1 4 7.89364 10.00000 13720 32 +-1 -1 4 2.22156 3.64187 13752 32 +-1 -1 2 9.99237 10.00000 13784 16 +-1 -1 4 0.97551 2.34485 13800 32 +-1 -1 4 6.28077 10.00000 13832 32 +-1 -1 4 -5.77966 -4.63371 13864 32 +-1 -1 2 6.36469 7.89548 13896 16 +-1 -1 2 7.54574 7.98672 13912 16 +-1 -1 2 -6.05249 -5.85626 13928 16 +-1 -1 2 2.42725 3.07424 13944 16 +-1 -1 2 6.10040 6.59236 13960 16 +-1 -1 2 6.21820 6.28016 13976 16 +-1 -1 3 -10.00000 -8.48142 13992 24 +-1 -1 4 -10.00000 -7.05531 14016 32 +-1 -1 23 -4.67094 10.00000 14048 184 +-1 -1 13 3.40658 10.00000 14232 104 +-1 -1 4 -10.00000 -9.39605 14336 32 +-1 -1 3 9.08598 10.00000 14368 24 +-1 -1 9 4.12680 5.38140 14392 72 +-1 -1 10 -4.46098 -2.30945 14464 80 +-1 -1 4 -8.47929 -4.44938 14544 32 +-1 -1 6 3.49111 4.61936 14576 48 +-1 -1 4 1.11254 4.22263 14624 32 +-1 -1 2 -9.40612 -8.19303 14656 16 +-1 -1 3 -2.39796 -1.06126 14672 24 +-1 -1 3 4.60105 5.02373 14696 24 +-1 -1 2 -2.73854 -1.69268 14720 16 +-1 -1 2 0.23484 1.11376 14736 16 +-1 -1 2 -1.00114 0.23667 14752 16 +-1 -1 2 -1.69268 -1.38445 14768 16 +-1 -1 9 3.72335 10.00000 14784 72 +-1 -1 3 -1.67224 2.82094 14856 24 +-1 -1 2 2.83284 3.99008 14880 16 +-1 -1 2 6.41993 6.42145 14896 16 +-1 -1 2 9.52819 10.00000 14912 16 +-1 -1 9 0.85374 4.36118 14928 72 +-1 -1 7 5.63104 6.71107 15000 56 +-1 -1 3 4.01877 4.89586 15056 24 +-1 -1 3 4.31418 4.90257 15080 24 +-1 -1 2 1.27825 1.31121 15104 16 +-1 -1 2 -9.10155 -2.60548 15120 16 +-1 -1 2 -4.37064 -4.28275 15136 16 +-1 -1 3 8.02914 9.56847 15152 24 +-1 -1 4 -4.42802 -3.36934 15176 32 +-1 -1 13 -4.22416 1.43786 15208 104 +-1 -1 4 -10.00000 -9.69207 15312 32 +-1 -1 9 -10.00000 -4.14603 15344 72 +-1 -1 4 -10.00000 -9.42992 15416 32 +-1 -1 3 4.38285 5.23217 15448 24 +-1 -1 9 6.11872 10.00000 15472 72 +-1 -1 8 -4.99565 -0.10788 15544 64 +-1 -1 8 0.64958 4.22202 15608 64 +-1 -1 6 3.56039 5.20592 15672 48 +-1 -1 5 7.22896 8.67491 15720 40 +-1 -1 7 5.20348 7.84665 15760 56 +-1 -1 4 2.79225 6.19318 15816 32 +-1 -1 6 1.22484 2.14374 15848 48 +-1 -1 3 1.22210 2.79011 15896 24 +-1 -1 4 0.61875 1.71374 15920 32 +-1 -1 2 7.84543 8.11643 15952 16 +-1 -1 11 1.18547 5.48547 15968 88 +-1 -1 8 1.89319 4.03494 16056 64 +-1 -1 4 2.32959 5.76501 16120 32 +-1 -1 3 8.11643 8.53513 16152 24 +-1 -1 4 9.48180 10.00000 16176 32 +-1 -1 4 8.37827 10.00000 16208 32 +-1 -1 5 4.35355 7.56008 16240 40 +-1 -1 5 8.27543 9.99756 16280 40 +-1 -1 7 7.19387 8.44663 16320 56 +-1 -1 3 7.41817 8.56840 16376 24 +-1 -1 2 8.78080 10.00000 16400 16 +-1 -1 2 6.92653 8.48814 16416 16 +-1 -1 4 5.59014 8.77989 16432 32 +-1 -1 2 5.10033 5.58862 16464 16 +-1 -1 2 5.08598 5.11406 16480 16 +-1 -1 6 -17.90330 -16.96880 16496 48 +-1 -1 3 -23.97570 -22.00120 16544 24 +-1 -1 6 -28.96090 -28.02850 16568 48 +-1 -1 2 -28.42560 -26.45530 16616 16 +-1 -1 3 -23.23960 -22.68510 16632 24 +-1 -1 17 -13.45400 -10.00000 16656 136 +-1 -1 20 -17.13540 -10.00000 16792 160 +-1 -1 2 -11.56500 -10.00000 16952 16 +-1 -1 8 -17.95940 -14.01250 16968 64 +-1 -1 2 -18.01430 -17.90330 17032 16 +-1 -1 5 -26.89570 -25.29960 17048 40 +-1 -1 5 -17.62550 -10.87130 17088 40 +-1 -1 4 -22.00120 -17.99880 17128 32 +-1 -1 4 -26.89660 -23.97570 17160 32 +-1 -1 4 -20.51010 -17.47840 17192 32 +-1 -1 3 -24.63190 -22.19230 17224 24 +-1 -1 4 -30.00000 -28.61330 17248 32 +-1 -1 10 -27.31620 -22.41810 17280 80 +-1 -1 5 -21.34510 -18.40470 17360 40 +-1 -1 4 -17.34600 -15.63360 17400 32 +-1 -1 3 -18.48520 -17.79770 17432 24 +-1 -1 3 -22.06560 -20.50740 17456 24 +-1 -1 3 -22.41600 -21.34720 17480 24 +-1 -1 2 -11.41600 -10.68970 17504 16 +-1 -1 3 -29.64170 -28.61420 17520 24 +-1 -1 2 -26.45530 -24.76620 17544 16 +-1 -1 2 -18.41140 -17.35760 17560 16 +-1 -1 2 -18.01620 -17.47940 17576 16 +-1 -1 2 -30.00000 -29.64290 17592 16 +-1 -1 2 -25.62430 -24.73960 17608 16 +-1 -1 2 -26.83960 -25.95760 17624 16 +-1 -1 2 -24.74450 -24.63070 17640 16 +-1 -1 2 -22.19200 -22.06320 17656 16 +-1 -1 2 -10.68970 -10.47940 17672 16 +-1 -1 13 -30.00000 -17.50530 17688 104 +-1 -1 2 -10.69180 -10.00000 17792 16 +-1 -1 10 -16.26440 -10.00000 17808 80 +-1 -1 3 -10.00400 -10.00000 17888 24 +-1 -1 4 -11.13470 -10.00000 17912 32 +-1 -1 7 -18.34790 -10.95120 17944 56 +-1 -1 8 -24.16620 -21.78760 18000 64 +-1 -1 3 -22.23930 -19.29880 18064 24 +-1 -1 5 -20.16860 -16.26440 18088 40 +-1 -1 3 -30.00000 -27.17160 18128 24 +-1 -1 6 -27.43400 -22.08550 18152 48 +-1 -1 2 -24.34870 -24.16620 18200 16 +-1 -1 3 -27.29490 -24.24860 18216 24 +-1 -1 5 -22.08970 -19.29700 18240 40 +-1 -1 3 -27.17160 -25.57370 18280 24 +-1 -1 2 -27.43250 -27.29640 18304 16 +-1 -1 2 -22.08910 -22.08240 18320 16 +-1 -1 4 -30.65890 -30.00000 18336 32 +-1 -1 2 -30.31770 -30.00000 18368 16 +-1 -1 2 -30.40440 -30.31710 18384 16 +-1 -1 21 -50.00000 -30.00000 18400 168 +-1 -1 3 -32.45000 -30.00000 18568 24 +-1 -1 8 -33.74580 -30.10990 18592 64 +-1 -1 2 -34.17360 -32.45400 18656 16 +-1 -1 5 -51.99770 -50.00000 18672 40 +-1 -1 2 -54.88590 -52.64350 18712 16 +-1 -1 2 -52.37800 -51.99560 18728 16 Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_h.dat =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_h.dat 2007-11-08 22:11:50 UTC (rev 4165) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_h.dat 2007-11-08 22:29:29 UTC (rev 4166) @@ -1,2009 +1,2009 @@ --1 -1 14 70.00000 70.08890 0 224 --1 -1 4 70.00000 70.08830 224 64 --1 -1 2 70.06720 70.07050 288 32 --1 -1 3 68.00000 68.05120 320 48 --1 -1 7 68.00000 68.09050 368 112 --1 -1 3 68.52990 68.55990 480 48 --1 -1 14 68.05120 68.53920 528 224 --1 -1 7 68.55990 69.05750 752 112 --1 -1 8 68.37630 68.52990 864 128 --1 -1 53 68.52210 69.32610 992 848 --1 -1 23 68.62860 69.07640 1840 368 --1 -1 53 68.00000 68.52210 2208 848 --1 -1 70 68.55810 69.71000 3056 1120 --1 -1 32 69.71000 70.00000 4176 512 --1 -1 3 69.99250 70.00000 4688 48 --1 -1 24 68.00000 69.05060 4736 384 --1 -1 46 69.02920 69.99250 5120 736 --1 -1 33 69.46890 69.79360 5856 528 --1 -1 2 68.00000 69.64560 6384 32 --1 -1 8 66.00000 66.88340 6416 128 --1 -1 5 67.94560 68.00000 6544 80 --1 -1 18 66.88340 68.00000 6624 288 --1 -1 64 66.80980 68.00000 6912 1024 --1 -1 35 66.05460 66.79170 7936 560 --1 -1 3 66.79170 66.80980 8496 48 --1 -1 4 66.00000 66.05460 8544 64 --1 -1 3 67.70500 68.00000 8608 48 --1 -1 37 66.00000 67.67800 8656 592 --1 -1 3 67.67800 67.70500 9248 48 --1 -1 3 66.00000 68.00000 9296 48 --1 -1 9 64.49270 64.87450 9344 144 --1 -1 7 64.00000 64.09300 9488 112 --1 -1 13 64.87450 66.00000 9600 208 --1 -1 9 64.03320 64.49270 9808 144 --1 -1 14 65.51330 66.00000 9952 224 --1 -1 4 65.95690 66.00000 10176 64 --1 -1 41 64.79390 65.68610 10240 656 --1 -1 8 64.53680 64.59080 10896 128 --1 -1 3 64.52370 64.53530 11024 48 --1 -1 12 65.66500 65.95690 11072 192 --1 -1 17 64.59080 64.79550 11264 272 --1 -1 3 64.53530 64.53680 11536 48 --1 -1 26 64.00000 64.52370 11584 416 --1 -1 4 64.00000 66.00000 12000 64 --1 -1 3 63.21000 63.32460 12064 48 --1 -1 11 63.32460 64.00000 12112 176 --1 -1 13 62.00000 63.21000 12288 208 --1 -1 3 63.73420 63.74790 12496 48 --1 -1 10 63.74790 64.00000 12544 160 --1 -1 26 62.91440 63.73420 12704 416 --1 -1 23 62.00000 62.91250 13120 368 --1 -1 3 62.00000 64.00000 13488 48 --1 -1 45 60.00000 62.00000 13536 720 --1 -1 7 60.54750 60.65740 14256 112 --1 -1 11 60.25530 60.54560 14368 176 --1 -1 38 60.65740 61.73690 14544 608 --1 -1 7 61.73690 62.00000 15152 112 --1 -1 6 60.19310 62.00000 15264 96 --1 -1 7 60.00000 60.35220 15360 112 --1 -1 52 58.88390 59.89690 15472 832 --1 -1 9 59.88610 60.00000 16304 144 --1 -1 15 58.00000 58.08440 16448 240 --1 -1 13 58.00000 58.07610 16688 208 --1 -1 3 58.00000 58.00080 16896 48 --1 -1 33 58.00970 59.15970 16944 528 --1 -1 3 58.00000 58.00970 17472 48 --1 -1 12 59.15970 59.30330 17520 192 --1 -1 11 59.30280 59.35610 17712 176 --1 -1 8 59.35250 59.47860 17888 128 --1 -1 7 59.45230 60.00000 18016 112 --1 -1 28 58.90720 59.66430 18128 448 --1 -1 36 58.78010 59.80190 18576 576 --1 -1 12 58.00000 58.78010 19152 192 --1 -1 26 56.07810 56.39640 19344 416 --1 -1 26 56.07810 56.39640 19760 416 --1 -1 51 56.30580 56.42420 20176 816 --1 -1 51 56.30580 56.42420 20992 816 --1 -1 53 56.00000 56.45060 21808 848 --1 -1 53 56.00000 56.45060 22656 848 --1 -1 14 57.85500 58.00000 23504 224 --1 -1 4 57.99250 58.00000 23728 64 --1 -1 6 57.98000 58.00000 23792 96 --1 -1 15 57.86890 58.00000 23888 240 --1 -1 51 57.52220 57.85580 24128 816 --1 -1 47 56.69430 57.53640 24944 752 --1 -1 37 57.53580 58.00000 25696 592 --1 -1 7 56.00000 56.12460 26288 112 --1 -1 7 56.00000 56.12460 26400 112 --1 -1 7 56.00000 56.03280 26512 112 --1 -1 21 56.00000 56.14940 26624 336 --1 -1 7 56.00000 56.03280 26960 112 --1 -1 21 56.00000 56.14940 27072 336 --1 -1 23 56.15110 56.69430 27408 368 --1 -1 6 56.12460 56.16720 27776 96 --1 -1 6 56.12460 56.16720 27872 96 --1 -1 22 56.83810 58.00000 27968 352 --1 -1 30 56.00000 56.83810 28320 480 --1 -1 48 54.78290 55.08640 28800 768 --1 -1 2 54.76580 54.78290 29568 32 --1 -1 6 54.41950 54.47670 29600 96 --1 -1 16 54.32580 54.41950 29696 256 --1 -1 25 55.07780 55.28860 29952 400 --1 -1 46 54.00000 54.40860 30352 736 --1 -1 21 55.02750 55.08800 31088 336 --1 -1 36 54.36500 55.07190 31424 576 --1 -1 4 55.95880 56.00000 32000 64 --1 -1 4 55.95880 56.00000 32064 64 --1 -1 95 54.00000 54.95610 32128 1520 --1 -1 4 54.00000 54.00190 33648 64 --1 -1 95 54.00000 54.95610 33712 1520 --1 -1 4 54.00000 54.00190 35232 64 --1 -1 15 55.67530 55.95880 35296 240 --1 -1 15 55.67530 55.95880 35536 240 --1 -1 3 54.95120 54.97720 35776 48 --1 -1 3 54.95120 54.97720 35824 48 --1 -1 53 54.97720 55.67470 35872 848 --1 -1 53 54.97720 55.67470 36720 848 --1 -1 21 55.67500 55.84640 37568 336 --1 -1 21 55.67500 55.84640 37904 336 --1 -1 9 55.79190 56.00000 38240 144 --1 -1 9 55.79190 56.00000 38384 144 --1 -1 5 55.78890 55.82640 38528 80 --1 -1 5 55.78890 55.82640 38608 80 --1 -1 33 55.68890 56.00000 38688 528 --1 -1 10 55.94220 56.00000 39216 160 --1 -1 33 55.68890 56.00000 39376 528 --1 -1 10 55.94220 56.00000 39904 160 --1 -1 32 55.59360 55.86610 40064 512 --1 -1 32 55.59360 55.86610 40576 512 --1 -1 73 54.46080 55.60310 41088 1168 --1 -1 24 54.00220 54.46060 42256 384 --1 -1 2 54.00000 54.00220 42640 32 --1 -1 8 54.00000 54.06920 42672 128 --1 -1 4 54.00000 54.00190 42800 64 --1 -1 4 54.00000 54.00890 42864 64 --1 -1 10 54.00000 54.04000 42928 160 --1 -1 27 54.00000 54.18780 43088 432 --1 -1 4 54.19780 54.22470 43520 64 --1 -1 6 54.26490 54.31110 43584 96 --1 -1 13 54.16970 54.26000 43680 208 --1 -1 51 54.31250 54.71360 43888 816 --1 -1 51 54.31250 54.71360 44704 816 --1 -1 6 54.22470 54.26490 45520 96 --1 -1 21 54.29810 54.39250 45616 336 --1 -1 27 54.64500 54.98250 45952 432 --1 -1 2 54.61950 54.64310 46384 32 --1 -1 2 54.61950 54.64310 46416 32 --1 -1 44 54.95030 55.36720 46448 704 --1 -1 28 55.20420 55.44470 47152 448 --1 -1 16 54.10330 54.25810 47600 256 --1 -1 49 54.19310 55.31890 47856 784 --1 -1 10 55.13890 55.29720 48640 160 --1 -1 32 54.00000 54.38780 48800 512 --1 -1 18 54.00000 54.14530 49312 288 --1 -1 11 54.00000 54.08690 49600 176 --1 -1 3 54.11030 54.20470 49776 48 --1 -1 6 54.00000 54.11530 49824 96 --1 -1 47 54.00000 54.47830 49920 752 --1 -1 18 54.70780 55.26310 50672 288 --1 -1 23 55.31930 56.00000 50960 368 --1 -1 4 55.26310 55.31930 51328 64 --1 -1 18 54.35580 54.54610 51392 288 --1 -1 74 54.53080 55.07050 51680 1184 --1 -1 145 54.03700 54.41780 52864 2320 --1 -1 95 52.00000 53.60750 55184 1520 --1 -1 78 52.00000 53.27000 56704 1248 --1 -1 98 52.00000 54.00000 57952 1568 --1 -1 19 53.90470 53.95580 59520 304 --1 -1 19 53.90470 53.95580 59824 304 --1 -1 7 53.96860 54.00000 60128 112 --1 -1 21 53.88860 54.00000 60240 336 --1 -1 7 53.96860 54.00000 60576 112 --1 -1 21 53.88860 54.00000 60688 336 --1 -1 11 52.03670 52.11140 61024 176 --1 -1 63 52.10810 53.12110 61200 1008 --1 -1 23 53.09560 53.21830 62208 368 --1 -1 9 53.77750 53.80530 62576 144 --1 -1 29 52.00000 52.12000 62720 464 --1 -1 14 53.80330 54.00000 63184 224 --1 -1 76 52.04390 52.37970 63408 1216 --1 -1 43 53.08720 53.43890 64624 688 --1 -1 41 53.43860 53.82000 65312 656 --1 -1 14 52.00000 52.22160 65968 224 --1 -1 2 52.00000 52.00080 66192 32 --1 -1 60 52.00000 53.02970 66224 960 --1 -1 92 53.14090 54.00000 67184 1472 --1 -1 7 53.95530 54.00000 68656 112 --1 -1 5 53.98810 54.00000 68768 80 --1 -1 4 53.94150 54.00000 68848 64 --1 -1 2 52.00000 52.00080 68912 32 --1 -1 8 52.94740 53.14090 68944 128 --1 -1 3 53.93970 54.00000 69072 48 --1 -1 16 53.87940 54.00000 69120 256 --1 -1 15 53.90890 54.00000 69376 240 --1 -1 11 53.94860 54.00000 69616 176 --1 -1 17 53.43610 54.00000 69792 272 --1 -1 9 53.43610 53.65420 70064 144 --1 -1 24 53.47170 54.00000 70208 384 --1 -1 8 53.34580 54.00000 70592 128 --1 -1 4 53.17540 53.34530 70720 64 --1 -1 12 52.00000 53.17540 70784 192 --1 -1 18 52.00000 52.14360 70976 288 --1 -1 110 52.00000 53.42220 71264 1760 --1 -1 66 53.41220 53.55420 73024 1056 --1 -1 85 52.75970 53.41230 74080 1360 --1 -1 6 52.57080 52.66060 75440 96 --1 -1 16 52.66060 52.78560 75536 256 --1 -1 49 52.00000 52.58970 75792 784 --1 -1 104 50.30550 51.09110 76576 1664 --1 -1 35 51.20530 51.37250 78240 560 --1 -1 4 50.78230 50.80420 78800 64 --1 -1 20 50.97190 51.08200 78864 320 --1 -1 18 51.73440 51.83110 79184 288 --1 -1 29 50.00000 50.16690 79472 464 --1 -1 45 50.00000 50.35610 79936 720 --1 -1 165 50.75390 51.50330 80656 2640 --1 -1 13 50.00000 50.17450 83296 208 --1 -1 103 50.00000 50.78230 83504 1648 --1 -1 23 50.80110 50.97940 85152 368 --1 -1 53 51.08200 51.73440 85520 848 --1 -1 53 51.82810 52.00000 86368 848 --1 -1 2 50.75620 50.75670 87216 32 --1 -1 12 50.12670 50.18220 87248 192 --1 -1 112 50.16810 50.81530 87440 1792 --1 -1 30 50.00000 50.32310 89232 480 --1 -1 180 50.66970 51.05280 89712 2880 --1 -1 4 50.60510 50.61490 92592 64 --1 -1 79 50.86580 52.00000 92656 1264 --1 -1 6 50.61490 50.67420 93920 96 --1 -1 202 50.00000 50.67050 94016 3232 --1 -1 5 50.00000 50.00680 97248 80 --1 -1 16 50.00000 50.05920 97328 256 --1 -1 20 50.00000 50.41350 97584 320 --1 -1 8 50.76550 50.83130 97904 128 --1 -1 88 50.92380 52.00000 98032 1408 --1 -1 22 51.51890 51.65250 99440 352 --1 -1 30 50.41350 50.76690 99792 480 --1 -1 16 50.82780 50.92380 100272 256 --1 -1 31 51.59390 51.95970 100528 496 --1 -1 10 51.91130 51.93920 101024 160 --1 -1 25 51.46560 51.63030 101184 400 --1 -1 45 51.59690 51.91750 101584 720 --1 -1 66 51.37440 51.66110 102304 1056 --1 -1 33 51.37500 51.49890 103360 528 --1 -1 21 51.25280 51.49330 103888 336 --1 -1 66 51.25310 51.94440 104224 1056 --1 -1 10 51.94440 52.00000 105280 160 --1 -1 39 50.34670 50.95940 105440 624 --1 -1 18 51.84390 52.00000 106064 288 --1 -1 51 50.95940 51.26360 106352 816 --1 -1 35 51.36890 51.84330 107168 560 --1 -1 7 51.25940 51.36890 107728 112 --1 -1 65 50.00000 50.43970 107840 1040 --1 -1 11 50.00000 50.07390 108880 176 --1 -1 26 50.19730 50.46080 109056 416 --1 -1 17 50.00000 50.37690 109472 272 --1 -1 61 50.00000 51.23540 109744 976 --1 -1 9 50.00000 50.19730 110720 144 --1 -1 51 51.23540 51.76920 110864 816 --1 -1 57 51.45470 51.76940 111680 912 --1 -1 23 51.46440 51.78190 112592 368 --1 -1 31 51.16780 51.50670 112960 496 --1 -1 47 51.44860 51.51470 113456 752 --1 -1 70 50.52830 51.03720 114208 1120 --1 -1 35 50.52860 51.16780 115328 560 --1 -1 75 50.67210 51.12000 115888 1200 --1 -1 9 51.07440 51.12000 117088 144 --1 -1 80 50.47830 51.15610 117232 1280 --1 -1 15 51.05390 51.15610 118512 240 --1 -1 2 51.08460 51.08470 118752 32 --1 -1 3 51.99920 52.00000 118784 48 --1 -1 35 50.65970 51.26470 118832 560 --1 -1 32 51.62000 52.00000 119392 512 --1 -1 23 51.42330 51.62000 119904 368 --1 -1 7 51.26670 51.43000 120272 112 --1 -1 7 50.80980 51.66920 120384 112 --1 -1 3 51.66920 52.00000 120496 48 --1 -1 11 50.73610 50.79330 120544 176 --1 -1 71 50.73610 51.31440 120720 1136 --1 -1 59 50.69350 51.00280 121856 944 --1 -1 47 50.00000 50.69350 122800 752 --1 -1 52 50.00000 50.71470 123552 832 --1 -1 59 50.57890 50.87470 124384 944 --1 -1 31 50.00000 50.58370 125328 496 --1 -1 8 50.00000 50.02610 125824 128 --1 -1 5 50.00000 50.00700 125952 80 --1 -1 2 50.00000 50.00790 126032 32 --1 -1 5 50.73070 50.82870 126064 80 --1 -1 22 50.86500 51.37490 126144 352 --1 -1 31 50.00790 50.73070 126496 496 --1 -1 6 50.82870 50.86500 126992 96 --1 -1 29 51.37490 52.00000 127088 464 --1 -1 16 51.74210 52.00000 127552 256 --1 -1 48 51.39470 51.74670 127808 768 --1 -1 79 50.13560 51.39470 128576 1264 --1 -1 48 50.14170 50.48330 129840 768 --1 -1 37 50.00000 50.40740 130608 592 --1 -1 9 50.00000 50.16800 131200 144 --1 -1 25 50.00000 50.28420 131344 400 --1 -1 6 50.00000 50.02830 131744 96 --1 -1 117 50.00000 51.50170 131840 1872 --1 -1 34 51.50170 52.00000 13... [truncated message content] |
From: <js...@us...> - 2007-11-08 22:12:02
|
Revision: 4165 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4165&view=rev Author: jswhit Date: 2007-11-08 14:11:50 -0800 (Thu, 08 Nov 2007) Log Message: ----------- specify endian-ness in dtype, instead of using byteswap() Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-08 22:06:40 UTC (rev 4164) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-08 22:11:50 UTC (rev 4165) @@ -791,10 +791,8 @@ # read in binary string convert into an npts by 2 # numpy array (first column is lons, second is lats). polystring = bdatfile.read(bytecount) - if not npy.little_endian: - b = npy.reshape(npy.fromstring(polystring,dtype=npy.float64).byteswap(),(npts,2)) - else: - b = npy.reshape(npy.fromstring(polystring,dtype=npy.float64),(npts,2)) + # binary data is little endian. + b = npy.reshape(npy.fromstring(polystring,dtype='<f8'),(npts,2)) # if map boundary polygon is a valid one in lat/lon # coordinates (i.e. it does not contain either pole), # the intersections of the boundary geometries This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-08 22:06:41
|
Revision: 4164 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4164&view=rev Author: jswhit Date: 2007-11-08 14:06:40 -0800 (Thu, 08 Nov 2007) Log Message: ----------- fix typo (byteswapped() --> byteswap()) Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-08 21:53:39 UTC (rev 4163) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-08 22:06:40 UTC (rev 4164) @@ -792,7 +792,7 @@ # numpy array (first column is lons, second is lats). polystring = bdatfile.read(bytecount) if not npy.little_endian: - b = npy.reshape(npy.fromstring(polystring,dtype=npy.float64).byteswapped(),(npts,2)) + b = npy.reshape(npy.fromstring(polystring,dtype=npy.float64).byteswap(),(npts,2)) else: b = npy.reshape(npy.fromstring(polystring,dtype=npy.float64),(npts,2)) # if map boundary polygon is a valid one in lat/lon @@ -853,8 +853,8 @@ # pylab.show() if poly.is_valid: poly = poly.intersection(boundarypolyll) - else: - print 'warning, invalid ',name,' geometry',poly.area + #else: + # print 'warning, invalid ',name,' geometry',poly.area # create iterable object with geometries # that intersect map region. if hasattr(poly,'geoms'): @@ -919,8 +919,8 @@ #try: if poly.is_valid: poly = boundarypolyxy.intersection(poly) - else: - print 'warning, invalid ',name,' geometry',poly.area + #else: + # print 'warning, invalid ',name,' geometry',poly.area #except: # continue # create iterable object with geometries This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-08 21:53:50
|
Revision: 4163 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4163&view=rev Author: jswhit Date: 2007-11-08 13:53:39 -0800 (Thu, 08 Nov 2007) Log Message: ----------- new data format (much smaller files) Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhs_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhs_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhs_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhs_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhsmeta_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhsmeta_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhsmeta_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/gshhsmeta_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/rivers_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/rivers_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/rivers_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/rivers_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/riversmeta_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/riversmeta_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/riversmeta_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/riversmeta_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/states_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/states_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/states_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/states_l.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/statesmeta_c.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/statesmeta_h.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/statesmeta_i.dat trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/statesmeta_l.dat Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-08 16:27:18 UTC (rev 4162) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-08 21:53:39 UTC (rev 4163) @@ -17,7 +17,6 @@ from shapely.geometry import Polygon as PolygonShape from shapely.geometry import LineString as LineShape from shapely.geometry import Point as PointShape -from shapely import wkb # basemap data files now installed in lib/matplotlib/toolkits/basemap/data basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data']) @@ -745,18 +744,24 @@ raise IOError, msg polygons = [] polygon_types = [] + # coastlines are polygons, other boundaries are line segments. + if name == 'gshhs': + Shape = PolygonShape + else: + Shape = LineShape # see if map projection region polygon contains a pole. NPole = PointShape(self(0.,90.)) SPole = PointShape(self(0.,-90.)) boundarypolyxy = self._boundarypolyxy boundarypolyll = self._boundarypolyll - hasNP = boundarypolyxy.contains(NPole) - hasSP = boundarypolyxy.contains(SPole) + hasNP = NPole.within(boundarypolyxy) + hasSP = SPole.within(boundarypolyxy) containsPole = hasNP or hasSP # these projections cannot cross pole. if containsPole and\ self.projection in ['tmerc','cass','omerc','merc','mill','cyl','robin','moll','sinu','geos']: raise ValueError('%s projection cannot cross pole'%(self.projection)) + # make sure orthographic projection has containsPole=True # we will compute the intersections in stereographic # coordinates, then transform to orthographic. @@ -773,17 +778,23 @@ for line in bdatmetafile: linesplit = line.split() area = float(linesplit[1]) - type = int(linesplit[0]) - south = float(linesplit[2]) - north = float(linesplit[3]) + south = float(linesplit[3]) + north = float(linesplit[4]) if area < 0.: area = 1.e30 useit = self.latmax>=south and self.latmin<=north and area>self.area_thresh if useit: - offsetbytes = int(linesplit[4]) - bytecount = int(linesplit[5]) + type = int(linesplit[0]) + npts = int(linesplit[2]) + offsetbytes = int(linesplit[5]) + bytecount = int(linesplit[6]) bdatfile.seek(offsetbytes,0) + # read in binary string convert into an npts by 2 + # numpy array (first column is lons, second is lats). polystring = bdatfile.read(bytecount) - poly = wkb.loads(polystring) + if not npy.little_endian: + b = npy.reshape(npy.fromstring(polystring,dtype=npy.float64).byteswapped(),(npts,2)) + else: + b = npy.reshape(npy.fromstring(polystring,dtype=npy.float64),(npts,2)) # if map boundary polygon is a valid one in lat/lon # coordinates (i.e. it does not contain either pole), # the intersections of the boundary geometries @@ -794,64 +805,83 @@ if not containsPole: # close Antarctica. if name == 'gshhs' and south < -68: - b = npy.asarray(poly.boundary) lons = b[:,0] lats = b[:,1] - if math.fabs(lons[0]+0.) < 1.e-5: - lons1 = lons[:-2][::-1] - lats1 = lats[:-2][::-1] - lons2 = lons1 + 360. - lons3 = lons2 + 360. - lons = lons1.tolist()+lons2.tolist()+lons3.tolist() - lats = lats1.tolist()+lats1.tolist()+lats1.tolist() - lonstart,latstart = lons[0], lats[0] - lonend,latend = lons[-1], lats[-1] - lons.insert(0,lonstart) - lats.insert(0,-90.) - lons.append(lonend) - lats.append(-90.) - poly = PolygonShape(zip(lons,lats)) - else: - continue - # if polygon instersects map projection - # region, process it. - if poly.intersects(boundarypolyll): - poly = poly.intersection(boundarypolyll) - # create iterable object with geometries - # that intersect map region. - if hasattr(poly,'geoms'): - geoms = poly.geoms - else: - geoms = [poly] - # iterate over geometries in intersection. - for psub in geoms: - # only coastlines are polygons, - # which have a 'boundary' attribute. - # otherwise, use 'coords' attribute - # to extract coordinates. - if name == 'gshhs': - b = npy.asarray(psub.boundary) + lons2 = lons[:-2][::-1] + lats2 = lats[:-2][::-1] + lons1 = lons2 - 360. + lons3 = lons2 + 360. + lons = lons1.tolist()+lons2.tolist()+lons3.tolist() + lats = lats2.tolist()+lats2.tolist()+lats2.tolist() + lonstart,latstart = lons[0], lats[0] + lonend,latend = lons[-1], lats[-1] + lons.insert(0,lonstart) + lats.insert(0,-90.) + lons.append(lonend) + lats.append(-90.) + poly = PolygonShape(zip(lons,lats)) + antart = True + b = npy.empty((len(lons),2),npy.float64) + b[:,0] = lons; b[:,1] = lats + else: + antart = False + # create Shapely geometry from lons/lons array. + blons = b[:,0]; blats = b[:,1] + poly = Shape(zip(blons,blats)) + # create duplicate polygons shifted by -360 and +360 + # (so as to properly treat polygons that cross + # Greenwich meridian). + if not antart: + blons = b[:,0]-360 + poly1 = Shape(zip(blons,blats)) + blons = b[:,0]+360 + poly2 = Shape(zip(blons,blats)) + polys = [poly1,poly,poly2] + else: # Antartica already extends from -360 to +720. + polys = [poly] + for poly in polys: + # if polygon instersects map projection + # region, process it. + if poly.intersects(boundarypolyll): + #if not poly.is_valid: + # print poly.geom_type, poly.is_ring, boundarypolyll.is_valid + # import pylab + # a = npy.asarray(boundarypolyll.boundary) + # b = npy.asarray(poly.boundary) + # pylab.plot(a[:,0],a[:,1],'b') + # pylab.plot(b[:,0],b[:,1],'b') + # pylab.show() + if poly.is_valid: + poly = poly.intersection(boundarypolyll) else: - b = npy.asarray(psub.coords) - blons = b[:,0]; blats = b[:,1] - # transformation from lat/lon to - # map projection coordinates. - bx, by = self(blons, blats) - polygons.append(zip(bx,by)) - polygon_types.append(type) + print 'warning, invalid ',name,' geometry',poly.area + # create iterable object with geometries + # that intersect map region. + if hasattr(poly,'geoms'): + geoms = poly.geoms + else: + geoms = [poly] + # iterate over geometries in intersection. + for psub in geoms: + # only coastlines are polygons, + # which have a 'boundary' attribute. + # otherwise, use 'coords' attribute + # to extract coordinates. + if name == 'gshhs': + b = npy.asarray(psub.boundary) + else: + b = npy.asarray(psub.coords) + blons = b[:,0]; blats = b[:,1] + # transformation from lat/lon to + # map projection coordinates. + bx, by = self(blons, blats) + polygons.append(zip(bx,by)) + polygon_types.append(type) # if map boundary polygon is not valid in lat/lon # coordinates, compute intersection between map # projection region and boundary geometries in map # projection coordinates. else: - # only coastlines are polygons, - # which have a 'boundary' attribute. - # otherwise, use 'coords' attribute - # to extract coordinates. - if name == 'gshhs': - b = npy.asarray(poly.boundary) - else: - b = npy.asarray(poly.coords) blons = b[:,0]; blats = b[:,1] # transform coordinates from lat/lon # to map projection coordinates. @@ -866,11 +896,7 @@ # if less than two points are valid in # map proj coords, skip this geometry. if npy.sum(goodmask) <= 1: continue - if name == 'gshhs': - # create a polygon object for coastline - # geometry. - poly = PolygonShape(zip(bx,by)) - else: + if name != 'gshhs': # if not a polygon, # just remove parts of geometry that are undefined # in this map projection. @@ -883,17 +909,20 @@ polygons.append(zip(bx,by)) polygon_types.append(type) continue - # create a Line object for other geometries. - poly = LineShape(zip(bx,by)) + # create a Shapely geometry object. + poly = Shape(zip(bx,by)) # if geometry instersects map projection # region, and doesn't have any invalid points, process it. if not badmask.any() and boundarypolyxy.intersects(poly): # if geometry intersection calculation fails, # just skip this polygon. - try: + #try: + if poly.is_valid: poly = boundarypolyxy.intersection(poly) - except: - continue + else: + print 'warning, invalid ',name,' geometry',poly.area + #except: + # continue # create iterable object with geometries # that intersect map region. if hasattr(poly,'geoms'): @@ -1007,8 +1036,19 @@ (self.xmax,self.ymax),\ (self.xmax,self.ymin)]) if self.projection in ['mill','merc','cyl']: + # make sure map boundary doesn't quite include pole. + if self.urcrnrlat > 89.9999: + urcrnrlat = 89.9999 + else: + urcrnrlat = self.urcrnrlat + if self.llcrnrlat < -89.9999: + llcrnrlat = -89.9999 + else: + llcrnrlat = self.llcrnrlat lons = [self.llcrnrlon, self.llcrnrlon, self.urcrnrlon, self.urcrnrlon] - lats = [self.llcrnrlat, self.urcrnrlat, self.urcrnrlat, self.llcrnrlat] + lats = [llcrnrlat, urcrnrlat, urcrnrlat, llcrnrlat] + x, y = self(lons, lats) + boundaryxy = PolygonShape(zip(x,y)) else: if self.projection not in ['moll','robin','sinu']: lons, lats = maptran(x,y,inverse=True) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_c.dat =================================================================== (Binary files differ) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_h.dat =================================================================== (Binary files differ) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_i.dat =================================================================== (Binary files differ) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countries_l.dat =================================================================== (Binary files differ) Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_c.dat =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_c.dat 2007-11-08 16:27:18 UTC (rev 4162) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/countriesmeta_c.dat 2007-11-08 21:53:39 UTC (rev 4163) @@ -1,1710 +1,565 @@ --1 -1 70.00000 70.06710 0 41 --1 -1 70.00000 70.08820 41 41 --1 -1 50.00000 51.01900 82 121 --1 -1 50.00000 53.60750 203 121 --1 -1 54.46630 54.47670 324 41 --1 -1 50.00000 50.32320 365 41 --1 -1 58.90490 68.50860 406 297 --1 -1 50.00000 50.16690 703 57 --1 -1 50.00000 51.09100 760 41 --1 -1 50.86580 53.27000 801 73 --1 -1 50.75650 51.48650 874 57 --1 -1 50.00000 50.12660 931 41 --1 -1 54.76570 55.08640 972 41 --1 -1 50.00000 54.46630 1013 105 --1 -1 68.40670 69.05760 1118 41 --1 -1 65.51320 70.00000 1159 137 --1 -1 62.91430 69.05060 1296 121 --1 -1 55.67540 56.45060 1417 73 --1 -1 55.67540 56.45060 1490 73 --1 -1 53.94780 54.97720 1563 57 --1 -1 53.94780 54.97720 1620 57 --1 -1 50.00000 50.95950 1677 73 --1 -1 51.84390 52.36700 1750 57 --1 -1 57.53580 58.08450 1807 57 --1 -1 55.60310 56.14940 1864 41 --1 -1 55.60310 56.14940 1905 41 --1 -1 51.37510 51.63030 1946 41 --1 -1 60.54760 62.91250 1987 41 --1 -1 56.15120 57.53640 2028 41 --1 -1 69.02950 70.00000 2069 73 --1 -1 54.46080 55.60310 2142 41 --1 -1 51.53110 51.92260 2183 41 --1 -1 51.63030 51.92080 2224 41 --1 -1 52.10820 53.12110 2265 41 --1 -1 53.12110 53.43880 2306 41 --1 -1 54.97720 55.67480 2347 57 --1 -1 54.97720 55.67480 2404 57 --1 -1 50.95950 51.25950 2461 41 --1 -1 51.25280 51.37510 2502 41 --1 -1 53.43850 53.80440 2543 41 --1 -1 51.25310 51.94430 2584 41 --1 -1 55.07210 55.24880 2625 41 --1 -1 54.36500 55.07180 2666 41 --1 -1 58.00980 59.15970 2707 41 --1 -1 51.94430 52.10820 2748 41 --1 -1 51.36900 51.84330 2789 41 --1 -1 57.53580 58.00980 2830 41 --1 -1 54.00210 54.46020 2871 41 --1 -1 55.67510 55.82650 2912 41 --1 -1 55.67510 55.82650 2953 41 --1 -1 55.79200 56.14940 2994 41 --1 -1 55.79200 56.14940 3035 41 --1 -1 53.80320 54.00210 3076 41 --1 -1 59.15970 59.35260 3117 41 --1 -1 55.79200 55.82650 3158 41 --1 -1 55.79200 55.82650 3199 41 --1 -1 51.25950 51.36900 3240 41 --1 -1 59.35260 59.47860 3281 41 --1 -1 60.25530 60.54550 3322 41 --1 -1 50.00000 51.76910 3363 57 --1 -1 50.00000 50.37510 3420 41 --1 -1 50.52830 51.12000 3461 105 --1 -1 50.47820 51.15600 3566 57 --1 -1 51.45480 51.78100 3623 73 --1 -1 50.00000 50.37690 3696 41 --1 -1 50.52860 51.50670 3737 41 --1 -1 51.46430 51.50670 3778 41 --1 -1 51.08490 51.15600 3819 41 --1 -1 51.08460 51.12000 3860 41 --1 -1 52.00080 54.18250 3901 153 --1 -1 50.79260 51.26470 4054 73 --1 -1 50.85330 51.66930 4127 41 --1 -1 53.43600 54.38790 4168 105 --1 -1 54.64520 55.36720 4273 57 --1 -1 53.34570 54.47550 4330 73 --1 -1 54.39090 54.64300 4403 41 --1 -1 54.39090 54.64300 4444 41 --1 -1 54.19320 55.29670 4485 57 --1 -1 55.29730 55.36840 4542 41 --1 -1 51.61990 52.00080 4583 41 --1 -1 53.43600 54.11110 4624 57 --1 -1 51.66930 53.34540 4681 41 --1 -1 54.19780 54.39250 4722 41 --1 -1 51.42820 51.61990 4763 41 --1 -1 54.18250 54.19680 4804 41 --1 -1 51.26680 51.43010 4845 41 --1 -1 50.00000 50.87460 4886 89 --1 -1 50.00000 52.14360 4975 89 --1 -1 50.00000 51.00250 5064 57 --1 -1 50.73610 51.31440 5121 73 --1 -1 50.00000 50.28410 5194 57 --1 -1 50.00000 51.88020 5251 105 --1 -1 50.00000 51.12950 5356 41 --1 -1 50.20840 53.55410 5397 121 --1 -1 50.00000 50.20290 5518 41 --1 -1 60.30750 69.64570 5559 57 --1 -1 54.70770 60.35230 5616 153 --1 -1 54.09950 55.07060 5769 57 --1 -1 49.23280 50.00000 5826 73 --1 -1 45.76780 46.87100 5899 89 --1 -1 47.58510 50.00000 5988 73 --1 -1 30.00000 33.17240 6061 105 --1 -1 43.78870 47.54060 6166 233 --1 -1 47.27470 50.00000 6399 169 --1 -1 46.86920 48.15460 6568 105 --1 -1 45.93220 47.80700 6673 105 --1 -1 39.80700 39.84480 6778 41 --1 -1 41.85050 42.62590 6819 57 --1 -1 48.61690 49.51810 6876 41 --1 -1 49.46010 50.00000 6917 57 --1 -1 49.98020 50.00000 6974 57 --1 -1 45.59810 47.09470 7031 105 --1 -1 30.23380 36.94350 7136 121 --1 -1 48.14420 49.01880 7257 89 --1 -1 42.60210 42.70920 7346 41 --1 -1 49.54500 50.00000 7387 41 --1 -1 42.43460 42.50690 7428 41 --1 -1 42.50690 42.56550 7469 57 --1 -1 42.95280 43.18230 7526 41 --1 -1 39.87010 39.93060 7567 41 --1 -1 43.91350 43.91620 7608 41 --1 -1 47.06420 47.27410 7649 41 --1 -1 48.01240 48.14360 7690 41 --1 -1 42.46110 42.46230 7731 41 --1 -1 42.48650 42.66290 7772 41 --1 -1 41.34140 41.41070 7813 41 --1 -1 43.72950 43.75750 7854 41 --1 -1 47.69310 47.69310 7895 41 --1 -1 42.54600 45.18640 7936 169 --1 -1 43.12340 43.53440 8105 41 --1 -1 44.85310 45.90750 8146 57 --1 -1 45.45860 46.48370 8203 73 --1 -1 49.07840 49.43690 8276 73 --1 -1 43.62480 46.15140 8349 153 --1 -1 30.00000 33.37800 8502 137 --1 -1 30.00000 31.64710 8639 57 --1 -1 45.21200 48.26380 8696 153 --1 -1 48.41180 50.00000 8849 73 --1 -1 47.95350 48.57600 8922 57 --1 -1 40.73530 41.75010 8979 105 --1 -1 35.92660 36.83360 9084 89 --1 -1 39.66900 42.53990 9173 89 --1 -1 30.00000 31.32270 9262 41 --1 -1 41.34140 44.22630 9303 105 --1 -1 30.00000 31.83290 9408 89 --1 -1 49.90330 50.00000 9497 41 --1 -1 31.98670 32.75000 9538 41 --1 -1 46.55120 48.00990 9579 41 --1 -1 49.62310 49.90420 9620 41 --1 -1 41.71250 42.08820 9661 57 --1 -1 33.37530 33.94480 9718 41 --1 -1 31.93850 32.23610 9759 41 --1 -1 47.83140 48.36760 9800 57 --1 -1 47.10930 47.86830 9857 57 --1 -1 48.58820 49.06550 9914 41 --1 -1 48.07130 48.46490 9955 41 --1 -1 48.25860 48.46490 9996 41 --1 -1 33.09390 33.24900 10037 41 --1 -1 36.02980 36.20490 10078 41 --1 -1 31.21740 31.59670 10119 41 --1 -1 48.00960 48.07130 10160 41 --1 -1 48.36760 48.58820 10201 41 --1 -1 37.64870 37.83950 10242 41 --1 -1 36.46920 36.49150 10283 41 --1 -1 45.13730 45.43180 10324 41 --1 -1 46.41570 46.55120 10365 41 --1 -1 36.56290 36.76650 10406 41 --1 -1 37.25170 37.50470 10447 41 --1 -1 38.11230 38.32440 10488 41 --1 -1 39.38740 39.39860 10529 41 --1 -1 36.93000 37.06400 10570 41 --1 -1 39.81400 40.03620 10611 41 --1 -1 36.62970 36.64130 10652 41 --1 -1 38.48400 38.70130 10693 41 --1 -1 40.25440 40.40360 10734 41 --1 -1 38.88040 39.07550 10775 41 --1 -1 31.80760 31.80820 10816 41 --1 -1 33.20710 33.25170 10857 41 --1 -1 43.90430 43.92900 10898 41 --1 -1 41.94230 42.32650 10939 41 --1 -1 42.56340 43.12340 10980 57 --1 -1 30.00000 39.64860 11037 233 --1 -1 36.83360 37.32160 11270 41 --1 -1 36.95200 38.28200 11311 121 --1 -1 41.26270 42.79770 11432 137 --1 -1 39.63270 41.58310 11569 89 --1 -1 38.44530 39.71970 11658 105 --1 -1 49.94200 50.00000 11763 57 --1 -1 38.87800 41.29870 11820 89 --1 -1 36.97060 37.38480 11909 89 --1 -1 41.89680 42.89910 11998 73 --1 -1 41.89680 42.89910 12071 73 --1 -1 41.89680 42.89910 12144 73 --1 -1 46.34550 48.24860 12217 105 --1 -1 41.28680 42.33720 12322 73 --1 -1 49.60510 49.62310 12395 41 --1 -1 42.89910 43.54570 12436 57 --1 -1 42.89910 43.54570 12493 57 --1 -1 41.05000 41.89590 12550 57 --1 -1 41.19620 41.89720 12607 57 --1 -1 33.94480 37.06190 12664 73 --1 -1 30.00000 31.93850 12737 57 --1 -1 38.84200 39.70570 12794 57 --1 -1 48.24860 50.00000 12851 57 --1 -1 49.06550 49.18390 12908 41 --1 -1 30.00000 30.01530 12949 57 --1 -1 41.11070 41.29780 13006 41 --1 -1 41.11070 41.29780 13047 41 --1 -1 41.32620 45.00300 13088 41 --1 -1 45.00240 45.57120 13129 57 --1 -1 37.05970 37.31980 13186 41 --1 -1 49.18390 49.60050 13227 41 --1 -1 40.66480 40.66510 13268 41 --1 -1 41.08450 41.08450 13309 41 --1 -1 41.08450 41.08450 13350 41 --1 -1 30.00000 30.00790 13391 41 --1 -1 41.00420 41.00570 13432 41 --1 -1 33.40760 41.93130 13473 281 --1 -1 44.86230 44.92970 13754 57 --1 -1 30.00000 38.47210 13811 377 --1 -1 30.00000 37.02560 14188 201 --1 -1 30.86490 33.40520 14389 121 --1 -1 30.00000 31.59640 14510 57 --1 -1 35.60520 36.95200 14567 73 --1 -1 41.23430 42.22400 14640 73 --1 -1 32.30320 35.50030 14713 121 --1 -1 37.36550 40.03100 14834 57 --1 -1 37.36550 40.03100 14891 57 --1 -1 41.00420 42.25270 14948 105 --1 -1 40.14570 41.00600 15053 73 --1 -1 42.25330 43.26860 15126 105 --1 -1 42.33050 42.80630 15231 57 --1 -1 39.50760 40.24490 15288 73 --1 -1 40.60750 42.25270 15361 89 --1 -1 39.19200 39.62020 15450 73 --1 -1 37.18580 39.29430 15523 73 --1 -1 40.22450 41.05030 15596 89 --1 -1 39.29370 40.14910 15685 73 --1 -1 40.03070 41.23550 15758 57 --1 -1 42.42420 43.73770 15815 89 --1 -1 42.42420 43.73770 15904 89 --1 -1 31.59910 32.30410 15993 41 --1 -1 42.80630 43.26860 16034 41 --1 -1 39.89330 40.16310 16075 57 --1 -1 43.48620 44.60530 16132 41 --1 -1 41.14370 42.42390 16173 73 --1 -1 41.14340 41.19430 16246 41 --1 -1 39.88750 39.88820 16287 41 --1 -1 40.42980 40.72470 16328 41 --1 -1 40.18480 40.22450 16369 41 --1 -1 39.98860 39.98860 16410 41 --1 -1 41.05150 41.19430 16451 41 --1 -1 40.99930 41.00110 16492 41 --1 -1 40.14180 40.14910 16533 41 --1 -1 41.93130 44.86230 16574 105 --1 -1 42.68790 49.17300 16679 313 --1 -1 49.17050 50.00000 16992 41 --1 -1 49.73450 50.00000 17033 57 --1 -1 30.00000 30.86490 17090 57 --1 -1 49.09210 50.00000 17147 89 --1 -1 42.19650 42.33050 17236 41 --1 -1 30.00000 30.34210 17277 57 --1 -1 41.58130 50.00000 17334 313 --1 -1 49.14210 50.00000 17647 89 --1 -1 49.94350 50.00000 17736 41 --1 -1 49.99050 50.00000 17777 41 --1 -1 49.50770 49.98930 17818 57 --1 -1 40.09290 43.00560 17875 137 --1 -1 42.29540 48.26750 18012 137 --1 -1 47.68550 50.00000 18149 105 --1 -1 38.22490 38.30640 18254 41 --1 -1 38.30640 38.62100 18295 41 --1 -1 39.82930 40.09600 18336 41 --1 -1 38.00060 38.22490 18377 41 --1 -1 37.69540 37.83280 18418 41 --1 -1 37.83220 38.00060 18459 41 --1 -1 37.75860 38.02500 18500 41 --1 -1 37.75860 37.99660 18541 41 --1 -1 37.65700 37.66430 18582 41 --1 -1 37.99660 38.02500 18623 41 --1 -1 48.27820 48.99960 18664 73 --1 -1 30.00000 32.71820 18737 153 --1 -1 48.99960 48.99960 18890 57 --1 -1 48.09600 49.37650 18947 89 --1 -1 41.67560 42.54990 19036 73 --1 -1 43.01630 48.31240 19109 137 --1 -1 42.55420 43.01320 19246 41 --1 -1 42.48280 46.12240 19287 137 --1 -1 45.59320 47.36450 19424 89 --1 -1 46.11960 47.47130 19513 57 --1 -1 45.18390 45.59470 19570 41 --1 -1 30.00000 35.08580 19611 121 --1 -1 37.18820 41.99850 19732 137 --1 -1 42.70980 43.39710 19869 41 --1 -1 35.27350 35.32910 19910 41 --1 -1 35.84180 35.91590 19951 41 --1 -1 36.15150 36.15150 19992 41 --1 -1 10.00000 13.89040 20033 217 --1 -1 21.49830 30.00000 20250 185 --1 -1 15.35710 21.81540 20435 121 --1 -1 10.00000 10.27340 20556 41 --1 -1 10.00000 12.39350 20597 73 --1 -1 13.71710 23.00100 20670 105 --1 -1 10.00000 12.82960 20775 73 --1 -1 10.00000 10.99580 20848 57 --1 -1 11.89520 15.00190 20905 121 --1 -1 11.02480 11.67850 21026 73 --1 -1 20.84640 23.52160 21099 41 --1 -1 11.67910 12.39600 21140 57 --1 -1 14.99180 15.35930 21197 41 --1 -1 11.69380 13.89200 21238 57 --1 -1 19.14660 20.85220 21295 57 --1 -1 10.27340 10.60490 21352 41 --1 -1 12.82780 13.08170 21393 41 --1 -1 10.96410 11.09680 21434 41 --1 -1 10.00000 10.92160 21475 41 --1 -1 10.00000 17.99270 21516 169 --1 -1 29.18880 30.00000 21685 73 --1 -1 19.50030 30.00000 21758 105 --1 -1 10.00000 19.49970 21863 137 --1 -1 29.48550 30.00000 22000 41 --1 -1 21.99850 22.23220 22041 89 --1 -1 29.55110 30.00000 22130 41 --1 -1 21.76810 23.12610 22171 57 --1 -1 29.54620 29.57610 22228 41 --1 -1 10.00000 11.47710 22269 57 --1 -1 29.85320 30.00000 22326 41 --1 -1 12.69110 15.10570 22367 137 --1 -1 22.69980 24.97950 22504 89 --1 -1 28.54520 29.47450 22593 73 --1 -1 16.37740 17.45710 22666 73 --1 -1 29.45950 30.00000 22739 57 --1 -1 10.98210 12.70880 22796 89 --1 -1 25.77510 26.72600 22885 57 --1 -1 29.10430 30.00000 22942 41 --1 -1 27.17740 28.69840 22983 41 --1 -1 27.17740 28.69840 23024 41 --1 -1 28.77470 29.20530 23065 57 --1 -1 16.63100 18.99890 23122 57 --1 -1 15.61680 25.47910 23179 153 --1 -1 15.61680 25.47910 23332 153 --1 -1 25.63620 26.06560 23485 41 --1 -1 25.63620 26.06560 23526 41 --1 -1 25.63780 25.79000 23567 41 --1 -1 29.90110 30.00000 23608 41 --1 -1 24.55590 24.62030 23649 41 --1 -1 25.19310 30.00000 23690 153 --1 -1 29.38840 30.00000 23843 73 --1 -1 24.26900 30.00000 23916 185 --1 -1 23.64830 24.32120 24101 57 --1 -1 21.14090 26.63200 24158 313 --1 -1 10.34490 20.38830 24471 201 --1 -1 26.53280 30.00000 24672 121 --1 -1 21.98230 29.46750 24793 281 --1 -1 22.04850 28.54920 25074 233 --1 -1 26.37260 28.32490 25307 153 --1 -1 27.76490 29.32710 25460 73 --1 -1 27.86430 30.00000 25533 73 --1 -1 21.96980 22.05040 25606 41 --1 -1 10.00000 10.35190 25647 41 --1 -1 21.14270 23.37790 25688 233 --1 -1 20.34620 20.35230 25921 41 --1 -1 13.92070 18.42110 25962 169 --1 -1 19.61200 22.39770 26131 201 --1 -1 11.63550 14.35070 26332 73 --1 -1 16.62730 19.69250 26405 73 --1 -1 17.52760 20.15520 26478 89 --1 -1 10.42240 11.66990 26567 89 --1 -1 14.70530 16.62850 26656 89 --1 -1 20.15760 21.68290 26745 73 --1 -1 11.86950 13.79610 26818 57 --1 -1 17.53030 18.21420 26875 73 --1 -1 14.32410 14.70680 26948 57 --1 -1 10.03200 10.42390 27005 73 --1 -1 22.14370 22.60940 27078 89 --1 -1 13.92980 14.70800 27167 41 --1 -1 21.43270 21.96980 27208 41 --1 -1 21.43480 21.68540 27249 41 --1 -1 22.20330 22.20390 27290 41 --1 -1 21.44910 21.66740 27331 41 --1 -1 11.66480 11.87080 27372 41 --1 -1 13.79580 13.93350 27413 41 --1 -1 28.14420 30.00000 27454 105 --1 -1 14.54840 17.81990 27559 169 --1 -1 25.96640 28.14420 27728 73 --1 -1 12.99990 14.99310 27801 137 --1 -1 10.70830 11.06290 27938 57 --1 -1 13.81870 14.43150 27995 57 --1 -1 14.27440 15.07360 28052 41 --1 -1 17.81900 18.48770 28093 57 --1 -1 13.74610 14.22740 28150 41 --1 -1 15.07360 15.72460 28191 41 --1 -1 13.40520 13.81810 28232 41 --1 -1 12.98680 12.99990 28273 41 --1 -1 10.00000 11.85310 28314 57 --1 -1 18.04210 19.70600 28371 41 --1 -1 20.76490 30.00000 28412 153 --1 -1 10.00000 13.50410 28565 121 --1 -1 14.72480 16.63860 28686 73 --1 -1 12.32330 13.70790 28759 89 --1 -1 10.00000 12.00810 28848 105 --1 -1 13.06100 13.82640 28953 105 --1 -1 14.72600 15.70470 29058 121 --1 -1 15.49840 27.29030 29179 105 --1 -1 10.00000 11.00400 29284 41 --1 -1 10.95800 12.15520 29325 73 --1 -1 10.15110 10.66470 29398 73 --1 -1 13.27640 15.09010 29471 105 --1 -1 11.89580 12.25190 29576 57 --1 -1 11.89390 12.40790 29633 73 --1 -1 11.00130 11.10930 29706 41 --1 -1 21.82510 25.00020 29747 41 --1 -1 13.70890 14.76420 29788 41 --1 -1 10.25700 10.72140 29829 57 --1 -1 12.00810 12.50340 29886 41 --1 -1 10.25820 10.43370 29927 41 --1 -1 27.66660 27.66690 29968 41 --1 -1 12.15400 12.29340 30009 41 --1 -1 12.25010 12.50430 30050 41 --1 -1 12.29400 12.67580 30091 41 --1 -1 10.60820 10.91800 30132 41 --1 -1 11.09860 11.13920 30173 41 --1 -1 10.92840 10.96070 30214 41 --1 -1 -8.09812 -5.85657 30255 121 --1 -1 4.68162 10.00000 30376 121 --1 -1 -3.92325 2.26642 30497 297 --1 -1 7.98520 9.08598 30794 89 --1 -1 3.47890 5.13542 30883 73 --1 -1 -5.01427 2.42390 30956 153 --1 -1 1.72198 7.52956 31109 121 --1 -1 6.58839 10.00000 31230 73 --1 -1 7.52682 9.98993 31303 121 --1 -1 7.89364 10.00000 31424 73 --1 -1 2.22156 3.64187 31497 73 --1 -1 9.99237 10.00000 31570 41 --1 -1 0.97551 2.34485 31611 73 --1 -1 6.28077 10.00000 31684 73 --1 -1 -5.77966 -4.63371 31757 73 --1 -1 6.36469 7.89548 31830 41 --1 -1 7.54574 7.98672 31871 41 --1 -1 -6.05249 -5.85626 31912 41 --1 -1 2.42725 3.07424 31953 41 --1 -1 6.10040 6.59236 31994 41 --1 -1 6.21820 6.28016 32035 41 --1 -1 -10.00000 -8.48142 32076 57 --1 -1 -10.00000 -7.05531 32133 73 --1 -1 -4.67094 10.00000 32206 377 --1 -1 3.40658 10.00000 32583 217 --1 -1 -10.00000 -9.39605 32800 73 --1 -1 9.08598 10.00000 32873 57 --1 -1 4.12680 5.38140 32930 153 --1 -1 -4.46098 -2.30945 33083 169 --1 -1 -8.47929 -4.44938 33252 73 --1 -1 3.49111 4.61936 33325 105 --1 -1 1.11254 4.22263 33430 73 --1 -1 -9.40612 -8.19303 33503 41 --1 -1 -2.39796 -1.06126 33544 57 --1 -1 4.60105 5.02373 33601 57 --1 -1 -2.73854 -1.69268 33658 41 --1 -1 0.23484 1.11376 33699 41 --1 -1 -1.00114 0.23667 33740 41 --1 -1 -1.69268 -1.38445 33781 41 --1 -1 3.72335 10.00000 33822 153 --1 -1 -1.67224 2.82094 33975 57 --1 -1 2.83284 3.99008 34032 41 --1 -1 6.41993 6.42145 34073 41 --1 -1 9.52819 10.00000 34114 41 --1 -1 0.85374 4.36118 34155 153 --1 -1 5.63104 6.71107 34308 121 --1 -1 4.01877 4.89586 34429 57 --1 -1 4.31418 4.90257 34486 57 --1 -1 1.27825 1.31121 34543 41 --1 -1 -9.10155 -2.60548 34584 41 --1 -1 -4.37064 -4.28275 34625 41 --1 -1 8.02914 9.56847 34666 57 --1 -1 -4.42802 -3.36934 34723 73 --1 -1 -4.22416 1.43786 34796 217 --1 -1 -10.00000 -9.69207 35013 73 --1 -1 -10.00000 -4.14603 35086 153 --1 -1 -10.00000 -9.42992 35239 73 --1 -1 4.38285 5.23217 35312 57 --1 -1 6.11872 10.00000 35369 153 --1 -1 -4.99565 -0.10788 35522 137 --1 -1 0.64958 4.22202 35659 137 --1 -1 3.56039 5.20592 35796 105 --1 -1 7.22896 8.67491 35901 89 --1 -1 5.20348 7.84665 35990 121 --1 -1 2.79225 6.19318 36111 73 --1 -1 1.22484 2.14374 36184 105 --1 -1 1.22210 2.79011 36289 57 --1 -1 0.61875 1.71374 36346 73 --1 -1 7.84543 8.11643 36419 41 --1 -1 1.18547 5.48547 36460 185 --1 -1 1.89319 4.03494 36645 137 --1 -1 2.32959 5.76501 36782 73 --1 -1 8.11643 8.53513 36855 57 --1 -1 9.48180 10.00000 36912 73 --1 -1 8.37827 10.00000 36985 73 --1 -1 4.35355 7.56008 37058 89 --1 -1 8.27543 9.99756 37147 89 --1 -1 7.19387 8.44663 37236 121 --1 -1 7.41817 8.56840 37357 57 --1 -1 8.78080 10.00000 37414 41 --1 -1 6.92653 8.48814 37455 41 --1 -1 5.59014 8.77989 37496 73 --1 -1 5.10033 5.58862 37569 41 --1 -1 5.08598 5.11406 37610 41 --1 -1 -17.90330 -16.96880 37651 105 --1 -1 -23.97570 -22.00120 37756 57 --1 -1 -28.96090 -28.02850 37813 105 --1 -1 -28.42560 -26.45530 37918 41 --1 -1 -23.23960 -22.68510 37959 57 --1 -1 -13.45400 -10.00000 38016 281 --1 -1 -17.13540 -10.00000 38297 329 --1 -1 -11.56500 -10.00000 38626 41 --1 -1 -17.95940 -14.01250 38667 137 --1 -1 -18.01430 -17.90330 38804 41 --1 -1 -26.89570 -25.29960 38845 89 --1 -1 -17.62550 -10.87130 38934 89 --1 -1 -22.00120 -17.99880 39023 73 --1 -1 -26.89660 -23.97570 39096 73 --1 -1 -20.51010 -17.47840 39169 73 --1 -1 -24.63190 -22.19230 39242 57 --1 -1 -30.00000 -28.61330 39299 73 --1 -1 -27.31620 -22.41810 39372 169 --1 -1 -21.34510 -18.40470 39541 89 --1 -1 -17.34600 -15.63360 39630 73 --1 -1 -18.48520 -17.79770 39703 57 --1 -1 -22.06560 -20.50740 39760 57 --1 -1 -22.41600 -21.34720 39817 57 --1 -1 -11.41600 -10.68970 39874 41 --1 -1 -29.64170 -28.61420 39915 57 --1 -1 -26.45530 -24.76620 39972 41 --1 -1 -18.41140 -17.35760 40013 41 --1 -1 -18.01620 -17.47940 40054 41 --1 -1 -30.00000 -29.64290 40095 41 --1 -1 -25.62430 -24.73960 40136 41 --1 -1 -12.01210 -12.01140 40177 41 --1 -1 -26.83960 -25.95760 40218 41 --1 -1 -12.00200 -12.00200 40259 41 --1 -1 -24.74450 -24.63070 40300 41 --1 -1 -22.19200 -22.06320 40341 41 --1 -1 -10.68970 -10.47940 40382 41 --1 -1 -30.00000 -17.50530 40423 217 --1 -1 -10.69180 -10.00000 40640 41 --1 -1 -16.26440 -10.00000 40681 169 --1 -1 -10.00400 -10.00000 40850 57 --1 -1 -11.13470 -10.00000 40907 73 --1 -1 -18.34790 -10.95120 40980 121 --1 -1 -24.16620 -21.78760 41101 137 --1 -1 -22.23930 -19.29880 41238 57 --1 -1 -20.16860 -16.26440 41295 89 --1 -1 -30.00000 -27.17160 41384 57 --1 -1 -27.43400 -22.08550 41441 105 --1 -1 -24.34870 -24.16620 41546 41 --1 -1 -27.29490 -24.24860 41587 57 --1 -1 -22.08970 -19.29700 41644 89 --1 -1 -27.17160 -25.57370 41733 57 --1 -1 -27.43250 -27.29640 41790 41 --1 -1 -22.08910 -22.08240 41831 41 --1 -1 -30.65890 -30.00000 41872 73 --1 -1 -30.31770 -30.00000 41945 41 --1 -1 -30.40440 -30.31710 41986 41 --1 -1 -50.00000 -30.00000 42027 345 --1 -1 -32.45000 -30.00000 42372 57 --1 -1 -33.74580 -30.10990 42429 137 --1 -1 -34.17360 -32.45400 42566 41 --1 -1 -51.99770 -50.00000 42607 89 --1 -1 -54.88590 -52.64350 42696 41 --1 -1 -52.37800 -51.99560 42737 41 --1 -1 70.00000 70.06710 42778 41 --1 -1 70.00000 70.08820 42819 41 --1 -1 50.00000 51.01900 42860 121 --1 -1 50.00000 53.60750 42981 121 --1 -1 54.46630 54.47670 43102 41 --1 -1 50.00000 50.32320 43143 41 --1 -1 58.90490 68.50860 43184 297 --1 -1 50.00000 50.16690 43481 57 --1 -1 50.00000 51.09100 43538 41 --1 -1 50.86580 53.27000 43579 73 --1 -1 50.75650 51.48650 43652 57 --1 -1 50.00000 50.12660 43709 41 --1 -1 54.76570 55.08640 43750 41 --1 -1 50.00000 54.46630 43791 105 --1 -1 68.40670 69.05760 43896 41 --1 -1 65.51320 70.00000 43937 137 --1 -1 62.91430 69.05060 44074 121 --1 -1 55.67540 56.45060 44195 73 --1 -1 55.67540 56.45060 44268 73 --1 -1 53.94780 54.97720 44341 57 --1 -1 53.94780 54.97720 44398 57 --1 -1 50.00000 50.95950 44455 73 --1 -1 51.84390 52.36700 44528 57 --1 -1 57.53580 58.08450 44585 57 --1 -1 55.60310 56.14940 44642 41 --1 -1 55.60310 56.14940 44683 41 --1 -1 51.37510 51.63030 44724 41 --1 -1 60.54760 62.91250 44765 41 --1 -1 56.15120 57.53640 44806 41 --1 -1 69.02950 70.00000 44847 73 --1 -1 54.46080 55.60310 44920 41 --1 -1 51.53110 51.92260 44961 41 --1 -1 51.63030 51.92080 45002 41 --1 -1 52.10820 53.12110 45043 41 --1 -1 53.12110 53.43880 45084 41 --1 -1 54.97720 55.67480 45125 57 --1 -1 54.97720 55.67480 45182 57 --1 -1 50.95950 51.25950 45239 41 --1 -1 51.25280 51.37510 45280 41 --1 -1 53.43850 53.80440 45321 41 --1 -1 51.25310 51.94430 45362 41 --1 -1 55.07210 55.24880 45403 41 --1 -1 54.36500 55.07180 45444 41 --1 -1 58.00980 59.15970 45485 41 --1 -1 51.94430 52.10820 45526 41 --1 -1 51.36900 51.84330 45567 41 --1 -1 57.53580 58.00980 45608 41 --1 -1 54.00210 54.46020 45649 41 --1 -1 55.67510 55.82650 45690 41 --1 -1 55.67510 55.82650 45731 41 --1 -1 55.79200 56.14940 45772 41 --1 -1 55.79200 56.14940 45813 41 --1 -1 53.80320 54.00210 45854 41 --1 -1 59.15970 59.35260 45895 41 --1 -1 55.79200 55.82650 45936 41 --1 -1 55.79200 55.82650 45977 41 --1 -1 51.25950 51.36900 46018 41 --1 -1 59.35260 59.47860 46059 41 --1 -1 60.25530 60.54550 46100 41 --1 -1 50.00000 51.76910 46141 57 --1 -1 50.00000 50.37510 46198 41 --1 -1 50.52830 51.12000 46239 105 --1 -1 50.47820 51.15600 46344 57 --1 -1 51.45480 51.78100 46401 73 --1 -1 50.00000 50.37690 46474 41 --1 -1 50.52860 51.50670 46515 41 --1 -1 51.46430 51.50670 46556 41 --1 -1 51.08490 51.15600 46597 41 --1 -1 51.08460 51.12000 46638 41 --1 -1 52.00080 54.18250 46679 153 --1 -1 50.79260 51.26470 46832 73 --1 -1 50.85330 51.66930 46905 41 --1 -1 53.43600 54.38790 46946 105 --1 -1 54.64520 55.36720 47051 57 --1 -1 53.34570 54.47550 47108 73 --1 -1 54.39090 54.64300 47181 41 --1 -1 54.39090 54.64300 47222 41 --1 -1 54.19320 55.29670 47263 57 --1 -1 55.29730 55.36840 47320 41 --1 -1 51.61990 52.00080 47361 41 --1 -1 53.43600 54.11110 47402 57 --1 -1 51.66930 53.34540 47459 41 --1 -1 54.19780 54.39250 47500 41 --1 -1 51.42820 51.61990 47541 41 --1 -1 54.18250 54.19680 47582 41 --1 -1 51.26680 51.43010 47623 41 --1 -1 50.00000 50.87460 47664 89 --1 -1 50.00000 52.14360 47753 89 --1 -1 50.00000 51.00250 47842 57 --1 -1 50.73610 51.31440 47899 73 --1 -1 50.00000 50.28410 47972 57 --1 -1 50.00000 51.88020 48029 105 --1 -1 50.00000 51.12950 48134 41 --1 -1 50.20840 53.55410 48175 121 --1 -1 50.00000 50.20290 48296 41 --1 -1 60.30750 69.64570 48337 57 --1 -1 54.70770 60.35230 48394 153 --1 -1 54.09950 55.07060 48547 57 --1 -1 49.23280 50.00000 48604 73 --1 -1 45.76780 46.87100 48677 89 --1 -1 47.58510 50.00000 48766 73 --1 -1 30.00000 33.17240 48839 105 --1 -1 43.78870 47.54060 48944 233 --1 -1 47.27470 50.00000 49177 169 --1 -1 46.86920 48.15460 49346 105 --1 -1 45.93220 47.80700 49451 105 --1 -1 39.80700 39.84480 49556 41 --1 -1 41.85050 42.62590 49597 57 --1 -1 48.61690 49.51810 49654 41 --1 -1 49.46010 50.00000 49695 57 --1 -1 49.98020 50.00000 49752 57 --1 -1 45.59810 47.09470 49809 105 --1 -1 30.23380 36.94350 49914 121 --1 -1 48.14420 49.01880 50035 89 --1 -1 42.60210 42.70920 50124 41 --1 -1 49.54500 50.00000 50165 41 --1 -1 42.43460 42.50690 50206 41 --1 -1 42.50690 42.56550 50247 57 --1 -1 42.95280 43.18230 50304 41 --1 -1 39.87010 39.93060 50345 41 --1 -1 43.91350 43.91620 50386 41 --1 -1 47.06420 47.27410 50427 41 --1 -1 48.01240 48.14360 50468 41 --1 -1 42.46110 42.46230 50509 41 --1 -1 42.48650 42.66290 50550 41 --1 -1 41.34140 41.41070 50591 41 --1 -1 43.72950 43.75750 50632 41 --1 -1 47.69310 47.69310 50673 41 --1 -1 42.54600 45.18640 50714 169 --1 -1 43.12340 43.53440 50883 41 --1 -1 44.85310 45.90750 50924 57 --1 -1 45.45860 46.48370 50981 73 --1 -1 49.07840 49.43690 51054 73 --1 -1 43.62480 46.15140 51127 153 --1 -1 30.00000 33.37800 51280 137 --1 -1 30.00000 31.64710 51417 57 --1 -1 45.21200 48.26380 51474 153 --1 -1 48.41180 50.00000 51627 73 --1 -1 47.95350 48.57600 51700 57 --1 -1 40.73530 41.75010 51757 105 --1 -1 35.92660 36.83360 51862 89 --1 -1 39.66900 42.53990 51951 89 --1 -1 30.00000 31.32270 52040 41 --1 -1 41.34140 44.22630 52081 105 --1 -1 30.00000 31.83290 52186 89 --1 -1 49.90330 50.00000 52275 41 --1 -1 31.98670 32.75000 52316 41 --1 -1 46.55120 48.00990 52357 41 --1 -1 49.62310 49.90420 52398 41 --1 -1 41.71250 42.08820 52439 57 --1 -1 33.37530 33.94480 52496 41 --1 -1 31.93850 32.23610 52537 41 --1 -1 47.83140 48.36760 52578 57 --1 -1 47.10930 47.86830 52635 57 --1 -1 48.58820 49.06550 52692 41 --1 -1 48.07130 48.46490 52733 41 --1 -1 48.25860 48.46490 52774 41 --1 -1 33.09390 33.24900 52815 41 --1 -1 36.02980 36.20490 52856 41 --1 -1 31.21740 31.59670 52897 41 --1 -1 48.00960 48.07130 52938 41 --1 -1 48.36760 48.58820 52979 41 --1 -1 37.64870 37.83950 53020 41 --1 -1 36.46920 36.49150 53061 41 --1 -1 45.13730 45.43180 53102 41 --1 -1 46.41570 46.55120 53143 41 --1 -1 36.56290 36.76650 53184 41 --1 -1 37.25170 37.50470 53225 41 --1 -1 38.11230 38.32440 53266 41 --1 -1 39.38740 39.39860 53307 41 --1 -1 36.93000 37.06400 53348 41 --1 -1 39.81400 40.03620 53389 41 --1 -1 36.62970 36.64130 53430 41 --1 -1 38.48400 38.70130 53471 41 --1 -1 40.25440 40.40360 53512 41 --1 -1 38.88040 39.07550 53553 41 --1 -1 31.80760 31.80820 53594 41 --1 -1 33.20710 33.25170 53635 41 --1 -1 43.90430 43.92900 53676 41 --1 -1 41.94230 42.32650 53717 41 --1 -1 42.56340 43.12340 53758 57 --1 -1 30.00000 39.64860 53815 233 --1 -1 36.83360 37.32160 54048 41 --1 -1 36.95200 38.28200 54089 121 --1 -1 41.26270 42.79770 54210 137 --1 -1 39.63270 41.58310 54347 89 --1 -1 38.44530 39.71970 54436 105 --1 -1 49.94200 50.00000 54541 57 --1 -1 38.87800 41.29870 54598 89 --1 -1 36.97060 37.38480 54687 89 --1 -1 41.89680 42.89910 54776 73 --1 -1 41.89680 42.89910 54849 73 --1 -1 41.89680 42.89910 54922 73 --1 -1 46.34550 48.24860 54995 105 --1 -1 41.28680 42.33720 55100 73 --1 -1 49.60510 49.62310 55173 41 --1 -1 42.89910 43.54570 55214 57 --1 -1 42.89910 43.54570 55271 57 --1 -1 41.05000 41.89590 55328 57 --1 -1 41.19620 41.89720 55385 57 --1 -1 33.94480 37.06190 55442 73 --1 -1 30.00000 31.93850 55515 57 --1 -1 38.84200 39.70570 55572 57 --1 -1 48.24860 50.00000 55629 57 --1 -1 49.06550 49.18390 55686 41 --1 -1 30.00000 30.01530 55727 57 --1 -1 41.11070 41.29780 55784 41 --1 -1 41.11070 41.29780 55825 41 --1 -1 41.32620 45.00300 55866 41 --1 -1 45.00240 45.57120 55907 57 --1 -1 37.05970 37.31980 55964 41 --1 -1 49.18390 49.60050 56005 41 --1 -1 40.66480 40.66510 56046 41 --1 -1 41.08450 41.08450 56087 41 --1 -1 41.08450 41.08450 56128 41 --1 -1 30.00000 30.00790 56169 41 --1 -1 41.00420 41.00570 56210 41 --1 -1 33.40760 41.93130 56251 281 --1 -1 44.86230 44.92970 56532 57 --1 -1 30.00000 38.47210 56589 377 --1 -1 30.00000 37.02560 56966 201 --1 -1 30.86490 33.40520 57167 121 --1 -1 30.00000 31.59640 57288 57 --1 -1 35.60520 36.95200 57345 73 --1 -1 41.23430 42.22400 57418 73 --1 -1 32.30320 35.50030 57491 121 --1 -1 37.36550 40.03100 57612 57 --1 -1 37.36550 40.03100 57669 57 --1 -1 41.00420 42.25270 57726 105 --1 -1 40.14570 41.00600 57831 73 --1 -1 42.25330 43.26860 57904 105 --1 -1 42.33050 42.80630 58009 57 --1 -1 39.50760 40.24490 58066 73 --1 -1 40.60750 42.25270 58139 89 --1 -1 39.19200 39.62020 58228 73 --1 -1 37.18580 39.29430 58301 73 --1 -1 40.22450 41.05030 58374 89 --1 -1 39.29370 40.14910 58463 73 --1 -1 40.03070 41.23550 58536 57 --1 -1 42.42420 43.73770 58593 89 --1 -1 42.42420 43.73770 58682 89 --1 -1 31.59910 32.30410 58771 41 --1 -1 42.80630 43.26860 58812 41 --1 -1 39.89330 40.16310 58853 57 --1 -1 43.48620 44.60530 58910 41 --1 -1 41.14370 42.42390 58951 73 --1 -1 41.14340 41.19430 59024 41 --1 -1 39.88750 39.88820 59065 41 --1 -1 40.42980 40.72470 59106 41 --1 -1 40.18480 40.22450 59147 41 --1 -1 39.98860 39.98860 59188 41 --1 -1 41.05150 41.19430 59229 41 --1 -1 40.99930 41.00110 59270 41 --1 -1 40.14180 40.14910 59311 41 --1 -1 41.93130 44.86230 59352 105 --1 -1 42.68790 49.17300 59457 313 --1 -1 49.17050 50.00000 59770 41 --1 -1 49.73450 50.00000 59811 57 --1 -1 30.00000 30.86490 59868 57 --1 -1 49.09210 50.00000 59925 89 --1 -1 42.19650 42.33050 60014 41 --1 -1 30.00000 30.34210 60055 57 --1 -1 41.58130 50.00000 60112 313 --1 -1 49.14210 50.00000 60425 89 --1 -1 49.94350 50.00000 60514 41 --1 -1 49.99050 50.00000 60555 41 --1 -1 49.50770 49.98930 60596 57 --1 -1 40.09290 43.00560 60653 137 --1 -1 42.29540 48.26750 60790 137 --1 -1 47.68550 50.00000 60927 105 --1 -1 38.22490 38.30640 61032 41 --1 -1 38.30640 38.62100 61073 41 --1 -1 39.82930 40.09600 61114 41 --1 -1 38.00060 38.22490 61155 41 --1 -1 37.69540 37.83280 61196 41 --1 -1 37.83220 38.00060 61237 41 --1 -1 37.75860 38.02500 61278 41 --1 -1 37.75860 37.99660 61319 41 --1 -1 37.65700 37.66430 61360 41 --1 -1 37.99660 38.02500 61401 41 --1 -1 48.27820 48.99960 61442 73 --1 -1 30.00000 32.71820 61515 153 --1 -1 48.99960 48.99960 61668 57 --1 -1 48.09600 49.37650 61725 89 --1 -1 41.67560 42.54990 61814 73 --1 -1 43.01630 48.31240 61887 137 --1 -1 42.55420 43.01320 62024 41 --1 -1 42.48280 46.12240 62065 137 --1 -1 45.59320 47.36450 62202 89 --1 -1 46.11960 47.47130 62291 57 --1 -1 45.18390 45.59470 62348 41 --1 -1 30.00000 35.08580 62389 121 --1 -1 37.18820 41.99850 62510 137 --1 -1 42.70980 43.39710 62647 41 --1 -1 35.27350 35.32910 62688 41 --1 -1 35.84180 35.91590 62729 41 --1 -1 36.15150 36.15150 62770 41 --1 -1 10.00000 13.89040 62811 217 --1 -1 21.49830 30.00000 63028 185 --1 -1 15.35710 21.81540 63213 121 --1 -1 10.00000 10.27340 63334 41 --1 -1 10.00000 12.39350 63375 73 --1 -1 13.71710 23.00100 63448 105 --1 -1 10.00000 12.82960 63553 73 --1 -1 10.00000 10.99580 63626 57 --1 -1 11.89520 15.00190 63683 121 --1 -1 11.02480 11.67850 63804 73 --1 -1 20.84640 23.52160 63877 41 --1 -1 11.67910 12.39600 63918 57 --1 -1 14.99180 15.35930 63975 41 --1 -1 11.69380 13.89200 64016 57 --1 -1 19.14660 20.85220 64073 57 --1 -1 10.27340 10.60490 64130 41 --1 -1 12.82780 13.08170 64171 41 --1 -1 10.96410 11.09680 64212 41 --1 -1 10.00000 10.92160 64253 41 --1 -1 10.00000 17.99270 64294 169 --1 -1 29.18880 30.00000 64463 73 --1 -1 19.50030 30.00000 64536 105 --1 -1 10.00000 19.49970 64641 137 --1 -1 29.48550 30.00000 64778 41 --1 -1 21.99850 22.23220 64819 89 --1 -1 29.55110 30.00000 64908 41 --1 -1 21.76810 23.12610 64949 57 --1 -1 29.54620 29.57610 65006 41 --1 -1 10.00000 11.47710 65047 57 --1 -1 29.85320 30.00000 65104 41 --1 -1 12.69110 15.10570 65145 137 --1 -1 22.69980 24.97950 65282 89 --1 -1 28.54520 29.47450 65371 73 --1 -1 16.37740 17.45710 65444 73 --1 -1 29.45950 30.00000 65517 57 --1 -1 10.98210 12.70880 65574 89 --1 -1 25.77510 26.72600 65663 57 --1 -1 29.10430 30.00000 65720 41 --1 -1 27.17740 28.69840 65761 41 --1 -1 27.17740 28.69840 65802 41 --1 -1 28.77470 29.20530 65843 57 --1 -1 16.63100 18.99890 65900 57 --1 -1 15.61680 25.47910 65957 153 --1 -1 15.61680 25.47910 66110 153 --1 -1 25.63620 26.06560 66263 41 --1 -1 25.63620 26.06560 66304 41 --1 -1 25.63780 25.79000 66345 41 --1 -1 29.90110 30.00000 66386 41 --1 -1 24.55590 24.62030 66427 41 --1 -1 25.19310 30.00000 66468 153 --1 -1 29.38840 30.00000 66621 73 --1 -1 24.26900 30.00000 66694 185 --1 -1 23.64830 24.32120 66879 57 --1 -1 21.14090 26.63200 66936 313 --1 -1 10.34490 20.38830 67249 201 --1 -1 26.53280 30.00000 67450 121 --1 -1 21.98230 29.46750 67571 281 --1 -1 22.04850 28.54920 67852 233 --1 -1 26.37260 28.32490 68085 153 --1 -1 27.76490 29.32710 68238 73 --1 -1 27.86430 30.00000 68311 73 --1 -1 21.96980 22.05040 68384 41 --1 -1 10.00000 10.35190 68425 41 --1 -1 21.14270 23.37790 68466 233 --1 -1 20.34620 20.35230 68699 41 --1 -1 13.92070 18.42110 68740 169 --1 -1 19.61200 22.39770 68909 201 --1 -1 11.63550 14.35070 69110 73 --1 -1 16.62730 19.69250 69183 73 --1 -1 17.52760 20.15520 69256 89 --1 -1 10.42240 11.66990 69345 89 --1 -1 14.70530 16.62850 69434 89 --1 -1 20.15760 21.68290 69523 73 --1 -1 11.86950 13.79610 69596 57 --1 -1 17.53030 18.21420 69653 73 --1 -1 14.32410 14.70680 69726 57 --1 -1 10.03200 10.42390 69783 73 --1 -1 22.14370 22.60940 69856 89 --1 -1 13.92980 14.70800 69945 41 --1 -1 21.43270 21.96980 69986 41 --1 -1 21.43480 21.68540 70027 41 --1 -1 22.20330 22.20390 70068 41 --1 -1 21.44910 21.66740 70109 41 --1 -1 11.66480 11.87080 70150 41 --1 -1 13.79580 13.93350 70191 41 --1 -1 28.14420 30.00000 70232 105 --1 -1 14.54840 17.81990 70337 169 --1 -1 25.96640 28.14420 70506 73 --1 -1 12.99990 14.99310 70579 137 --1 -1 10.70830 11.06290 70716 57 --1 -1 13.81870 14.43150 70773 57 --1 -1 14.27440 15.07360 70830 41 --1 -1 17.81900 18.48770 70871 57 --1 -1 13.74610 14.22740 70928 41 --1 -1 15.07360 15.72460 70969 41 --1 -1 13.40520 13.81810 71010 41 --1 -1 12.98680 12.99990 71051 41 --1 -1 10.00000 11.85310 71092 57 --1 -1 18.04210 19.70600 71149 41 --1 -1 20.76490 30.00000 71190 153 --1 -1 10.00000 13.50410 71343 121 --1 -1 14.72480 16.63860 71464 73 --1 -1 12.32330 13.70790 71537 89 --1 -1 10.00000 12.00810 71626 105 --1 -1 13.06100 13.82640 71731 105 --1 -1 14.72600 15.70470 71836 121 --1 -1 15.49840 27.29030 71957 105 --1 -1 10.00000 11.00400 72062 41 --1 -1 10.95800 12.15520 72103 73 --1 -1 10.15110 10.66470 72176 73 --1 -1 13.27640 15.09010 72249 105 --1 -1 11.89580 12.25190 72354 57 --1 -1 11.89390 12.40790 72411 73 --1 -1 11.00130 11.10930 72484 41 --1 -1 21.82510 25.00020 72525 41 --1 -1 13.70890 14.76420 72566 41 --1 -1 10.25700 10.72140 72607 57 --1 -1 12.00810 12.50340 72664 41 --1 -1 10.25820 10.43370 72705 41 --1 -1 27.66660 27.66690 72746 41 --1 -1 12.15400 12.29340 72787 41 --1 -1 12.25010 12.50430 72828 41 --1 -1 12.29400 12.67580 72869 41 --1 -1 10.60820 10.91800 72910 41 --1 -1 11.09860 11.13920 72951 41 --1 -1 10.92840 10.96070 72992 41 --1 -1 -8.09812 -5.85657 73033 121 --1 -1 4.68162 10.00000 73154 121 --1 -1 -3.92325 2.26642 73275 297 --1 -1 7.98520 9.08598 73572 89 --1 -1 3.47890 5.13542 73661 73 --1 -1 -5.01427 2.42390 73734 153 --1 -1 1.72198 7.52956 73887 121 --1 -1 6.58839 10.00000 74008 73 --1 -1 7.52682 9.98993 74081 121 --1 -1 7.89364 10.00000 74202 73 --1 -1 2.22156 3.64187 74275 73 --1 -1 9.99237 10.00000 74348 41 --1 -1 0.97551 2.34485 74389 73 --1 -1 6.28077 10.00000 74462 73 --1 -1 -5.77966 -4.63371 74535 73 --1 -1 6.36469 7.89548 74608 41 --1 -1 7.54574 7.98672 74649 41 --1 -1 -6.05249 -5.85626 74690 41 --1 -1 2.42725 3.07424 74731 41 --1 -1 6.10040 6.59236 74772 41 --1 -1 6.21820 6.28016 74813 41 --1 -1 -10.00000 -8.48142 74854 57 --1 -1 -10.00000 -7.05531 74911 73 --1 -1 -4.67094 10.00000 74984 377 --1 -1 3.40658 10.00000 75361 217 --1 -1 -10.00000 -9.39605 75578 73 --1 -1 9.08598 10.00000 75651 57 --1 -1 4.12680 5.38140 75708 153 --1 -1 -4.46098 -2.30945 75861 169 --1 -1 -8.47929 -4.44938 76030 73 --1 -1 3.49111 4.61936 76103 105 --1 -1 1.11254 4.22263 76208 73 --1 -1 -9.40612 -8.19303 76281 41 --1 -1 -2.39796 -1.06126 76322 57 --1 -1 4.60105 5.02373 76379 57 --1 -1 -2.73854 -1.69268 76436 41 --1 -1 0.23484 1.11376 76477 41 --1 -1 -1.00114 0.23667 76518 41 --1 -1 -1.69268 -1.38445 76559 41 --1 -1 3.72335 10.00000 76600 153 --1 -1 -1.67224 2.82094 76753 57 --1 -1 2.83284 3.99008 76810 41 --1 -1 6.41993 6.42145 76851 41 --1 -1 9.52819 10.00000 76892 41 --1 -1 0.85374 4.36118 76933 153 --1 -1 5.63104 6.71107 77086 121 --1 -1 4.01877 4.89586 77207 57 --1 -1 4.31418 4.90257 77264 57 --1 -1 1.27825 1.31121 77321 41 --1 -1 -9.10155 -2.60548 77362 41 --1 -1 -4.37064 -4.28275 77403 41 --1 -1 8.02914 9.56847 77444 57 --1 -1 -4.42802 -3.36934 77501 73 --1 -1 -4.22416 1.43786 77574 217 --1 -1 -10.00000 -9.69207 77791 73 --1 -1 -10.00000 -4.14603 77864 153 --1 -1 -10.00000 -9.42992 78017 73 --1 -1 4.38285 5.23217 78090 57 --1 -1 6.11872 10.00000 78147 153 --1 -1 -4.99565 -0.10788 78300 137 --1 -1 0.64958 4.22202 78437 137 --1 -1 3.56039 5.20592 78574 105 --1 -1 7.22896 8.67491 78679 89 --1 -1 5.20348 7.84665 78768 121 --1 -1 2.79225 6.19318 78889 73 --1 -1 1.22484 2.14374 78962 105 --1 -1 1.22210 2.79011 79067 57 --1 -1 0.61875 1.71374 79124 73 --1 -1 7.84543 8.11643 79197 41 --1 -1 1.18547 5.48547 79238 185 --1 -1 1.89319 4.03494 79423 137 --1 -1 2.32959 5.76501 79560 73 --1 -1 8.11643 8.53513 79633 57 --1 -1 9.48180 10.00000 79690 73 --1 -1 8.37827 10.00000 79763 73 --1 -1 4.35355 7.56008 79836 89 --1 -1 8.27543 9.99756 79925 89 --1 -1 7.19387 8.44663 80014 121 --1 -1 7.41817 8.56840 80135 57 --1 -1 8.78080 10.00000 80192 41 --1 -1 6.92653 8.48814 80233 41 --1 -1 5.59014 8.77989 80274 73 --1 -1 5.10033 5.58862 80347 41 --1 -1 5.08598 5.11406 80388 41 --1 -1 -17.90330 -16.96880 80429 105 --1 -1 -23.97570 -22.00120 80534 57 --1 -1 -28.96090 -28.02850 80591 105 --1 -1 -28.42560 -26.45530 80696 41 --1 -1 -23.23960 -22.68510 80737 57 --1 -1 -13.45400 -10.00000 80794 281 --1 -1 -17.13540 -10.00000 81075 329 --1 -1 -11.56500 -10.00000 81404 41 --1 -1 -17.95940 -14.01250 81445 137 --1 -1 -18.01430 -17.90330 81582 41 --1 -1 -26.89570 -25.29960 81623 89 --1 -1 -17.62550 -10.87130 81712 89 --1 -1 -22.00120 -17.99880 81801 73 --1 -1 -26.89660 -23.97570 81874 73 --1 -1 -20.51010 -17.47840 81947 73 --1 -1 -24.63190 -22.19230 82020 57 --1 -1 -30.00000 -28.61330 82077 73 --1 -1 -27.31620 -22.41810 82150 169 --1 -1 -21.34510 -18.40470 82319 89 --1 -1 -17.34600 -15.63360 82408 73 --1 -1 -18.48520 -17.79770 82481 57 --1 -1 -22.06560 -20.50740 82538 57 --1 -1 -22.41600 -21.34720 82595 57 --1 -1 -11.41600 -10.68970 82652 41 --1 -1 -29.64170 -28.61420 82693 57 --1 -1 -26.45530 -24.76620 82750 41 --1 -1 -18.41140 -17.35760 82791 41 --1 -1 -18.01620 -17.47940 82832 41 --1 -1 -30.00000 -29.64290 82873 41 --1 -1 -25.62430 -24.73960 82914 41 --1 -1 -12.01210 -12.01140 82955 41 --1 -1 -26.83960 -25.95760 82996 41 --1 -1 -12.00200 -12.00200 83037 41 --1 -1 -24.74450 -24.63070 83078 41 --1 -1 -22.19200 -22.06320 83119 41 --1 -1 -10.68970 -10.47940 83160 41 --1 -1 -30.00000 -17.50530 83201 217 --1 -1 -10.69180 -10.00000 83418 41 --1 -1 -16.26440 -10.00000 83459 169 --1 -1 -10.00400 -10.00000 83628 57 --1 -1 -11.13470 -10.00000 83685 73 --1 -1 -18.34790 -10.95120 83758 121 --1 -1 -24.16620 -21.78760 83879 137 --1 -1 -22.23930 -19.29880 84016 57 --1 -1 -20.16860 -16.26440 84073 89 --1 -1 -30.00000 -27.17160 84162 57 --1 -1 -27.43400 -22.08550 84219 105 --1 -1 -24.34870 -24.16620 84324 41 --1 -1 -27.29490 -24.24860 84365 57 --1 -1 -22.08970 -19.29700 84422 89 --1 -1 -27.17160 -25.57370 84511 57 --1 -1 -27.43250 -27.29640 84568 41 --1 -1 -22.08910 -22.08240 84609 41 --1 -1 -30.65890 -30.00000 84650 73 --1 -1 -30.31770 -30.00000 84723 41 --1 -1 -30.40440 -30.31710 84764 41 --1 -1 -50.00000 -30.00000 84805 345 --1 -1 -32.45000 -30.00000 85150 57 --1 -1 -33.74580 -30.10990 85207 137 --1 -1 -34.17360 -32.45400 85344 41 --1 -1 -51.99770 -50.00000 85385 89 --1 -1 -54.88590 -52.64350 85474 41 --1 -1 -52.37800 -51.99560 85515 41 --1 -1 70.00000 70.06710 85556 41 --1 -1 70.00000 70.08820 85597 41 --1 -1 50.00000 51.01900 85638 121 --1 -1 50.00000 53.60750 85759 121 --1 -1 54.46630 54.47670 85880 41 --1 -1 50.00000 50.32320 85921 41 --1 -1 58.90490 68.50860 85962 297 --1 -1 50.00000 50.16690 86259 57 --1 -1 50.00000 51.09100 86316 41 --1 -1 50.86580 53.27000 86357 73 --1 -1 50.75650 51.48650 86430 57 --1 -1 50.00000 50.12660 86487 41 --1 -1 54.76570 55.08640 86528 41 --1 -1 50.00000 54.46630 86569 105 --1 -1 68.40670 69.05760 86674 41 --1 -1 65.51320 70.00000 86715 137 --1 -1 62.91430 69.05060 86852 121 --1 -1 55.67540 56.45060 86973 73 --1 -1 55.67540 56.45060 87046 73 --1 -1 53.94780 54.97720 87119 57 --1 -1 53.94780 54.97720 87176 57 --1 -1 50.00000 50.95950 87233 73 --1 -1 51.84390 52.36700 87306 57 --1 -1 57.53580 58.08450 87363 57 --1 -1 55.60310 56.14940 87420 41 --1 -1 55.60310 56.14940 87461 41 --1 -1 51.37510 51.63030 87502 41 --1 -1 60.54760 62.91250 87543 41 --1 -1 56.15120 57.53640 87584 41 --1 -1 69.02950 70.00000 87625 73 --1 -1 54.46080 55.60310 87698 41 --1 -1 51.53110 51.92260 87739 41 --1 -1 51.63030 51.92080 87780 41 --1 -1 52.10820 53.12110 87821 41 --1 -1 53.12110 53.43880 87862 41 --1 -1 54.97720 55.67480 87903 57 --1 -1 54.97720 55.67480 87960 57 --1 -1 50.95950 51.25950 88017 41 --1 -1 51.25280 51.37510 88058 41 --1 -1 53.43850 53.80440 88099 41 --1 -1 51.25310 5... [truncated message content] |
From: <md...@us...> - 2007-11-08 16:27:19
|
Revision: 4162 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4162&view=rev Author: mdboom Date: 2007-11-08 08:27:18 -0800 (Thu, 08 Nov 2007) Log Message: ----------- Put a generic non-optimized draw_markers implementation in backend_bases. Modified Paths: -------------- branches/transforms/lib/matplotlib/backend_bases.py branches/transforms/lib/matplotlib/backends/backend_cairo.py branches/transforms/lib/matplotlib/backends/backend_template.py Modified: branches/transforms/lib/matplotlib/backend_bases.py =================================================================== --- branches/transforms/lib/matplotlib/backend_bases.py 2007-11-08 16:26:31 UTC (rev 4161) +++ branches/transforms/lib/matplotlib/backend_bases.py 2007-11-08 16:27:18 UTC (rev 4162) @@ -15,7 +15,21 @@ from matplotlib import rcParams class RendererBase: - """An abstract base class to handle drawing/rendering operations + """An abstract base class to handle drawing/rendering operations. + + The following methods *must* be implemented in the backend: + + draw_path + draw_image + draw_text + get_text_width_height_descent + + The following methods *should* be implemented in the backend for + optimization reasons: + + draw_markers + draw_path_collection + draw_quad_mesh """ def __init__(self): self._texmanager = None @@ -47,22 +61,41 @@ marker_trans is an affine transform applied to the marker. trans is an affine transform applied to the path. + + This provides a fallback implementation of draw_markers that + makes multiple calls to draw_path. Some backends may want to + override this method in order to draw the marker only once and + reuse it multiple times. """ - raise NotImplementedError - + ctx = gc.ctx + ctx.new_path() + tpath = trans.transform_path(path) + for x, y in tpath.vertices: + self.draw_path(gc, marker_path, + marker_trans + transforms.Affine2D().translate(x, y), + rgbFace) + def draw_path_collection(self, master_transform, cliprect, clippath, clippath_trans, paths, all_transforms, offsets, offsetTrans, facecolors, edgecolors, linewidths, linestyles, antialiaseds): """ + Draws a collection of paths, selecting drawing properties from + the lists facecolors, edgecolors, linewidths, linestyles and + antialiaseds. offsets is a list of offsets to apply to each + of the paths. The offsets in offsets are first transformed by + offsetTrans before being applied. + This provides a fallback implementation of draw_path_collection that makes multiple calls to draw_path. - Often, the backend will want to override this in order to - render each set of path data only once, and then reference - that path multiple times with the different offsets, colors, - styles etc. The methods _iter_collection_raw_paths and + Some backends may want to override this in order to render + each set of path data only once, and then reference that path + multiple times with the different offsets, colors, styles etc. + The generator methods _iter_collection_raw_paths and _iter_collection are provided to help with (and standardize) - the implementation across backends. + the implementation across backends. It is highly recommended + to use those generators, so that changes to the behavior of + draw_path_collection can be made globally. """ path_ids = [] for path, transform in self._iter_collection_raw_paths( Modified: branches/transforms/lib/matplotlib/backends/backend_cairo.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_cairo.py 2007-11-08 16:26:31 UTC (rev 4161) +++ branches/transforms/lib/matplotlib/backends/backend_cairo.py 2007-11-08 16:27:18 UTC (rev 4162) @@ -156,21 +156,6 @@ self._fill_and_stroke(ctx, rgbFace) - def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): - ctx = gc.ctx - ctx.new_path() - marker_trans = marker_trans + Affine2D().scale(1.0, -1.0) - tmarker_path = marker_trans.transform_path(marker_path) - - trans = trans + Affine2D().scale(1.0, -1.0).translate(0, self.height) - tpath = trans.transform_path(path) - for x, y in tpath.vertices: - ctx.save() - ctx.translate(x, y) - self.convert_path(ctx, tmarker_path) - self._fill_and_stroke(ctx, rgbFace) - ctx.restore() - def draw_image(self, x, y, im, bbox): # bbox - not currently used if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name()) Modified: branches/transforms/lib/matplotlib/backends/backend_template.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_template.py 2007-11-08 16:26:31 UTC (rev 4161) +++ branches/transforms/lib/matplotlib/backends/backend_template.py 2007-11-08 16:27:18 UTC (rev 4162) @@ -69,8 +69,10 @@ def draw_path(self, gc, path, transform, rgbFace=None): pass - def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): - pass + # draw_markers is optional, and we get more correct + # relative timings by leaving it out. +# def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): +# pass # draw_path_collection is optional, and we get more correct # relative timings by leaving it out. @@ -79,7 +81,15 @@ # offsetTrans, facecolors, edgecolors, linewidths, # linestyles, antialiaseds): # pass - + + # draw_quad_mesh is optional, and we get more correct + # relative timings by leaving it out. +# def draw_quad_mesh(self, master_transform, cliprect, clippath, +# clippath_trans, meshWidth, meshHeight, coordinates, +# offsets, offsetTrans, facecolors, antialiased, +# showedges): +# pass + def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |