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
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(5) |
2
(4) |
3
(2) |
4
(4) |
5
(2) |
6
(32) |
7
(34) |
8
(19) |
9
(6) |
10
(7) |
11
(14) |
12
(1) |
13
(2) |
14
(8) |
15
(5) |
16
(5) |
17
(8) |
18
(8) |
19
(6) |
20
(9) |
21
(12) |
22
(1) |
23
(2) |
24
(8) |
25
(2) |
26
(1) |
27
(2) |
28
(3) |
29
|
30
(2) |
|
|
|
Revision: 7710 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7710&view=rev Author: mdboom Date: 2009年09月08日 14:30:16 +0000 (2009年9月08日) Log Message: ----------- Update math_symbol_table directive to new Sphinx extension API Modified Paths: -------------- trunk/matplotlib/doc/sphinxext/math_symbol_table.py Modified: trunk/matplotlib/doc/sphinxext/math_symbol_table.py =================================================================== --- trunk/matplotlib/doc/sphinxext/math_symbol_table.py 2009年09月08日 12:13:44 UTC (rev 7709) +++ trunk/matplotlib/doc/sphinxext/math_symbol_table.py 2009年09月08日 14:30:16 UTC (rev 7710) @@ -1,4 +1,4 @@ -symbols = [ +nsymbols = [ ["Lower-case Greek", 5, r"""\alpha \beta \gamma \chi \delta \epsilon \eta \iota \kappa @@ -128,27 +128,17 @@ state_machine.insert_input(lines, "Symbol table") return [] -try: - from docutils.parsers.rst import Directive -except ImportError: - from docutils.parsers.rst.directives import _directives +def setup(app): def math_symbol_table_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): return run(state_machine) math_symbol_table_directive.arguments = None math_symbol_table_directive.options = {} math_symbol_table_directive.content = False - _directives['math_symbol_table'] = math_symbol_table_directive -else: - class math_symbol_table_directive(Directive): - has_content = False - def run(self): - return run(self.state_machine) - from docutils.parsers.rst import directives - directives.register_directive('math_symbol_table', - math_symbol_table_directive) + app.add_directive('math_symbol_table', + math_symbol_table_directive) -if __name__ == "__main__": +if __name__ == '__main__': # Do some verification of the tables from matplotlib import _mathtext_data This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7709 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7709&view=rev Author: jswhit Date: 2009年09月08日 12:13:44 +0000 (2009年9月08日) Log Message: ----------- update date2index function from netcdf4-python Modified Paths: -------------- trunk/toolkits/basemap/Changelog Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2009年09月08日 12:12:18 UTC (rev 7708) +++ trunk/toolkits/basemap/Changelog 2009年09月08日 12:13:44 UTC (rev 7709) @@ -1,4 +1,5 @@ version 0.99.5 (not yet released) + * update date2index function with a bug-fix from netcdf4-python. * in contourf method, mask data outside map projection region (this prevents contourf from erroneously filling entire map). * added 'nightshade' method to shade night regions on a map. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7708 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7708&view=rev Author: jswhit Date: 2009年09月08日 12:12:18 +0000 (2009年9月08日) Log Message: ----------- update date2index docstring Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009年09月08日 12:06:35 UTC (rev 7707) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009年09月08日 12:12:18 UTC (rev 7708) @@ -3919,6 +3919,13 @@ If ``calendar=None``, will use ``calendar`` attribute of ``nctime`` object, and if that attribute does not exist calendar is set to ``standard``. + select The index selection method. ``exact`` wil return the + indices perfectly matching the dates given. + ``before`` and ``after`` will return the indices + corresponding to the dates just before or after + the given dates if an exact match cannot be found. + ``nearest`` will return the indices that + correspond to the closest dates. ============== ==================================================== Returns an index or a sequence of indices. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7707 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7707&view=rev Author: jswhit Date: 2009年09月08日 12:06:35 +0000 (2009年9月08日) Log Message: ----------- update to latest version from netcdf4-python Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py 2009年09月08日 01:53:12 UTC (rev 7706) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py 2009年09月08日 12:06:35 UTC (rev 7707) @@ -934,18 +934,38 @@ cdftime = utime(units,calendar=calendar) return cdftime.num2date(times) - def _check_index(indices, dates, nctime, calendar): - """Assert that the time indices given correspond to the given dates.""" - t = numpy.empty(len(indices), nctime.dtype) - for n,i in enumerate(indices): - t[n] = nctime[i] - assert numpy.all( num2date(t, nctime.units, calendar) == dates) + """Return True if the time indices given correspond to the given dates, + False otherwise. + + Parameters: + indices : sequence of integers + Positive integers indexing the time variable. -def date2index(dates, nctime, calendar=None): + dates : sequence of datetime objects + Reference dates. + + nctime : netCDF Variable object + NetCDF time object. + + calendar : string + Calendar of nctime. + """ + if (indices <0).any(): + return False + + if (indices >= nctime.shape[0]).any(): + return False + + t = nctime[indices] + return numpy.all( num2date(t, nctime.units, calendar) == dates) + + + +def date2index(dates, nctime, calendar=None, select='exact'): """ - date2index(dates, nctime, calendar=None) + date2index(dates, nctime, calendar=None, select='exact') Return indices of a netCDF time variable corresponding to the given dates. @@ -953,7 +973,8 @@ The datetime objects should not include a time-zone offset. @param nctime: A netCDF time variable object. The nctime object must have a - C{units} attribute. + C{units} attribute. The entries are assumed to be stored in increasing + order. @param calendar: Describes the calendar used in the time calculation. Valid calendars C{'standard', 'gregorian', 'proleptic_gregorian' @@ -961,32 +982,54 @@ Default is C{'standard'}, which is a mixed Julian/Gregorian calendar If C{calendar} is None, its value is given by C{nctime.calendar} or C{standard} if no such attribute exists. + + @param select: C{'exact', 'before', 'after', 'nearest'} + The index selection method. C{exact} will return the indices perfectly + matching the dates given. C{before} and C{after} will return the indices + corresponding to the dates just before or just after the given dates if + an exact match cannot be found. C{nearest} will return the indices that + correpond to the closest dates. """ # Setting the calendar. if calendar is None: calendar = getattr(nctime, 'calendar', 'standard') num = numpy.atleast_1d(date2num(dates, nctime.units, calendar)) - - index = numpy.empty(numpy.alen(dates), int) - + # Trying to infer the correct index from the starting time and the stride. - try: - t0, t1 = nctime[:2] - dt = t1 - t0 - index[:] = (num-t0)/dt + # This assumes that the times are increasing uniformly. + t0, t1 = nctime[:2] + dt = t1 - t0 + index = numpy.array((num-t0)/dt, int) - # Checking that the index really corresponds to the given date. - _check_index(index, dates, nctime, calendar) - - except AssertionError: - - # If check fails, use brute force method. - index[:] = numpy.digitize(num, nctime[:]) - 1 - - # Perform check again. - _check_index(index, dates, nctime, calendar) - + # Checking that the index really corresponds to the given date. + # If the times do not correspond, then it means that the times + # are not increasing uniformly and we try the bisection method. + if not _check_index(index, dates, nctime, calendar): + + # Use the bisection method. Assumes the dates are ordered. + import bisect + + index = numpy.array([bisect.bisect_left(nctime, n) for n in num], int) + + nomatch = num2date(nctime[index], nctime.units) != dates + + if select == 'exact': + if not (num2date(nctime[index], nctime.units) == dates).all(): + raise ValueError, 'Dates not found.' + + elif select == 'before': + index[nomatch] -= 1 + + elif select == 'after': + pass + + elif select == 'nearest': + index[nomatch] = index[nomatch] - 1 * ( num[nomatch] < (nctime[index[nomatch]-1] + nctime[index[nomatch]]) / 2. ) + + else: + raise ValueError, select + # convert numpy scalars or single element arrays to python ints. index = _toscalar(index) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7706 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7706&view=rev Author: jdh2358 Date: 2009年09月08日 01:53:12 +0000 (2009年9月08日) Log Message: ----------- applied sf patch 2853659 Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_emf.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_emf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_emf.py 2009年09月08日 01:46:42 UTC (rev 7705) +++ trunk/matplotlib/lib/matplotlib/backends/backend_emf.py 2009年09月08日 01:53:12 UTC (rev 7706) @@ -23,6 +23,10 @@ from matplotlib.font_manager import findfont, FontProperties from matplotlib.ft2font import FT2Font, KERNING_UNFITTED, KERNING_DEFAULT, KERNING_UNSCALED +from matplotlib.path import Path +from matplotlib.transforms import Affine2D +from matplotlib.mlab import quad2cubic + # Font handling stuff snarfed from backend_ps, but only using TTF fonts _fontd = {} @@ -81,7 +85,7 @@ 'dashdot':pyemf.PS_DASHDOT, 'dotted':pyemf.PS_DOT} #style=styles.get(self.gc.get_linestyle('solid')) style=self.gc.get_linestyle('solid') - if debugHandle: print "EMFPen: style=%d" % style + if debugHandle: print "EMFPen: style=%s" % style if style in styles: self.style=styles[style] else: @@ -116,6 +120,28 @@ The renderer handles drawing/rendering operations through a pyemf.EMF instance. """ + + fontweights = { + 100 : pyemf.FW_NORMAL, + 200 : pyemf.FW_NORMAL, + 300 : pyemf.FW_NORMAL, + 400 : pyemf.FW_NORMAL, + 500 : pyemf.FW_NORMAL, + 600 : pyemf.FW_BOLD, + 700 : pyemf.FW_BOLD, + 800 : pyemf.FW_BOLD, + 900 : pyemf.FW_BOLD, + 'ultralight' : pyemf.FW_ULTRALIGHT, + 'light' : pyemf.FW_LIGHT, + 'normal' : pyemf.FW_NORMAL, + 'medium' : pyemf.FW_MEDIUM, + 'semibold' : pyemf.FW_SEMIBOLD, + 'bold' : pyemf.FW_BOLD, + 'heavy' : pyemf.FW_HEAVY, + 'ultrabold' : pyemf.FW_ULTRABOLD, + 'black' : pyemf.FW_BLACK, + } + def __init__(self, outfile, width, height, dpi): "Initialize the renderer with a gd image instance" self.outfile = outfile @@ -141,6 +167,8 @@ # set baseline for text to be bottom left corner self.emf.SetTextAlign( pyemf.TA_BOTTOM|pyemf.TA_LEFT) + self._lastClipRect = None + if debugPrint: print "RendererEMF: (%f,%f) %s dpi=%f" % (self.width,self.height,outfile,dpi) @@ -176,8 +204,66 @@ self.emf.Arc(int(x-hw),int(self.height-(y-hh)),int(x+hw),int(self.height-(y+hh)),int(x+math.cos(angle1*math.pi/180.0)*hw),int(self.height-(y+math.sin(angle1*math.pi/180.0)*hh)),int(x+math.cos(angle2*math.pi/180.0)*hw),int(self.height-(y+math.sin(angle2*math.pi/180.0)*hh))) - def draw_image(self, x, y, im, bbox): + def handle_clip_rectangle(self, gc): + new_bounds = gc.get_clip_rectangle() + if new_bounds is not None: + new_bounds = new_bounds.bounds + if self._lastClipRect != new_bounds: + self._lastClipRect = new_bounds + if new_bounds is None: + # use the maximum rectangle to disable clipping + x, y, width, height = (0, 0, self.width, self.height) + else: + x, y, width, height = new_bounds + self.emf.BeginPath() + self.emf.MoveTo(int(x), int(self.height - y)) + self.emf.LineTo(int(x) + int(width), int(self.height - y)) + self.emf.LineTo(int(x) + int(width), int(self.height - y) - int(height)) + self.emf.LineTo(int(x), int(self.height - y) - int(height)) + self.emf.CloseFigure() + self.emf.EndPath() + self.emf.SelectClipPath() + + + def convert_path(self, tpath): + self.emf.BeginPath() + last_points = None + for points, code in tpath.iter_segments(): + if code == Path.MOVETO: + self.emf.MoveTo(*points) + elif code == Path.LINETO: + self.emf.LineTo(*points) + elif code == Path.CURVE3: + points = quad2cubic(*(list(last_points[-2:]) + list(points))) + self.emf.PolyBezierTo(zip(points[2::2], points[3::2])) + elif code == Path.CURVE4: + self.emf.PolyBezierTo(zip(points[::2], points[1::2])) + elif code == Path.CLOSEPOLY: + self.emf.CloseFigure() + last_points = points + self.emf.EndPath() + + + def draw_path(self, gc, path, transform, rgbFace=None): """ + Draws a :class:`~matplotlib.path.Path` instance using the + given affine transform. + """ + self.handle_clip_rectangle(gc) + gc._rgb = gc._rgb[:3] + self.select_pen(gc) + self.select_brush(rgbFace) + transform = transform + Affine2D().scale(1.0, -1.0).translate(0.0, self.height) + tpath = transform.transform_path(path) + self.convert_path(tpath) + if rgbFace is None: + self.emf.StrokePath() + else: + self.emf.StrokeAndFillPath() + + + def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): + """ Draw the Image instance into the current axes; x is the distance in pixels from the left hand side of the canvas. y is the distance from the origin. That is, if origin is upper, y @@ -285,11 +371,17 @@ to if 1, and then the actual bounding box will be blotted along with your text. """ - if debugText: print "draw_text: (%f,%f) %d degrees: '%s'" % (x,y,angle,s) - if ismath: - self.draw_math_text(gc,x,y,s,prop,angle) - else: - self.draw_plain_text(gc,x,y,s,prop,angle) + if ismath: s = self.strip_math(s) + self.handle_clip_rectangle(gc) + self.emf.SetTextColor(gc.get_rgb()[:3]) + self.select_font(prop,angle) + if isinstance(s, unicode): + # unicode characters do not seem to work with pyemf + try: + s = s.replace(u'\u2212', '-').encode('iso-8859-1') + except UnicodeEncodeError: + pass + self.emf.TextOut(x,y,s) def draw_plain_text(self, gc, x, y, s, prop, angle): @@ -369,6 +461,22 @@ return w, h + def get_text_width_height_descent(self, s, prop, ismath): + """ + get the width and height in display coords of the string s + with FontPropertry prop + """ + if ismath: s = self.strip_math(s) + font = self._get_font_ttf(prop) + font.set_text(s, 0.0) + w, h = font.get_width_height() + w /= 64.0 # convert from subpixels + h /= 64.0 + d = font.get_descent() + d /= 64.0 + return w, h, d + + def flipy(self): """return true if y small numbers are top for renderer Is used for drawing text (text.py) and images (image.py) only @@ -407,7 +515,9 @@ handle = self._fontHandle.get(key) if handle is None: handle=self.emf.CreateFont(-size, 0, int(angle)*10, int(angle)*10, - pyemf.FW_NORMAL, 0, 0, 0, + self.fontweights.get(prop.get_weight(), pyemf.FW_NORMAL), + int(prop.get_style() == 'italic'), + 0, 0, pyemf.ANSI_CHARSET, pyemf.OUT_DEFAULT_PRECIS, pyemf.CLIP_DEFAULT_PRECIS, pyemf.DEFAULT_QUALITY, pyemf.DEFAULT_PITCH | pyemf.FF_DONTCARE, face); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7705 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7705&view=rev Author: jdh2358 Date: 2009年09月08日 01:46:42 +0000 (2009年9月08日) Log Message: ----------- add basic image interp unit test Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png trunk/matplotlib/lib/matplotlib/tests/test_image.py Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/tests/test_image.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_image.py (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/test_image.py 2009年09月08日 01:46:42 UTC (rev 7705) @@ -0,0 +1,31 @@ +import numpy as np + +from matplotlib.testing.decorators import image_comparison, knownfailureif +import matplotlib.pyplot as plt +from nose.tools import assert_raises + +@image_comparison(baseline_images=['image_interps']) +def test_image_interps(): + 'make the basic nearest, bilinear and bicubic interps' + X = np.arange(100) + X = X.reshape(5, 20) + + fig = plt.figure() + ax1 = fig.add_subplot(311) + ax1.imshow(X, interpolation='nearest') + ax1.set_title('three interpolations') + ax1.set_ylabel('nearest') + + ax2 = fig.add_subplot(312) + ax2.imshow(X, interpolation='bilinear') + ax2.set_ylabel('bilinear') + + ax3 = fig.add_subplot(313) + ax3.imshow(X, interpolation='bicubic') + ax3.set_ylabel('bicubic') + + fig.savefig('image_interps') + +if __name__=='__main__': + import nose + nose.runmodule(argv=['-s','--with-doctest'], exit=False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7704 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7704&view=rev Author: leejjoon Date: 2009年09月07日 22:39:44 +0000 (2009年9月07日) Log Message: ----------- Merged revisions 7703 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint ........ r7703 | leejjoon | 2009年09月07日 18:29:04 -0400 (2009年9月07日) | 1 line fix a bug in lib/matplotlib/bezier.py ........ Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/bezier.py Property Changed: ---------------- trunk/matplotlib/ trunk/matplotlib/doc/pyplots/README trunk/matplotlib/doc/sphinxext/gen_gallery.py trunk/matplotlib/doc/sphinxext/gen_rst.py trunk/matplotlib/examples/misc/multiprocess.py trunk/matplotlib/examples/mplot3d/contour3d_demo.py trunk/matplotlib/examples/mplot3d/contourf3d_demo.py trunk/matplotlib/examples/mplot3d/polys3d_demo.py trunk/matplotlib/examples/mplot3d/scatter3d_demo.py trunk/matplotlib/examples/mplot3d/surface3d_demo.py trunk/matplotlib/examples/mplot3d/wire3d_demo.py trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/v0_99_maint:1-7633,7638 /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 + /branches/mathtex:1-7263 /branches/v0_99_maint:1-7703 /branches/v0_98_5_maint:1-7253 Modified: svn:mergeinfo - /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/doc/pyplots/README ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/examples/misc/multiprocess.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/misc/log.py:5753-5771 /branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/examples/misc/log.py:5753-5771 /branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/examples/mplot3d/contour3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/examples/mplot3d/contourf3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/examples/mplot3d/polys3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/examples/mplot3d/scatter3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/examples/mplot3d/surface3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/examples/mplot3d/wire3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Modified: trunk/matplotlib/lib/matplotlib/bezier.py =================================================================== --- trunk/matplotlib/lib/matplotlib/bezier.py 2009年09月07日 22:29:04 UTC (rev 7703) +++ trunk/matplotlib/lib/matplotlib/bezier.py 2009年09月07日 22:39:44 UTC (rev 7704) @@ -474,7 +474,7 @@ """ c = p.codes if c is None: - c = np.empty(p.vertices.shape, "i") + c = np.empty(p.vertices.shape[:1], "i") c.fill(Path.LINETO) c[0] = Path.MOVETO Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638 + /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 Property changes on: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/v0_99_maint/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png:7703 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7703 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7703&view=rev Author: leejjoon Date: 2009年09月07日 22:29:04 +0000 (2009年9月07日) Log Message: ----------- fix a bug in lib/matplotlib/bezier.py Modified Paths: -------------- branches/v0_99_maint/lib/matplotlib/bezier.py Modified: branches/v0_99_maint/lib/matplotlib/bezier.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/bezier.py 2009年09月07日 20:56:27 UTC (rev 7702) +++ branches/v0_99_maint/lib/matplotlib/bezier.py 2009年09月07日 22:29:04 UTC (rev 7703) @@ -474,7 +474,7 @@ """ c = p.codes if c is None: - c = np.empty(p.vertices.shape, "i") + c = np.empty(p.vertices.shape[:1], "i") c.fill(Path.LINETO) c[0] = Path.MOVETO This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7702 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7702&view=rev Author: astraw Date: 2009年09月07日 20:56:27 +0000 (2009年9月07日) Log Message: ----------- testing: fix image_comparison decorator to guess image location when test run as script Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/testing/decorators.py Modified: trunk/matplotlib/lib/matplotlib/testing/decorators.py =================================================================== --- trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009年09月07日 20:56:17 UTC (rev 7701) +++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009年09月07日 20:56:27 UTC (rev 7702) @@ -55,11 +55,19 @@ # compute filename for baseline image module_name = func.__module__ - mods = module_name.split('.') - assert mods.pop(0)=='matplotlib' - assert mods.pop(0)=='tests' - subdir = '/'.join(mods) - basedir = os.path.dirname(matplotlib.tests.__file__) + if module_name=='__main__': + # FIXME: this won't work for nested packages in matplotlib.tests + import warnings + warnings.warn('test module run as script. guessing baseline image locations') + script_name = sys.argv[0] + basedir = os.path.abspath(os.path.dirname(script_name)) + subdir = os.path.splitext(os.path.split(script_name)[1])[0] + else: + mods = module_name.split('.') + assert mods.pop(0)=='matplotlib' + assert mods.pop(0)=='tests' + subdir = os.path.join(*mods) + basedir = os.path.dirname(matplotlib.tests.__file__) baseline_dir = os.path.join(basedir,'baseline_images',subdir) expected = os.path.join(baseline_dir,fname) + extension This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7701 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7701&view=rev Author: astraw Date: 2009年09月07日 20:56:17 +0000 (2009年9月07日) Log Message: ----------- testing: remove docstrings on tests, which makes easier discovery of test location Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py trunk/matplotlib/lib/matplotlib/tests/test_basic.py trunk/matplotlib/lib/matplotlib/tests/test_dates.py Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:27:44 UTC (rev 7700) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:56:17 UTC (rev 7701) @@ -11,7 +11,6 @@ 'formatter_ticker_005', ]) def test_formatter_ticker(): - """Test Some formatter and ticker issues.""" import matplotlib.testing.jpl_units as units units.register() @@ -61,8 +60,6 @@ @image_comparison(baseline_images=['polar_axes']) def test_polar_annotations(): - """Polar Plot Annotations""" - # you can specify the xypoint and the xytext in different # positions and coordinate systems, and optionally turn on a # connecting line and mark the point with a marker. Annotations @@ -98,8 +95,6 @@ #-------------------------------------------------------------------- @image_comparison(baseline_images=['polar_coords']) def test_polar_coord_annotations(): - """Polar Coordinate Annotations""" - # You can also use polar notation on a catesian axes. Here the # native coordinate system ('data') is cartesian, so you need to # specify the xycoords and textcoords as 'polar' if you want to @@ -130,7 +125,6 @@ @image_comparison(baseline_images=['fill_units']) def test_fill_units(): - """Test the fill method with unitized-data.""" from datetime import datetime import matplotlib.testing.jpl_units as units units.register() @@ -172,7 +166,6 @@ @image_comparison(baseline_images=['single_point']) def test_single_point(): - """Test single-point plots.""" fig = pylab.figure() pylab.subplot( 211 ) pylab.plot( [0], [0], 'o' ) @@ -184,8 +177,6 @@ @image_comparison(baseline_images=['single_date']) def test_single_date(): - """Test single-point date plots.""" - time1=[ 721964.0 ] data1=[ -65.54 ] @@ -200,8 +191,6 @@ @image_comparison(baseline_images=['single_date']) def test_shaped_data(): - """Test numpy shaped data.""" - xdata = np.array([[ 0.53295185, 0.23052951, 0.19057629, 0.66724975, 0.96577916, 0.73136095, 0.60823287, 0.017921 , 0.29744742, 0.27164665], [ 0.2798012 , 0.25814229, 0.02818193, 0.12966456, 0.57446277, @@ -246,7 +235,6 @@ @image_comparison(baseline_images=['const_xy']) def test_const_xy(): - """Test constant xy data.""" fig = pylab.figure() pylab.subplot( 311 ) @@ -264,8 +252,6 @@ 'polar_wrap_360', ]) def test_polar_wrap(): - """Test polar plots where data crosses 0 degrees.""" - D2R = np.pi / 180.0 fig = pylab.figure() @@ -291,7 +277,6 @@ @image_comparison(baseline_images=['polar_units']) def test_polar_units(): - """Test polar plots with unitized data.""" import matplotlib.testing.jpl_units as units units.register() @@ -315,7 +300,6 @@ @image_comparison(baseline_images=['axvspan_epoch']) def test_axvspan_epoch(): - """Test the axvspan method with Epochs.""" from datetime import datetime import matplotlib.testing.jpl_units as units units.register() @@ -337,7 +321,6 @@ @image_comparison(baseline_images=['axhspan_epoch']) def test_axhspan_epoch(): - """Test the axhspan method with Epochs.""" from datetime import datetime import matplotlib.testing.jpl_units as units units.register() Modified: trunk/matplotlib/lib/matplotlib/tests/test_basic.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_basic.py 2009年09月07日 20:27:44 UTC (rev 7700) +++ trunk/matplotlib/lib/matplotlib/tests/test_basic.py 2009年09月07日 20:56:17 UTC (rev 7701) @@ -2,10 +2,8 @@ from matplotlib.testing.decorators import knownfailureif def test_simple(): - '''very simple example test''' assert_equal(1+1,2) @knownfailureif(True) -def test_simple_fail(): - '''very simple example test that should fail''' +def test_simple_knownfail(): assert_equal(1+1,3) Modified: trunk/matplotlib/lib/matplotlib/tests/test_dates.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2009年09月07日 20:27:44 UTC (rev 7700) +++ trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2009年09月07日 20:56:17 UTC (rev 7701) @@ -115,7 +115,6 @@ @image_comparison(baseline_images=['DateFormatter_fractionalSeconds']) def test_DateFormatter(): - """Test DateFormatter""" import pylab from datetime import datetime import matplotlib.testing.jpl_units as units This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7700 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7700&view=rev Author: astraw Date: 2009年09月07日 20:27:44 +0000 (2009年9月07日) Log Message: ----------- test conversion: remove infrastructure cruft Modified Paths: -------------- trunk/matplotlib/test/README.txt trunk/matplotlib/test/_buildbot_mac_sage.sh trunk/matplotlib/test/_buildbot_test.py Removed Paths: ------------- trunk/matplotlib/test/consolidate_diff_images.sh trunk/matplotlib/test/movegood.py trunk/matplotlib/test/run-mpl-test.py Modified: trunk/matplotlib/test/README.txt =================================================================== --- trunk/matplotlib/test/README.txt 2009年09月07日 20:18:32 UTC (rev 7699) +++ trunk/matplotlib/test/README.txt 2009年09月07日 20:27:44 UTC (rev 7700) @@ -1,299 +1,2 @@ -======================================================================== - matplotlib test structure -======================================================================== - -===== How To Use - -= Running - -Run the 'run-mpl-test.py' script to execute the test harness. This must -be run with the version of python that you wish to test matplotlib with. -This means that it must have nose installed (and PIL if image comparison -is to be done). By default this will pick up whatever python is on your -path, so make sure it is the correct one. - -- Command-Line Options -In addition to the standard nose command-line options, there are several -specific to the matplotlib test harness. They are as follows: - - -t TAG, --with-tag=TAG - Will only run test cases that have the specified tag. - Each test case should have a 'tag' attribute (if a - case does not have one, then it is assumed to be an - empty list). The 'tag' attribute is a list of - strings, where each value is a representative propery - of the test case. Example tags are 'qt' or 'units'. - This can be specified multiple times. - --without-tag=TAG This will run those test cases that do not have the - specified tags. - --clean This will remove all output files and saved results. - If this is specified, no other processing will be - performed. - --all This will runn all test programs regardless of working - directory. - --keep Keep any generated output files in a directory called - 'saved-results'. This directory will be created if it - doesn't already exist. This directory is in the same - location as the test case whose results are being - saved. - --keep-failed This acts just like '--keep' except will only keeps - the results from tests that error or fail. - --make-test=testName - Creates a template test case file in the current - directory with the name TestFoo. Where 'Foo' is the - provided test name. - - -- Running Specific Tests -In order to can specify the exact test case you want to run use the -standard nose mechanism. For example, if you have the following setup: - -TestFoo.py - def test_func(): - ... - - class TestFoo: - def test_bar( self ): - ... - def test_bug( self ): - ... - -Then to test everything in TestFoo.py do the following: -$> run-mpl-test.py TestFoo.py - -To run all tests in the test class TestFoo do this: -$> run-mpl-test.py TestFoo.py:TestFoo - -To run the specific 'test_bar' methodd do the following: -$> run-mpl-test.py TestFoo.py:TestFoo.test_bar - - -= Detecting Test Cases - -When running the matplotlib test script it will search for all tests -in the current working directory and below (unless '--all' is specified). -This is provided that the current working directory is a sub-directory -of the matplotlib test directory. In the event that it is not, then the -matplotlib root test directory will be used and all appropriate test cases -will be run. - -This will not search outside of the test structure and will not look in -the mplTest module. This will only search for test cases in the root -test directory and any of its sub-directories. - -= Saving Results - -When using the keep flag any generated files in the 'output' directory -are copied to the 'saved-results/<classname>' directory, where <classname> -is the name of the unit-test class. This means that for each test case -within a given test class, all output files should have unique names. - -The 'saved-results' directory will always contain the results from the -last test run. This is considered a volatile directory since running -the test cases without the '--keep' flag will remove any existing -'saved-results' directory. This is to ensure the integrity of the -saved results, they will always match the last test run. - -= Filtering Tests - -In the case of filtering via tags, a unit-test cane have multiple tags. -When running the test program if any tags are specified as 'skip' then -this will take precedence over any tags that might say 'process'. For -example, if a test case has both the 'gui' and 'qt' tag, but the command- -line is specified with the following flags: - '--with-tag=gui --without-tag=qt' -then the example test case will not be run because it matches the skip -tag. - - -===== Directory Structure - -There are several directories in the matplotlib test structure. The first -directory is the 'mplTest' directory. This is the matplotlib test module -and contains the various python scripts that the test harness needs to -run. The remaining directories are as follows and contain the various test -cases for matplotlib. - -mplTest - This directory does not contain any test cases, rather it is the location - of the matplotlib specific utilities for performing unit tests. - -test_artists - This directory contains tests that focus on the rendering aspects of - the various artists. Essentially the artist derived functionality. - -test_backends - This directory contains various tests that focus on making sure the - various backend targets work. - -test_basemap - This directory contains test cases that excercise the basemap add-on - module. - -test_cxx - This directoy contains tests that focus on testing the interface of - the compiled code contained in matplotlib. - -test_mathtext - This directory contains tests that focus on excercising the mathtext - sub-system. - -test_numerix - This directory contains tests that focus on validating the numerix - component. - -test_plots - This directory contains tests that validate the various plot funtions. - -test_pylab - This directory has pylab specific test cases. - -test_transforms - This directory has test cases that focus on testing the various - transformation and projection functions. - -test_matplotlib - This directory has all other test cases. This contins test that focus - on making sure that Axis, Axes, Figure, etc are all acting properly. This - has test cases that are general to the overall funtionality of matplotlib. - - -===== Writing Test Cases - -= The Test Case - -As per the nose implementation, a test case is ultimately any function that -has the phrase 'test' in its name. The matplotlib cases however are grouped -into directories, by what is being tested, and from there are grouped into -classes (one class per file), by similarity. - -It is desireable that all matplotlib tests follow the same structure to -not only facilitate the writing of test cases, but to make things easier -for maintaining them and keeping things uniform. - -There is a class 'MplTestCase' provided to be the base class for all matplotlib -test classes. This class provides some extra functionality in the form of -verification functions and test data management. - -= Comparison Functions - -There are several methods provided for testing whether or not a particular -test case should fail or succeed. The following methods are provided by -the base matplotlib test class: - -- MplTestCase.checkEq( expected, actual, msg = "" ) - Fail if the values are not equal, with the given message. - -- MplTestCase.checkNeq( expected, actual, msg = "" ) - Fail if the values are equal, with the given message. - -- MplTestCase.checkClose( expected, actual, relTol=None, absTol=None, msg="" ) - Fail if the floating point values are not close enough, with the given message. - You can specify a relative tolerance, absolute tolerance, or both. - -- MplTestCase.checkImage( filename, tol = 1.0e-3, msg = "" ) - Check to see if the image is similair to the one stored in the baseline - directory. filename can be a fully qualified name (via the 'outFile' method), - or it can be the name of the file (to be passed into the 'outFile' method). - The default tolerance is typically fine, but might need to be adjusted in some - cases (see the 'compareImages' function for more details). Fails with - the specified message. - -Note that several of the tests will perform image comparison for validation -of a specific plot. Though not 100% accurate it at least flags potential -failures and signals a human to come and take a closer look. If an image has -changed and after a human deems the change is acceptable, then updating the -baseline image with the appropriate image from the 'saved-results' directory -(when using the '--keep' or '--keep-failed' command-line arguments) will make -the test pass properly. - -Image comparison depends on the python imaging library (PIL) being installed. -If PIL is not installed, then any test cases that rely on it will not -pass. To not run these test cases, then pass the '--without-tag=PIL' -option on the command-line. - -= Directories - -Input data files for a given test case should be place in a directory -called 'inputs' with the test case that uses it. A convienence function -is provided with each test class for accessing input files. - -For example if a test case has an input file of the name 'inputs.txt' -you can get the path to the file by calling 'self.inFile("inputs.txt")'. -This is to allow for a uniform convention that all test cases can follow. - -Output files are handled just like input files with the exception that -they are written to the 'output' directory and the path name can be -had by calling 'self.outFile'. It is more important to use this mechanism -for getting the pathname for an output file because it allows for the -management of cleaning up and saving generated output files (It also -significantly reduces the probability of typo errors when specifying -where to place the files). - -A Third and final directory used by the test cases is the 'baseline' -directory. This is where data files used for verifying test results -are stored. The path name can be had by using the 'self.baseFile' -method. - -Accessing these directories can be made simple (and reduce the chance of a -typo) via the following MplTestCase methods: - -- MplTestCase.inFile( filename ) - Returns the full pathname of filename in the input data directory. - -- MplTestCase.outFile( filename ) - Returns the full pathname of filename in the output data directory. - -- MplTestCase.baseFile( filename ) - Returns the full pathname of filename in the baseline data directory. - -= Units - -Located in the mplTest directory is a set of unit classes. These classes -are provided for testing the various unitized data interfaces that matplotlib -supports (ie unit conversion). These are used because they provide a very -strict enforcement of unitized data which will test the entire spectrum of how -unitized data might be used (it is not always meaningful to convert to -a float without specific units given). This allows us to test for cases that -might accidentally be performing operations that really do not make sense -physically for unitized data. - -The provided classes are as follows: -- UnitDbl - UnitDbl is essentially a unitized floating point number. It has a - minimal set of supported units (enough for testing purposes). All - of the mathematical operation are provided to fully test any behaviour - that might occur with unitized data. Remeber that unitized data has - rules as to how it can be applied to one another (a value of distance - cannot be added to a value of time). Thus we need to guard against any - accidental "default" conversion that will strip away the meaning of the - data and render it neutered. - -- Epoch - Epoch is different than a UnitDbl of time. Time is something that can be - measured where an Epoch is a specific moment in time. Epochs are typically - referenced as an offset from some predetermined epoch. Conceptally an Epoch - is like saying 'January 1, 2000 at 12:00 UTC'. It is a specific - time, but more importantly it is a time with a frame. In the example - the frame is 'UTC'. This class is provided to test the functionality of - matplotlib's various routines and mechanisms for dealing with datetimes. - -- Duration - A difference of two epochs is a Duration. The distinction between a - Duration and a UnitDbl of time is made because an Epoch can have different - frames (or units). In the case of our test Epoch class the two allowed - frames are 'UTC' and 'ET' (Note that these are rough estimates provided for - testing purposes and should not be used in production code where accuracy - of time frames is desired). As such a Duration also has a frame of - reference and therefore needs to be called out as different that a simple - measurement of time since a delta-t in one frame may not be the same in another. - - - -Updating after diff -==================== - - python run-mpl-test.py --all --keep-failed - ./consolidate_diff_images.sh - # check your images, decide which are good - python movegood.py +Please see doc/devel/coding_guide.rst for information about the +testing infrastructure. Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh =================================================================== --- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009年09月07日 20:18:32 UTC (rev 7699) +++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009年09月07日 20:27:44 UTC (rev 7700) @@ -13,4 +13,4 @@ cd test rm -f failed-diff-*.png -python run-mpl-test.py --verbose --all --keep-failed +python -c "import matplotlib; matplotlib.test(verbosity=2)" Modified: trunk/matplotlib/test/_buildbot_test.py =================================================================== --- trunk/matplotlib/test/_buildbot_test.py 2009年09月07日 20:18:32 UTC (rev 7699) +++ trunk/matplotlib/test/_buildbot_test.py 2009年09月07日 20:27:44 UTC (rev 7700) @@ -18,5 +18,5 @@ for fname in previous_test_images: os.unlink(fname) -check_call('%s run-mpl-test.py --verbose --all'%TARGET_py, +check_call('%s -c "import matplotlib; matplotlib.test(verbosity=2)"'%TARGET_py, cwd='test') Deleted: trunk/matplotlib/test/consolidate_diff_images.sh =================================================================== --- trunk/matplotlib/test/consolidate_diff_images.sh 2009年09月07日 20:18:32 UTC (rev 7699) +++ trunk/matplotlib/test/consolidate_diff_images.sh 2009年09月07日 20:27:44 UTC (rev 7700) @@ -1,7 +0,0 @@ -#!/bin/bash -set -e - -TARGET_DIR="diff-images" -rm -rf $TARGET_DIR -mkdir $TARGET_DIR -find . -name 'failed-diff-*png' -exec mv {} $TARGET_DIR/ \; Deleted: trunk/matplotlib/test/movegood.py =================================================================== --- trunk/matplotlib/test/movegood.py 2009年09月07日 20:18:32 UTC (rev 7699) +++ trunk/matplotlib/test/movegood.py 2009年09月07日 20:27:44 UTC (rev 7700) @@ -1,53 +0,0 @@ -import os, sys, glob, shutil -import matplotlib.cbook as cbook - -savedresults_dir = 'saved-results' -baseline_dir = 'baseline' -diff_dir = 'diff-images' -basename = 'failed-diff-' -nbase = len(basename) - -failed = set() -for fname in glob.glob(os.path.join(diff_dir, '%s*.png'%basename)): - ind = fname.find(basename) - fname = fname[ind+nbase:] - failed.add(fname) - -datad = dict() -for fpath in cbook.get_recursive_filelist('.'): - if not fpath.endswith('.png'): continue - if fpath.find(diff_dir)>0: continue - rel_dir, fname = os.path.split(fpath) - - - saved = fpath.find(savedresults_dir)>0 - baseline = fpath.find(baseline_dir)>0 - - if saved: - datad.setdefault(fname, [None,None])[0] = fpath - elif baseline: - datad.setdefault(fname, [None,None])[1] = fpath - -nfailed = len(failed) -for ithis, fname in enumerate(sorted(failed)): - data = datad.get(fname) - if data is not None: - saved, baseline = data - #print ithis, fname, saved, baseline - if saved is None: - print 'could not find saved data for', fname - elif baseline is None: - print 'could not find baseline data for', fname - else: - x = raw_input('Copy %d of %d\n saved="%s" to\n baseline="%s" (n|Y):'%(ithis, nfailed, saved, baseline)) - if x.lower()=='y' or x=='': - shutil.copy(saved, baseline) - print ' copied' - elif x.lower()=='n': - print ' skipping' - else: - print ' skipping unrecognized response="%s"'%x - print - - else: - print 'could not find data for', fname Deleted: trunk/matplotlib/test/run-mpl-test.py =================================================================== --- trunk/matplotlib/test/run-mpl-test.py 2009年09月07日 20:18:32 UTC (rev 7699) +++ trunk/matplotlib/test/run-mpl-test.py 2009年09月07日 20:27:44 UTC (rev 7700) @@ -1,100 +0,0 @@ -#!/bin/env python -""" - - TODO-NOTES: - Command-line executable that runs the tests. - -- nice report on test pass/fail status - -- hooks to add coverage checking and reporting - - Utilities - -- image comparison tools (non-PIL dependant) - -""" -import os -import sys -import os.path - -# Save stdout/stderr -originalStdout = sys.stdout -originalStderr = sys.stderr - -# get the current directory and the root test directory -cwd = os.path.abspath( os.getcwd() ) -root = os.path.dirname( os.path.abspath( sys.argv[0] ) ) -sys.path = [ root ] + sys.path - -# command-line arguments -args = [ arg for arg in sys.argv ] - -# determine the actual working directory to use -if root in cwd: - working = cwd -else: - working = root - -if '--all' in args: - working = root - -# print "DBG: mpl.test.run - cwd = '%s'" % (cwd) -# print "DBG: mpl.test.run - root = '%s'" % (root) -# print "DBG: mpl.test.run - working = '%s'" % (working) - -# make the working directory current -os.chdir( working ) - -import nose -import nose.plugins.builtin -import matplotlib -from matplotlib.testing.noseclasses import KnownFailure - -for arg in args: - # We need to do this here, because we do not actually want nose to start. - if arg.startswith( '--make-test=' ): - testname = arg[ 12: ] - # Remove any surrounding quotation marks - if (testname[0] == '"' and testname[-1] == '"') or \ - (testname[0] == "'" and testname[-1] == "'"): - testname = testname[1:-1] - - filename = os.path.join( cwd, 'Test' + testname + '.py' ) - templName = os.path.join( root, 'mplTest', "TestTEMPLATE.py" ) - - fin = open( templName, "r" ) - fout = open( filename, "w" ) - - lines = fin.readlines() - for line in lines: - newline = line.replace( 'UNITTEST', testname ) - fout.write( newline ) - - fin.close() - fout.close() - - print "Generated '%s'" % (filename) - - sys.exit( 0 ) - -### Run nose -args.append('.') -args.extend( matplotlib.default_test_modules ) - -plugins = [plugin() for plugin in nose.plugins.builtin.plugins] -plugins.extend( [ KnownFailure() ]) - -success = nose.run( argv = args, - plugins = plugins, - ) - -### do other stuff here - - -# $> nosetests [-w <working_directory>] -# Run a specific test -# $> nosetests tests/test_stuff.py:test_function -# $> nosetests tests/test_stuff.py:TestClass.test_method - -# Restore the original stdout/stderr -sys.stdout = originalStdout -sys.stderr = originalStderr - -sys.exit(not success) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7699 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7699&view=rev Author: astraw Date: 2009年09月07日 20:18:32 +0000 (2009年9月07日) Log Message: ----------- test conversion: remove empy directories Removed Paths: ------------- trunk/matplotlib/test/mplTest/ trunk/matplotlib/test/test_artists/ trunk/matplotlib/test/test_backends/ trunk/matplotlib/test/test_basemap/ trunk/matplotlib/test/test_cxx/ trunk/matplotlib/test/test_mathtext/ trunk/matplotlib/test/test_matplotlib/ trunk/matplotlib/test/test_numerix/ trunk/matplotlib/test/test_plots/ trunk/matplotlib/test/test_pylab/ trunk/matplotlib/test/test_transforms/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7698 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7698&view=rev Author: astraw Date: 2009年09月07日 20:06:06 +0000 (2009年9月07日) Log Message: ----------- test conversion: remove old mplTest nose extensions Modified Paths: -------------- trunk/matplotlib/test/_buildbot_test.py trunk/matplotlib/test/run-mpl-test.py Removed Paths: ------------- trunk/matplotlib/test/mplTest/MplNosePlugin.py trunk/matplotlib/test/mplTest/MplTestCase.py trunk/matplotlib/test/mplTest/__init__.py trunk/matplotlib/test/mplTest/directories.py trunk/matplotlib/test/mplTest/path_utils.py Modified: trunk/matplotlib/test/_buildbot_test.py =================================================================== --- trunk/matplotlib/test/_buildbot_test.py 2009年09月07日 20:05:54 UTC (rev 7697) +++ trunk/matplotlib/test/_buildbot_test.py 2009年09月07日 20:06:06 UTC (rev 7698) @@ -18,5 +18,5 @@ for fname in previous_test_images: os.unlink(fname) -check_call('%s run-mpl-test.py --verbose --all --keep-failed'%TARGET_py, +check_call('%s run-mpl-test.py --verbose --all'%TARGET_py, cwd='test') Deleted: trunk/matplotlib/test/mplTest/MplNosePlugin.py =================================================================== --- trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009年09月07日 20:05:54 UTC (rev 7697) +++ trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009年09月07日 20:06:06 UTC (rev 7698) @@ -1,838 +0,0 @@ -#======================================================================= - -import os -import sys -import shutil -import os.path -import optparse - -import nose.case -from nose.plugins import Plugin - -from path_utils import * -import directories as dirs -from MplTestCase import MplTestCase -from matplotlib.testing.noseclasses import KnownFailureTest - -#======================================================================= - -__all__ = [ 'MplNosePlugin' ] - -#======================================================================= -def getInstance( test ): - """Given a nose test case, will return the actual unit test instance. - - We do this with a function call in case the method for getting the - actual unit test instance needs to change. - """ - assert isinstance( test, nose.case.Test ) - - if isinstance( test.test, nose.case.MethodTestCase ): - return test.test.inst - elif isinstance( test.test, nose.case.FunctionTestCase ): - return test.test.test - # elif isinstance( test.test, unittest.TestCase ): - else: - return test.test - - -#======================================================================= -class MplNosePlugin( Plugin ): - - enabled = True - name = "MplNosePlugin" - score = 0 - - KEEP_NONE = 0 - KEEP_FAIL = 1 - KEEP_ALL = 2 - - TEST_ERRORED = -1 - TEST_FAILED = 0 - TEST_KNOWN_FAILED = 1 - TEST_PASSED = 2 - - #-------------------------------------------------------------------- - # Some 'property' functions - def getRootDir( self ): - # The bottom directory of the stack is the root directory. - return self.dirStack[0] - - def getInputDir( self ): - return os.path.join( self.currentDir, dirs.inputDirName ) - - def getOutputDir( self ): - return os.path.join( self.currentDir, dirs.outputDirName ) - - def getBaselineRootDir( self ): - return os.path.join( self.currentDir, dirs.baselineDirName ) - - def getSaveRootDir( self ): - return os.path.join( self.currentDir, dirs.saveDirName ) - - rootDir = property( getRootDir ) - inputDir = property( getInputDir ) - outputDir = property( getOutputDir ) - baselineRootDir = property( getBaselineRootDir ) - saveRootDir = property( getSaveRootDir ) - - def getBaselineDir( self, test ): - t = getInstance( test ) - return os.path.join( self.baselineRootDir, t.__class__.__name__ ) - - def getSaveDir( self, test ): - t = getInstance( test ) - return os.path.join( self.saveRootDir, t.__class__.__name__ ) - - #-------------------------------------------------------------------- - def saveResults( self, test ): - """Save the output directory for the gived test.""" - saveDir = self.getSaveDir( test ) - if not os.path.exists( saveDir ): - mkdir( saveDir, recursive = True ) - - outDir = getInstance( test ).outputDir - - for fname in walk( outDir ): - if os.path.isdir( fname ): - shutil.copytree( fname, saveDir ) - else: - shutil.copy( fname, saveDir ) - - #-------------------------------------------------------------------- - def filterTestItem( self, item ): - """Return true if you want the main test selector to collect tests from - this class, false if you don't, and None if you don't care. - - Parameters: - item : An instance of the testable item that has a 'tag' attribute. - """ - - reallyWant = False - reallyDontWant = False - - if hasattr( item, 'tags' ): - itemTags = item.tags - else: - itemTags = [] - - for tag in self.skipTags: - if tag in itemTags: - reallyDontWant = True - break - - for tag in self.includeTags: - if tag in itemTags: - reallyWant = True - else: - reallyDontWant = True - break - - if self.includeTags and not itemTags: - reallyDontWant = True - - if reallyDontWant: - return False - if reallyWant: - return True - - return None - - #-------------------------------------------------------------------- - def addError( self, test, err ): - """Called when a test raises an uncaught exception. DO NOT return a value - unless you want to stop other plugins from seeing that the test has - raised an error. - - Parameters: - test : nose.case.Test - the test case - err : 3-tuple - sys.exc_info() tuple - """ - (type, value, traceback) = err - if isinstance(value,KnownFailureTest): - self.testResults.append( (test, self.TEST_KNOWN_FAILED, err) ) - else: - self.testResults.append( (test, self.TEST_ERRORED, err) ) - - #-------------------------------------------------------------------- - def addFailure( self, test, err ): - """Called when a test fails. DO NOT return a value unless you want to - stop other plugins from seeing that the test has failed. - - Parameters: - test : nose.case.Test - the test case - err : 3-tuple - sys.exc_info() tuple - """ - self.testResults.append( (test, self.TEST_FAILED, err) ) - - #-------------------------------------------------------------------- - def addSuccess( self, test ): - """Called when a test passes. DO NOT return a value unless you want to - stop other plugins from seeing the passing test. - - Parameters: - test : nose.case.Test - the test case - """ - self.testResults.append( (test, self.TEST_PASSED, None) ) - - #-------------------------------------------------------------------- - def afterContext( self ): - """Called after a context (generally a module) has been lazy-loaded, - imported, setup, had its tests loaded and executed, and torn down. - """ - return None - - #-------------------------------------------------------------------- - def afterDirectory( self, path ): - """Called after all tests have been loaded from directory at path and run. - - Parameters: - path : string - the directory that has finished processing - """ - # Set the current directory to the previous directory - self.currentDir = self.dirStack.pop() - chdir( self.currentDir ) - return None - - #-------------------------------------------------------------------- - def afterImport( self, filename, module ): - """Called after module is imported from filename. afterImport is called - even if the import failed. - - Parameters: - filename : string - The file that was loaded - module : string - The name of the module - """ - return None - - #-------------------------------------------------------------------- - def afterTest( self, test ): - """Called after the test has been run and the result recorded - (after stopTest). - - Parameters: - test : nose.case.Test - the test case - """ - return None - - #-------------------------------------------------------------------- - def beforeContext( self ): - """Called before a context (generally a module) is examined. Since the - context is not yet loaded, plugins don't get to know what the - context is; so any context operations should use a stack that is - pushed in beforeContext and popped in afterContext to ensure they - operate symmetrically. - - beforeContext and afterContext are mainly useful for tracking and - restoring global state around possible changes from within a - context, whatever the context may be. If you need to operate on - contexts themselves, see startContext and stopContext, which are - passed the context in question, but are called after it has been - loaded (imported in the module case). - """ - return None - - #-------------------------------------------------------------------- - def beforeDirectory( self, path ): - """Called before tests are loaded from directory at path. - - Parameters: - path : string - the directory that is about to be processed - """ - # Save the cuurent directory and set to the new directory. - self.dirStack.append( self.currentDir ) - self.currentDir = path - chdir( self.currentDir ) - - # Remove any existing 'saved-results' directory - #NOTE: We must do this after setting 'self.currentDir' - rmdir( self.saveRootDir ) - - return None - - #-------------------------------------------------------------------- - def beforeImport( self, filename, module ): - """Called before module is imported from filename. - - Parameters: - filename : string - The file that will be loaded - module : string - The name of the module found in file - """ - return None - - #-------------------------------------------------------------------- - def beforeTest( self, test ): - """Called before the test is run (before startTest). - - Parameters: - test : nose.case.Test - the test case - """ - return None - - #-------------------------------------------------------------------- - def begin( self ): - """Called before any tests are collected or run. Use this to perform - any setup needed before testing begins. - """ - return None - - #-------------------------------------------------------------------- - def configure( self, options, conf ): - """Called after the command line has been parsed, with the parsed - options and the config container. Here, implement any config - storage or changes to state or operation that are set by command - line options. - - Do not return a value from this method unless you want to stop all - other plugins from being configured. - """ - self.includeTags = [ t for t in options.mpl_process_tags ] - self.skipTags = [ t for t in options.mpl_skip_tags ] - self.keepLevel = options.mpl_keep - - self.currentDir = os.getcwd() - self.dirStack = [] - - self.testResults = [] - - #-------------------------------------------------------------------- - def describeTest( self, test ): - """Return a test description. Called by nose.case.Test.shortDescription. - - Parameters: - test : nose.case.Test - the test case - """ - return None - - #-------------------------------------------------------------------- - def finalize( self, result ): - """Called after all report output, including output from all plugins, - has been sent to the stream. Use this to print final test results - or perform final cleanup. Return None to allow other plugins to - continue printing, any other value to stop them. - - Note - When tests are run under a test runner other than - nose.core.TextTestRunner, for example when tests are run via - 'python setup.py test', this method may be called before the default - report output is sent. - """ - return None - - #-------------------------------------------------------------------- - def formatError( self, test, err ): - """Called in result.addError, before plugin.addError. If you want to - replace or modify the error tuple, return a new error tuple. - - Parameters: - test : nose.case.Test - the test case - err : 3-tuple - sys.exc_info() tuple - """ - return err - - #-------------------------------------------------------------------- - def formatFailure( self, test, err ): - """Called in result.addFailure, before plugin.addFailure. If you want to - replace or modify the error tuple, return a new error tuple. Since - this method is chainable, you must return the test as well, so you - you'll return something like: - return (test, err) - - Parameters: - test : nose.case.Test - the test case - err : 3-tuple - sys.exc_info() tuple - """ - return None - - #-------------------------------------------------------------------- - def handleError( self, test, err ): - """Called on addError. To handle the error yourself and prevent normal - error processing, return a true value. - - Parameters: - test : nose.case.Test - the test case - err : 3-tuple - sys.exc_info() tuple - """ - if (self.keepLevel == self.KEEP_FAIL) or (self.keepLevel == self.KEEP_ALL): - self.saveResults( test ) - - return None - - #-------------------------------------------------------------------- - def handleFailure( self, test, err ): - """Called on addFailure. To handle the failure yourself and prevent - normal failure processing, return a true value. - - Parameters: - test : nose.case.Test - the test case - err : 3-tuple - sys.exc_info() tuple - """ - if (self.keepLevel == self.KEEP_FAIL) or (self.keepLevel == self.KEEP_ALL): - self.saveResults( test ) - - return None - - #-------------------------------------------------------------------- - def loadTestsFromDir( self, path ): - """Return iterable of tests from a directory. May be a generator. - Each item returned must be a runnable unittest.TestCase - (or subclass) instance or suite instance. Return None if your - plugin cannot collect any tests from directory. - - Parameters: - path : string - The path to the directory. - """ - return None - - #-------------------------------------------------------------------- - def loadTestsFromFile( self, filename ): - """Return tests in this file. Return None if you are not interested in - loading any tests, or an iterable if you are and can load some. May - be a generator. If you are interested in loading tests from the file - and encounter no errors, but find no tests, yield False or - return [False]. - - Parameters: - filename : string - The full path to the file or directory. - """ - return None - - #-------------------------------------------------------------------- - def loadTestsFromModule( self, module ): - """Return iterable of tests in a module. May be a generator. Each - item returned must be a runnable unittest.TestCase (or subclass) - instance. Return None if your plugin cannot collect any tests - from module. - - Parameters: - module : python module - The module object - """ - return None - - #-------------------------------------------------------------------- - def loadTestsFromName( self, name, module=None, importPath=None ): - """Return tests in this file or module. Return None if you are not able - to load any tests, or an iterable if you are. May be a generator. - - Parameters: - name : string - The test name. May be a file or module name plus a test - callable. Use split_test_name to split into parts. Or it might - be some crazy name of your own devising, in which case, do - whatever you want. - module : python module - Module from which the name is to be loaded - """ - return None - - #-------------------------------------------------------------------- - def loadTestsFromNames( self, names, module=None ): - """Return a tuple of (tests loaded, remaining names). Return None if you - are not able to load any tests. Multiple plugins may implement - loadTestsFromNames; the remaining name list from each will be passed - to the next as input. - - Parameters: - names : iterable - List of test names. - module : python module - Module from which the names are to be loaded - """ - return None - - #-------------------------------------------------------------------- - def loadTestsFromTestCase( self, cls ): - """Return tests in this test case class. Return None if you are not able - to load any tests, or an iterable if you are. May be a generator. - - Parameters: - cls : class - The test case class. Must be subclass of unittest.TestCase. - """ - return None - - #-------------------------------------------------------------------- - def loadTestsFromTestClass( self, cls ): - """Return tests in this test class. Class will not be a unittest.TestCase - subclass. Return None if you are not able to load any tests, an - iterable if you are. May be a generator. - - Parameters: - cls : class - The test class. Must NOT be subclass of unittest.TestCase. - """ - return None - - #-------------------------------------------------------------------- - def makeTest( self, obj, parent ): - """Given an object and its parent, return or yield one or more test - cases. Each test must be a unittest.TestCase (or subclass) instance. - This is called before default test loading to allow plugins to load - an alternate test case or cases for an object. May be a generator. - - Parameters: - obj : any object - The object to be made into a test - parent : class, module or other object - The parent of obj (eg, for a method, the class) - """ - return None - - #-------------------------------------------------------------------- - def options( self, parser, env = os.environ ): - """Called to allow plugin to register command line options with the parser. - - Do not return a value from this method unless you want to stop all other - plugins from setting their options. - - NOTE: By default, parser is a Python optparse.OptionParser instance. - """ - helpMsg = "The following are options specific to the matplotlib test harness" - group = optparse.OptionGroup( parser, "Matplotlib Options", helpMsg ) - - # Options to handle tags - helpMsg = "Will only run test cases that have the specified tag. Each " - helpMsg += "test case should have a 'tag' attribute (if a case does not h" - helpMsg += "ave one, then it is assumed to be an empty list). The 'tag' " - helpMsg += "attribute is a list of strings, where each value is a " - helpMsg += "representative propery of the test case. Example tags are " - helpMsg += "'qt' or 'units'. This can be specified multiple times." - group.add_option( '-t', '--with-tag', - action = 'append', type = 'string', dest = 'mpl_process_tags', - default = [], metavar = 'TAG', help = helpMsg ) - - helpMsg = "This will run those test cases that do not have the specified tags." - group.add_option( '--without-tag', - action = 'append', type = 'string', dest = 'mpl_skip_tags', - default = [], metavar = 'TAG', help = helpMsg ) - - - # Some Miscellaneous options - helpMsg = "This will remove all output files, saved results, and .pyc files. " - helpMsg += "If this is specified, no other processing will be performed." - group.add_option( '--clean', - action = "store_true", dest = "mpl_clean", - default = False, help = helpMsg ) - - helpMsg = "This will run all test programs regardless of working directory." - group.add_option( '--all', - action = "store_true", dest = "mpl_all", - default = False, help = helpMsg ) - - - # Options to handle generated data files - helpMsg = "Keep any generated output files in a directory called " - helpMsg += "'saved-results'. This directory will be created if it " - helpMsg += "doesn't already exist. This directory is in the same " - helpMsg += "location as the test case whose results are being saved." - group.add_option( '--keep', - action = "store_const", dest = "mpl_keep", - default = self.KEEP_NONE, const = self.KEEP_ALL, help = helpMsg ) - - helpMsg = "This acts just like '--keep' except will only keeps the results " - helpMsg += "from tests that error or fail." - group.add_option( '--keep-failed', - action = "store_const", dest = "mpl_keep", - default = self.KEEP_NONE, const = self.KEEP_FAIL, help = helpMsg ) - - - # Options to create a test case file - helpMsg = "Creates a template test case file in the current directory " - helpMsg += "with the name TestFoo. Where 'Foo' is the provided test name." - group.add_option( '--make-test', - action = 'store', dest = 'mpl_make_test', - default = False, metavar = 'testName', help = helpMsg ) - - - parser.add_option_group( group ) - - #-------------------------------------------------------------------- - def prepareTest( self, test ): - """Called before the test is run by the test runner. Please note the - article the in the previous sentence: prepareTest is called only once, - and is passed the test case or test suite that the test runner will - execute. It is not called for each individual test case. If you return - a non-None value, that return value will be run as the test. Use this - hook to wrap or decorate the test with another function. If you need - to modify or wrap individual test cases, use prepareTestCase instead. - - Parameters: - test : nose.case.Test - the test case - """ - return None - - #-------------------------------------------------------------------- - def prepareTestCase( self, test ): - """Prepare or wrap an individual test case. Called before execution of - the test. The test passed here is a nose.case.Test instance; the case - to be executed is in the test attribute of the passed case. To modify - the test to be run, you should return a callable that takes one - argument (the test result object) -- it is recommended that you do not - side-effect the nose.case.Test instance you have been passed. - - Keep in mind that when you replace the test callable you are replacing - the run() method of the test case -- including the exception handling - and result calls, etc. - - Parameters: - test : nose.case.Test - the test case - """ - # Save the dir names in the test class instance to make it available - # to the individual test cases. - t = getInstance( test ) - t.inputDir = self.inputDir - t.outputDir = self.outputDir - t.baselineDir = self.getBaselineDir( test ) - t.workingDir = self.currentDir - - return None - - #-------------------------------------------------------------------- - def prepareTestLoader( self, loader ): - """Called before tests are loaded. To replace the test loader, return a - test loader. To allow other plugins to process the test loader, - return None. Only one plugin may replace the test loader. Only valid - when using nose.TestProgram. - - Parameters: - loader : nose.loader.TestLoader or other loader instance - the test loader - """ - return None - - #-------------------------------------------------------------------- - def prepareTestResult( self, result ): - """Called before the first test is run. To use a different test result - handler for all tests than the given result, return a test result - handler. NOTE however that this handler will only be seen by tests, - that is, inside of the result proxy system. The TestRunner and - TestProgram -- whether nose's or other -- will continue to see the - original result handler. For this reason, it is usually better to - monkeypatch the result (for instance, if you want to handle some - exceptions in a unique way). Only one plugin may replace the result, - but many may monkeypatch it. If you want to monkeypatch and stop - other plugins from doing so, monkeypatch and return the patched result. - - Parameters: - result : nose.result.TextTestResult or other result instance - the test result - """ - return None - - #-------------------------------------------------------------------- - def prepareTestRunner( self, runner ): - """Called before tests are run. To replace the test runner, return a - test runner. To allow other plugins to process the test runner, - return None. Only valid when using nose.TestProgram. - - Parameters: - runner : nose.core.TextTestRunner or other runner instance - the test runner - """ - return None - - #-------------------------------------------------------------------- - def report( self, stream ): - """Called after all error output has been printed. Print your plugin's - report to the provided stream. Return None to allow other plugins to - print reports, any other value to stop them. - - Parameters: - stream : file-like object - stream object; send your output here - """ - return None - - #-------------------------------------------------------------------- - def setOutputStream( self, stream ): - """Called before test output begins. To direct test output to a new - stream, return a stream object, which must implement a write(msg) - method. If you only want to note the stream, not capture or redirect - it, then return None. - - Parameters: - stream : file-like object - the original output stream - """ - return None - - #-------------------------------------------------------------------- - def startContext( self, context ): - """Called before context setup and the running of tests in the context. - Note that tests have already been loaded from the context before this call. - - Parameters: - context : module, class or other object - the context about to be setup. May be a module or class, or - any other object that contains tests. - """ - return None - - #-------------------------------------------------------------------- - def startTest( self, test ): - """Called before each test is run. DO NOT return a value unless you want - to stop other plugins from seeing the test start. - - Parameters: - test : nose.case.Test - the test case - """ - # make sure there is a fresh output directory to use. - rmdir( self.outputDir ) - mkdir( self.outputDir, recursive = True ) - - #-------------------------------------------------------------------- - def stopContext( self, context ): - """Called after the tests in a context have run and the context has been - torn down. - - Parameters: - context : module, class or other object - the context that has just been torn down. - """ - return None - - #-------------------------------------------------------------------- - def stopTest( self, test ): - """Called after each test is run. DO NOT return a value unless you want - to stop other plugins from seeing that the test has stopped. - - Parameters: - test : nose.case.Test - the test case - """ - assert test == self.testResults[-1][0] - - if self.keepLevel == self.KEEP_ALL: - self.saveResults( test ) - - # KEEP_FAIL is handled by the 'handleError' and 'handleFailed' methods. - - rmdir( self.outputDir ) - - #-------------------------------------------------------------------- - def testName( self, test ): - """Return a short test name. Called by nose.case.Test.__str__. - - Parameters: - test : nose.case.Test - the test case - """ - return None - - #-------------------------------------------------------------------- - def wantClass( self, cls ): - """Return true if you want the main test selector to collect tests from - this class, false if you don't, and None if you don't care. - - Parameters: - cls : class - The class being examined by the selector - """ - # Filter out classes that do not inherit from MplTestCase - if not issubclass( cls, MplTestCase ): - return False - - return self.filterTestItem( cls ) - - #-------------------------------------------------------------------- - def wantDirectory( self, dirname ): - """Return true if you want test collection to descend into this - directory, false if you do not, and None if you don't care. - - Parameters: - dirname : string - Full path to directory being examined by the selector - """ - # Skip the unit-test utility module. - if dirname == os.path.join( self.rootDir, 'mplTest' ): - return False - - return None - - #-------------------------------------------------------------------- - def wantFile( self, file ): - """Return true if you want to collect tests from this file, false if - you do not and None if you don't care. - - Parameters: - file : string - Full path to file being examined by the selector - """ - # Skip anything not under the root test directory - if self.rootDir not in file: - return False - - return None - - #-------------------------------------------------------------------- - def wantFunction( self, function ): - """Return true to collect this function as a test, false to prevent it - from being collected, and None if you don't care. - - Parameters: - function : function - The function object being examined by the selector - """ - #TODO: Filter out functions that exist outside of the test-structure - name = function.__name__.lower() - if "disabled" in name: return False - return self.filterTestItem( function ) - - #-------------------------------------------------------------------- - def wantMethod( self, method ): - """Return true to collect this method as a test, false to prevent it - from being collected, and None if you don't care. - - Parameters: - method : unbound method - The method object being examined by the selector - """ - #TODO: Filter out methods that exist outside of the test-structure - name = method.__name__.lower() - if "disabled" in name: return False - return self.filterTestItem( method ) - - #-------------------------------------------------------------------- - def wantModule( self, module ): - """Return true if you want to collection to descend into this module, - false to prevent the collector from descending into the module, and - None if you don't care. - - Parameters: - module : python module - The module object being examined by the selector - """ - #TODO: Filter out modules that exist outside of the test-structure - name = module.__name__.lower() - if "disabled" in name: return False - return self.filterTestItem( module ) - - Deleted: trunk/matplotlib/test/mplTest/MplTestCase.py =================================================================== --- trunk/matplotlib/test/mplTest/MplTestCase.py 2009年09月07日 20:05:54 UTC (rev 7697) +++ trunk/matplotlib/test/mplTest/MplTestCase.py 2009年09月07日 20:06:06 UTC (rev 7698) @@ -1,117 +0,0 @@ -#======================================================================= -"""Defines the base matplotlib test-case.""" -#======================================================================= - -import os -import os.path -import unittest - -import matplotlib.testing.compare as compare -import path_utils - -#======================================================================= - -__all__ = [ 'MplTestCase' ] - -#======================================================================= -class MplTestCase( unittest.TestCase ): - """This is the base class for the matplotlib unit-tests. - - It provides a few utility functions for accessing managed directories: - - inputs - All input files for the test case are stored here. - - outputs - All output files for the test case are written here. - - baseline - All baseline files (those used for verifying results) for - athe test case are stored here. - """ - #-------------------------------------------------------------------- - def inFile( self, fname ): - """Returns the pathname of the specified input file.""" - return os.path.join( self.inputDir, fname ) - - def outFile( self, fname ): - """Returns the pathname of the specified output file.""" - return os.path.join( self.outputDir, fname ) - - def baseFile( self, fname ): - """Returns the pathname of the specified basline file.""" - return os.path.join( self.baselineDir, fname ) - - #-------------------------------------------------------------------- - def checkImage( self, outfname, tol = 1.0e-3, msg = "" ): - """Check to see if the image is similair to one stored in the - baseline directory. - """ - if self.outputDir in outfname: - # We are passed the path name and just want the file name. - actualImage = outfname - basename = path_utils.name( outfname ) - else: - basename = outfname - actualImage = self.outFile( basename ) - - baselineImage = self.baseFile( basename ) - - errorMessage = compare.compare_images( baselineImage, actualImage, tol ) - - if errorMessage: - self.fail( msg + "\n" + errorMessage ) - - #-------------------------------------------------------------------- - def checkEq( expected, actual, msg = "" ): - """Fail if the values are not equal, with the given message.""" - if not expected == actual: - expectedStr = str( expected ) - actualStr = str( actual ) - isMultiLine = ( "\n" in expectedStr or "\n" in actualStr or - len( expectedStr ) > 70 or len( actualStr ) > 70 ) - - if isMultiLine: - if msg: - msg += "\n\n" - msg += "Expected:\n" - msg += expectedStr + "\n\n" - msg += "Actual:\n" - msg += actualStr + "\n" - else: - if msg: - msg += "\n" - msg += " Expected: " + expectedStr + "\n" - msg += " Actual: " + actualStr + "\n" - - self.fail( msg ) - - #-------------------------------------------------------------------- - def checkNeq( expected, actual, msg = "" ): - """Fail is the values are equal, with the given message.""" - if expected == actual: - expectedStr = str( expected ) - isMultiLine = ( "\n" in expectedStr or len( expectedStr ) > 55 ) - - if isMultiLine: - if msg: - msg += "\n\n" - msg += "Expected and actual should not be equal.\n" - msg += "Expected and actual:\n" - msg += expectedStr + "\n" - else: - if msg: - msg += "\n" - msg += " Expected and actual should not be equal.\n" - msg += " Expected and actual: " + expectedStr + "\n" - - self.fail( msg ) - - #-------------------------------------------------------------------- - def checkClose( expected, actual, relTol = None, absTol = None, msg = "" ): - """Fail if the floating point values are not close enough, with - the givem message. - - You can specify a relative tolerance, absolute tolerance, or both. - """ - errorMessage = compare.compare_float( expected, actual, relTol, absTol ) - - if errorMessage: - self.fail( msg + "\n" + errorMessage ) - - #-------------------------------------------------------------------- - Deleted: trunk/matplotlib/test/mplTest/__init__.py =================================================================== --- trunk/matplotlib/test/mplTest/__init__.py 2009年09月07日 20:05:54 UTC (rev 7697) +++ trunk/matplotlib/test/mplTest/__init__.py 2009年09月07日 20:06:06 UTC (rev 7698) @@ -1,13 +0,0 @@ - -""" -A matplotlib unit test module. This module provides several utilities for -performing unit-tests on matplotlib. Theis module depends on a properly -installed version of 'nose'. -""" - -from directories import * - -from mplTest.MplNosePlugin import MplNosePlugin -from mplTest.MplTestCase import MplTestCase - -import matplotlib.testing.jpl_units as units Deleted: trunk/matplotlib/test/mplTest/directories.py =================================================================== --- trunk/matplotlib/test/mplTest/directories.py 2009年09月07日 20:05:54 UTC (rev 7697) +++ trunk/matplotlib/test/mplTest/directories.py 2009年09月07日 20:06:06 UTC (rev 7698) @@ -1,16 +0,0 @@ -#======================================================================= -"""Default directories for the matplotlib unit-test structure.""" -#======================================================================= - -import os.path - -#======================================================================= -saveDirName = "saved-results" -inputDirName = "inputs" -outputDirName = "outputs" -baselineDirName = "baseline" - -#----------------------------------------------------------------------- -def baselineFile( fname ): - return os.path.join( baselineDirName, fname ) - Deleted: trunk/matplotlib/test/mplTest/path_utils.py =================================================================== --- trunk/matplotlib/test/mplTest/path_utils.py 2009年09月07日 20:05:54 UTC (rev 7697) +++ trunk/matplotlib/test/mplTest/path_utils.py 2009年09月07日 20:06:06 UTC (rev 7698) @@ -1,81 +0,0 @@ -#======================================================================= -""" A set of utilities for manipulating path information. -""" -#======================================================================= - -import os -import shutil -import os.path - -#======================================================================= - -__all__ = [ - 'chdir', - 'exists', - 'extension', - 'joinPath', - 'mkdir', - 'name', - 'rm', - 'rmdir', - 'walk', - ] - -#----------------------------------------------------------------------- -def chdir( path ): - """Change the current working directory to the specified directory.""" - os.chdir( path ) - -#----------------------------------------------------------------------- -def exists( path ): - """Returns true if the specified path exists.""" - return os.path.exists( path ) - -#----------------------------------------------------------------------- -def extension( path ): - """Returns the extension name of a filename.""" - unused, ext = os.path.splitext( path ) - return ext - -#----------------------------------------------------------------------- -def joinPath( *args ): - """Returns true if the specified path exists.""" - return os.path.join( *args ) - -#----------------------------------------------------------------------- -def mkdir( path, mode = 0777, recursive = False ): - """Create the specified directory.""" - if recursive: - os.makedirs( path, mode ) - else: - os.mkdir( path, mode ) - -#----------------------------------------------------------------------- -def name( path ): - """Returns the name portion of a specified path.""" - return os.path.basename( path ) - -#----------------------------------------------------------------------- -def rm( path ): - """Remove the specified file.""" - os.remove( path ) - -#----------------------------------------------------------------------- -def rmdir( path ): - """Remove the specified directory.""" - shutil.rmtree( path, ignore_errors = True ) - -#----------------------------------------------------------------------- -def walk( path ): - """Recursively iterate over files and sub-directories.""" - children = os.listdir( path ) - children = [ os.path.join( path, child ) for child in children ] - - for child in children: - yield child - - if os.path.isdir( child ): - for grandchild in walk( child ): - yield grandchild - - Modified: trunk/matplotlib/test/run-mpl-test.py =================================================================== --- trunk/matplotlib/test/run-mpl-test.py 2009年09月07日 20:05:54 UTC (rev 7697) +++ trunk/matplotlib/test/run-mpl-test.py 2009年09月07日 20:06:06 UTC (rev 7698) @@ -44,26 +44,9 @@ import nose import nose.plugins.builtin -from mplTest import MplNosePlugin, path_utils import matplotlib from matplotlib.testing.noseclasses import KnownFailure -if '--clean' in args: - # perform the cleaning process and exit - for filename in path_utils.walk( working ): - ext = path_utils.extension( filename ) - if ext == '.cover': - print "Cleaning coverage file: %s" % (filename) - path_utils.rm( filename ) - elif ext == '.pyc': - print "Cleaning bytecode file: %s" % (filename) - path_utils.rm( filename ) - elif path_utils.name( filename ) == 'saved-results': - print "Cleaning directory: %s" % (filename) - path_utils.rmdir( filename ) - - sys.exit( 0 ) - for arg in args: # We need to do this here, because we do not actually want nose to start. if arg.startswith( '--make-test=' ): @@ -96,7 +79,7 @@ args.extend( matplotlib.default_test_modules ) plugins = [plugin() for plugin in nose.plugins.builtin.plugins] -plugins.extend( [ MplNosePlugin(), KnownFailure() ]) +plugins.extend( [ KnownFailure() ]) success = nose.run( argv = args, plugins = plugins, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7697 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7697&view=rev Author: astraw Date: 2009年09月07日 20:05:54 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/test_cbook.py Removed Paths: ------------- trunk/matplotlib/test/test_matplotlib/TestCookbook.py Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2009年09月07日 20:05:42 UTC (rev 7696) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2009年09月07日 20:05:54 UTC (rev 7697) @@ -879,6 +879,7 @@ default_test_modules = [ 'matplotlib.tests.test_agg', 'matplotlib.tests.test_basic', + 'matplotlib.tests.test_cbook', 'matplotlib.tests.test_transforms', 'matplotlib.tests.test_axes', 'matplotlib.tests.test_dates', Added: trunk/matplotlib/lib/matplotlib/tests/test_cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_cbook.py (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/test_cbook.py 2009年09月07日 20:05:54 UTC (rev 7697) @@ -0,0 +1,14 @@ +import numpy as np +import matplotlib.cbook as cbook +from nose.tools import assert_equal + +def test_is_string_like(): + y = np.arange( 10 ) + assert_equal( cbook.is_string_like( y ), False ) + y.shape = 10, 1 + assert_equal( cbook.is_string_like( y ), False ) + y.shape = 1, 10 + assert_equal( cbook.is_string_like( y ), False ) + + assert cbook.is_string_like( "hello world" ) + assert_equal( cbook.is_string_like(10), False ) Deleted: trunk/matplotlib/test/test_matplotlib/TestCookbook.py =================================================================== --- trunk/matplotlib/test/test_matplotlib/TestCookbook.py 2009年09月07日 20:05:42 UTC (rev 7696) +++ trunk/matplotlib/test/test_matplotlib/TestCookbook.py 2009年09月07日 20:05:54 UTC (rev 7697) @@ -1,59 +0,0 @@ -#======================================================================= -"""The Cookbook unit-test class implementation.""" -#======================================================================= - -from mplTest import * - -#======================================================================= -# Add import modules below. -import matplotlib -matplotlib.use( "Agg", warn = False ) - -import numpy as npy -import matplotlib.cbook as cbook -# -#======================================================================= - -#======================================================================= -class TestCookbook( MplTestCase ): - """Cookbook unit test class.""" - - # Uncomment any appropriate tags - tags = [ - # 'gui', # requires the creation of a gui window - # 'agg', # uses agg in the backend - # 'agg-only', # uses only agg in the backend - # 'wx', # uses wx in the backend - # 'qt', # uses qt in the backend - # 'ps', # uses the postscript backend - # 'units', # uses units in the test - # 'PIL', # uses PIL for image comparison - ] - - #-------------------------------------------------------------------- - def setUp( self ): - """Setup any data needed for the unit test.""" - pass - - #-------------------------------------------------------------------- - def tearDown( self ): - """Clean-up any generated files here.""" - pass - - #-------------------------------------------------------------------- - def test_is_string_like( self ): - """Test the 'is_string_like cookbook' function.""" - y = npy.arange( 10 ) - self.failUnless( cbook.is_string_like( y ) == False ) - y.shape = 10, 1 - self.failUnless( cbook.is_string_like( y ) == False ) - y.shape = 1, 10 - self.failUnless( cbook.is_string_like( y ) == False ) - - - self.failUnless( cbook.is_string_like( "hello world" ) ) - self.failUnless( cbook.is_string_like(10) == False ) - - #-------------------------------------------------------------------- - #TODO: More cookbook tests - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7696 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7696&view=rev Author: astraw Date: 2009年09月07日 20:05:42 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/test_agg.py Removed Paths: ------------- trunk/matplotlib/test/test_backends/TestAgg.py Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2009年09月07日 20:05:29 UTC (rev 7695) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2009年09月07日 20:05:42 UTC (rev 7696) @@ -877,6 +877,7 @@ # we don't want to assume all -d flags are backends, eg -debug default_test_modules = [ + 'matplotlib.tests.test_agg', 'matplotlib.tests.test_basic', 'matplotlib.tests.test_transforms', 'matplotlib.tests.test_axes', Added: trunk/matplotlib/lib/matplotlib/tests/test_agg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_agg.py (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/test_agg.py 2009年09月07日 20:05:42 UTC (rev 7696) @@ -0,0 +1,64 @@ +import os + +def report_memory(i): + pid = os.getpid() + a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() + print i, ' ', a2[1], + return int(a2[1].split()[0]) + +# This test is disabled -- it uses old API. -ADS 2009年09月07日 +## def test_memleak(): +## """Test agg backend for memory leaks.""" +## from matplotlib.ft2font import FT2Font +## from numpy.random import rand +## from matplotlib.backend_bases import GraphicsContextBase +## from matplotlib.backends._backend_agg import RendererAgg + +## fontname = '/usr/local/share/matplotlib/Vera.ttf' + +## N = 200 +## for i in range( N ): +## gc = GraphicsContextBase() +## gc.set_clip_rectangle( [20, 20, 20, 20] ) +## o = RendererAgg( 400, 400, 72 ) + +## for j in range( 50 ): +## xs = [ 400*int(rand()) for k in range(8) ] +## ys = [ 400*int(rand()) for k in range(8) ] +## rgb = (1, 0, 0) +## pnts = zip( xs, ys ) +## o.draw_polygon( gc, rgb, pnts ) +## o.draw_polygon( gc, None, pnts ) + +## for j in range( 50 ): +## x = [ 400*int(rand()) for k in range(4) ] +## y = [ 400*int(rand()) for k in range(4) ] +## o.draw_lines( gc, x, y ) + +## for j in range( 50 ): +## args = [ 400*int(rand()) for k in range(4) ] +## rgb = (1, 0, 0) +## o.draw_rectangle( gc, rgb, *args ) + +## if 1: # add text +## font = FT2Font( fontname ) +## font.clear() +## font.set_text( 'hi mom', 60 ) +## font.set_size( 12, 72 ) +## o.draw_text_image( font.get_image(), 30, 40, gc ) + +## fname = "agg_memleak_%05d.png" +## o.write_png( fname % i ) +## val = report_memory( i ) +## if i==1: start = val + +## end = val +## avgMem = (end - start) / float(N) +## print 'Average memory consumed per loop: %1.4f\n' % (avgMem) + +## #TODO: Verify the expected mem usage and approximate tolerance that should be used +## #self.checkClose( 0.32, avgMem, absTol = 0.1 ) + +## # w/o text and w/o write_png: Average memory consumed per loop: 0.02 +## # w/o text and w/ write_png : Average memory consumed per loop: 0.3400 +## # w/ text and w/ write_png : Average memory consumed per loop: 0.32 Deleted: trunk/matplotlib/test/test_backends/TestAgg.py =================================================================== --- trunk/matplotlib/test/test_backends/TestAgg.py 2009年09月07日 20:05:29 UTC (rev 7695) +++ trunk/matplotlib/test/test_backends/TestAgg.py 2009年09月07日 20:05:42 UTC (rev 7696) @@ -1,106 +0,0 @@ -#======================================================================= -"""The Agg backend unit-test class implementation.""" -#======================================================================= - -from mplTest import * - -#======================================================================= -# Add import modules below. -# import matplotlib -# matplotlib.use( "Agg", warn = False ) - -import sys, time, os -from matplotlib.ft2font import FT2Font -from numpy.random import rand -from matplotlib.backend_bases import GraphicsContextBase -from matplotlib.backends._backend_agg import RendererAgg - -# -#======================================================================= - -#======================================================================= -def report_memory(i): - pid = os.getpid() - a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() - print i, ' ', a2[1], - return int(a2[1].split()[0]) - -#======================================================================= -class TestAgg( MplTestCase ): - """Agg backend unit test class.""" - - # Uncomment any appropriate tags - tags = [ - # 'gui', # requires the creation of a gui window - 'agg', # uses agg in the backend - 'agg-only', # uses only agg in the backend - # 'wx', # uses wx in the backend - # 'qt', # uses qt in the backend - # 'ps', # uses the postscript backend - # 'units', # uses units in the test - # 'PIL', # uses PIL for image comparison - ] - - #-------------------------------------------------------------------- - def setUp( self ): - """Setup any data needed for the unit test.""" - pass - - #-------------------------------------------------------------------- - def tearDown( self ): - """Clean-up any generated files here.""" - pass - - #-------------------------------------------------------------------- - def DISABLED_memleak( self ): - """Test agg backend for memory leaks.""" - - fontname = '/usr/local/share/matplotlib/Vera.ttf' - fname = self.outFile( "agg_memleak_%05d.png" ) - - N = 200 - for i in range( N ): - gc = GraphicsContextBase() - gc.set_clip_rectangle( [20, 20, 20, 20] ) - o = RendererAgg( 400, 400, 72 ) - - for j in range( 50 ): - xs = [ 400*int(rand()) for k in range(8) ] - ys = [ 400*int(rand()) for k in range(8) ] - rgb = (1, 0, 0) - pnts = zip( xs, ys ) - o.draw_polygon( gc, rgb, pnts ) - o.draw_polygon( gc, None, pnts ) - - for j in range( 50 ): - x = [ 400*int(rand()) for k in range(4) ] - y = [ 400*int(rand()) for k in range(4) ] - o.draw_lines( gc, x, y ) - - for j in range( 50 ): - args = [ 400*int(rand()) for k in range(4) ] - rgb = (1, 0, 0) - o.draw_rectangle( gc, rgb, *args ) - - if 1: # add text - font = FT2Font( fontname ) - font.clear() - font.set_text( 'hi mom', 60 ) - font.set_size( 12, 72 ) - o.draw_text_image( font.get_image(), 30, 40, gc ) - - - o.write_png( fname % i ) - val = report_memory( i ) - if i==1: start = val - - end = val - avgMem = (end - start) / float(N) - print 'Average memory consumed per loop: %1.4f\n' % (avgMem) - - #TODO: Verify the expected mem usage and approximate tolerance that should be used - self.checkClose( 0.32, avgMem, absTol = 0.1 ) - - # w/o text and w/o write_png: Average memory consumed per loop: 0.02 - # w/o text and w/ write_png : Average memory consumed per loop: 0.3400 - # w/ text and w/ write_png : Average memory consumed per loop: 0.32 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7695 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7695&view=rev Author: astraw Date: 2009年09月07日 20:05:29 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/TestSpan.py trunk/matplotlib/test/test_plots/baseline/TestSpan/axhspan_epoch.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.png (from rev 7694, trunk/matplotlib/test/test_plots/baseline/TestSpan/axhspan_epoch.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:05:12 UTC (rev 7694) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:05:29 UTC (rev 7695) @@ -334,3 +334,25 @@ ax.set_xlim( t0 - 5.0*dt, tf + 5.0*dt ) fig.savefig( 'axvspan_epoch' ) + +@image_comparison(baseline_images=['axhspan_epoch']) +def test_axhspan_epoch(): + """Test the axhspan method with Epochs.""" + from datetime import datetime + import matplotlib.testing.jpl_units as units + units.register() + + # generate some data + t0 = units.Epoch( "ET", dt=datetime(2009, 1, 20) ) + tf = units.Epoch( "ET", dt=datetime(2009, 1, 21) ) + + dt = units.Duration( "ET", units.day.convert( "sec" ) ) + + fig = pylab.figure() + + pylab.axhspan( t0, tf, facecolor="blue", alpha=0.25 ) + + ax = pylab.gca() + ax.set_ylim( t0 - 5.0*dt, tf + 5.0*dt ) + + fig.savefig( 'axhspan_epoch' ) Deleted: trunk/matplotlib/test/test_plots/TestSpan.py =================================================================== --- trunk/matplotlib/test/test_plots/TestSpan.py 2009年09月07日 20:05:12 UTC (rev 7694) +++ trunk/matplotlib/test/test_plots/TestSpan.py 2009年09月07日 20:05:29 UTC (rev 7695) @@ -1,64 +0,0 @@ -#======================================================================= -"""The Span unit-test class implementation.""" -#======================================================================= - -from mplTest import * - -#======================================================================= -# Add import modules below. -import matplotlib -matplotlib.use( "Agg", warn = False ) - -import pylab -import numpy as npy -from datetime import datetime -# -#======================================================================= - -#======================================================================= -class TestSpan( MplTestCase ): - """Test the various axes spanning methods.""" - - # Uncomment any appropriate tags - tags = [ - # 'gui', # requires the creation of a gui window - 'agg', # uses agg in the backend - 'agg-only', # uses only agg in the backend - # 'wx', # uses wx in the backend - # 'qt', # uses qt in the backend - # 'ps', # uses the postscript backend - # 'units', # uses units in the test - 'PIL', # uses PIL for image comparison - ] - - #-------------------------------------------------------------------- - def setUp( self ): - """Setup any data needed for the unit test.""" - units.register() - - #-------------------------------------------------------------------- - def tearDown( self ): - """Clean-up any generated files here.""" - pass - - #-------------------------------------------------------------------- - def test_axhspan_epoch( self ): - """Test the axhspan method with Epochs.""" - - fname = self.outFile( "axhspan_epoch.png" ) - - # generate some data - t0 = units.Epoch( "ET", dt=datetime(2009, 1, 20) ) - tf = units.Epoch( "ET", dt=datetime(2009, 1, 21) ) - - dt = units.Duration( "ET", units.day.convert( "sec" ) ) - - fig = pylab.figure() - - pylab.axhspan( t0, tf, facecolor="blue", alpha=0.25 ) - - ax = pylab.gca() - ax.set_ylim( t0 - 5.0*dt, tf + 5.0*dt ) - - fig.savefig( fname ) - self.checkImage( fname ) Deleted: trunk/matplotlib/test/test_plots/baseline/TestSpan/axhspan_epoch.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7694 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7694&view=rev Author: astraw Date: 2009年09月07日 20:05:12 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py trunk/matplotlib/test/test_plots/TestSpan.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/baseline/TestSpan/axvspan_epoch.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.png (from rev 7693, trunk/matplotlib/test/test_plots/baseline/TestSpan/axvspan_epoch.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:04:56 UTC (rev 7693) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:05:12 UTC (rev 7694) @@ -312,3 +312,25 @@ # polar( x2, y2, color = "green" ) fig.savefig( 'polar_units' ) + +@image_comparison(baseline_images=['axvspan_epoch']) +def test_axvspan_epoch(): + """Test the axvspan method with Epochs.""" + from datetime import datetime + import matplotlib.testing.jpl_units as units + units.register() + + # generate some data + t0 = units.Epoch( "ET", dt=datetime(2009, 1, 20) ) + tf = units.Epoch( "ET", dt=datetime(2009, 1, 21) ) + + dt = units.Duration( "ET", units.day.convert( "sec" ) ) + + fig = pylab.figure() + + pylab.axvspan( t0, tf, facecolor="blue", alpha=0.25 ) + + ax = pylab.gca() + ax.set_xlim( t0 - 5.0*dt, tf + 5.0*dt ) + + fig.savefig( 'axvspan_epoch' ) Modified: trunk/matplotlib/test/test_plots/TestSpan.py =================================================================== --- trunk/matplotlib/test/test_plots/TestSpan.py 2009年09月07日 20:04:56 UTC (rev 7693) +++ trunk/matplotlib/test/test_plots/TestSpan.py 2009年09月07日 20:05:12 UTC (rev 7694) @@ -42,28 +42,6 @@ pass #-------------------------------------------------------------------- - def test_axvspan_epoch( self ): - """Test the axvspan method with Epochs.""" - - fname = self.outFile( "axvspan_epoch.png" ) - - # generate some data - t0 = units.Epoch( "ET", dt=datetime(2009, 1, 20) ) - tf = units.Epoch( "ET", dt=datetime(2009, 1, 21) ) - - dt = units.Duration( "ET", units.day.convert( "sec" ) ) - - fig = pylab.figure() - - pylab.axvspan( t0, tf, facecolor="blue", alpha=0.25 ) - - ax = pylab.gca() - ax.set_xlim( t0 - 5.0*dt, tf + 5.0*dt ) - - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- def test_axhspan_epoch( self ): """Test the axhspan method with Epochs.""" Deleted: trunk/matplotlib/test/test_plots/baseline/TestSpan/axvspan_epoch.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7693 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7693&view=rev Author: astraw Date: 2009年09月07日 20:04:56 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_units.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/TestPolar.py trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_units.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_units.png (from rev 7692, trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_units.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:04:38 UTC (rev 7692) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:04:56 UTC (rev 7693) @@ -288,3 +288,27 @@ pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) fig.savefig( 'polar_wrap_360' ) + +@image_comparison(baseline_images=['polar_units']) +def test_polar_units(): + """Test polar plots with unitized data.""" + import matplotlib.testing.jpl_units as units + units.register() + + pi = np.pi + deg = units.UnitDbl( 1.0, "deg" ) + + x1 = [ pi/6.0, pi/4.0, pi/3.0, pi/2.0 ] + x2 = [ 30.0*deg, 45.0*deg, 60.0*deg, 90.0*deg ] + + y1 = [ 1.0, 2.0, 3.0, 4.0] + y2 = [ 4.0, 3.0, 2.0, 1.0 ] + + fig = pylab.figure() + + pylab.polar( x2, y1, color = "blue" ) + + # polar( x2, y1, color = "red", xunits="rad" ) + # polar( x2, y2, color = "green" ) + + fig.savefig( 'polar_units' ) Deleted: trunk/matplotlib/test/test_plots/TestPolar.py =================================================================== --- trunk/matplotlib/test/test_plots/TestPolar.py 2009年09月07日 20:04:38 UTC (rev 7692) +++ trunk/matplotlib/test/test_plots/TestPolar.py 2009年09月07日 20:04:56 UTC (rev 7693) @@ -1,67 +0,0 @@ -#======================================================================= -"""The Polar unit-test class implementation.""" -#======================================================================= - -from mplTest import * - -#======================================================================= -# Add import modules below. -import matplotlib -matplotlib.use( "Agg", warn = False ) - -import pylab -import numpy as npy -# -#======================================================================= - -#======================================================================= -class TestPolar( MplTestCase ): - """Polar unit test class.""" - - # Uncomment any appropriate tags - tags = [ - # 'gui', # requires the creation of a gui window - 'agg', # uses agg in the backend - 'agg-only', # uses only agg in the backend - # 'wx', # uses wx in the backend - # 'qt', # uses qt in the backend - # 'ps', # uses the postscript backend - # 'units', # uses units in the test - 'PIL', # uses PIL for image comparison - ] - - #-------------------------------------------------------------------- - def setUp( self ): - """Setup any data needed for the unit test.""" - units.register() - - #-------------------------------------------------------------------- - def tearDown( self ): - """Clean-up any generated files here.""" - pass - - #-------------------------------------------------------------------- - def test_polar_units( self ): - """Test polar plots with unitized data.""" - - fname = self.outFile( "polar_units.png" ) - - pi = npy.pi - deg = units.UnitDbl( 1.0, "deg" ) - - x1 = [ pi/6.0, pi/4.0, pi/3.0, pi/2.0 ] - x2 = [ 30.0*deg, 45.0*deg, 60.0*deg, 90.0*deg ] - - y1 = [ 1.0, 2.0, 3.0, 4.0] - y2 = [ 4.0, 3.0, 2.0, 1.0 ] - - fig = pylab.figure() - - pylab.polar( x2, y1, color = "blue" ) - - # polar( x2, y1, color = "red", xunits="rad" ) - # polar( x2, y2, color = "green" ) - - fig.savefig( fname ) - self.checkImage( fname ) - Deleted: trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_units.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7692 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7692&view=rev Author: astraw Date: 2009年09月07日 20:04:38 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py trunk/matplotlib/test/test_plots/TestPolar.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_180.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_360.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_180.png trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_360.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_180.png (from rev 7691, trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_180.png) =================================================================== (Binary files differ) Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_360.png (from rev 7691, trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_360.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:04:20 UTC (rev 7691) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:04:38 UTC (rev 7692) @@ -259,3 +259,32 @@ pylab.plot( np.ones( (10,) ), np.ones( (10,) ), 'o' ) fig.savefig( 'const_xy' ) + +@image_comparison(baseline_images=['polar_wrap_180', + 'polar_wrap_360', + ]) +def test_polar_wrap(): + """Test polar plots where data crosses 0 degrees.""" + + D2R = np.pi / 180.0 + + fig = pylab.figure() + + #NOTE: resolution=1 really should be the default + pylab.subplot( 111, polar=True, resolution=1 ) + pylab.polar( [179*D2R, -179*D2R], [0.2, 0.1], "b.-" ) + pylab.polar( [179*D2R, 181*D2R], [0.2, 0.1], "g.-" ) + pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) + + fig.savefig( 'polar_wrap_180' ) + + fig = pylab.figure() + + #NOTE: resolution=1 really should be the default + pylab.subplot( 111, polar=True, resolution=1 ) + pylab.polar( [2*D2R, -2*D2R], [0.2, 0.1], "b.-" ) + pylab.polar( [2*D2R, 358*D2R], [0.2, 0.1], "g.-" ) + pylab.polar( [358*D2R, 2*D2R], [0.2, 0.1], "r.-" ) + pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) + + fig.savefig( 'polar_wrap_360' ) Modified: trunk/matplotlib/test/test_plots/TestPolar.py =================================================================== --- trunk/matplotlib/test/test_plots/TestPolar.py 2009年09月07日 20:04:20 UTC (rev 7691) +++ trunk/matplotlib/test/test_plots/TestPolar.py 2009年09月07日 20:04:38 UTC (rev 7692) @@ -41,40 +41,6 @@ pass #-------------------------------------------------------------------- - def test_polar_wrap( self ): - """Test polar plots where data crosses 0 degrees.""" - - fname = self.outFile( "polar_wrap_180.png" ) - - D2R = npy.pi / 180.0 - - fig = pylab.figure() - - #NOTE: resolution=1 really should be the default - pylab.subplot( 111, polar=True, resolution=1 ) - pylab.polar( [179*D2R, -179*D2R], [0.2, 0.1], "b.-" ) - pylab.polar( [179*D2R, 181*D2R], [0.2, 0.1], "g.-" ) - pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) - - fig.savefig( fname ) - self.checkImage( fname ) - - - fname = self.outFile( "polar_wrap_360.png" ) - - fig = pylab.figure() - - #NOTE: resolution=1 really should be the default - pylab.subplot( 111, polar=True, resolution=1 ) - pylab.polar( [2*D2R, -2*D2R], [0.2, 0.1], "b.-" ) - pylab.polar( [2*D2R, 358*D2R], [0.2, 0.1], "g.-" ) - pylab.polar( [358*D2R, 2*D2R], [0.2, 0.1], "r.-" ) - pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) - - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- def test_polar_units( self ): """Test polar plots with unitized data.""" Deleted: trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_180.png =================================================================== (Binary files differ) Deleted: trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_360.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7691 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7691&view=rev Author: astraw Date: 2009年09月07日 20:04:20 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/const_xy.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/TestPlot.py trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/const_xy.png (from rev 7690, trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:04:04 UTC (rev 7690) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:04:20 UTC (rev 7691) @@ -243,3 +243,19 @@ pylab.plot( xdata[:,1], xdata[1,:], 'o' ) fig.savefig( 'shaped data' ) + +@image_comparison(baseline_images=['const_xy']) +def test_const_xy(): + """Test constant xy data.""" + fig = pylab.figure() + + pylab.subplot( 311 ) + pylab.plot( np.arange(10), np.ones( (10,) ) ) + + pylab.subplot( 312 ) + pylab.plot( np.ones( (10,) ), np.arange(10) ) + + pylab.subplot( 313 ) + pylab.plot( np.ones( (10,) ), np.ones( (10,) ), 'o' ) + + fig.savefig( 'const_xy' ) Deleted: trunk/matplotlib/test/test_plots/TestPlot.py =================================================================== --- trunk/matplotlib/test/test_plots/TestPlot.py 2009年09月07日 20:04:04 UTC (rev 7690) +++ trunk/matplotlib/test/test_plots/TestPlot.py 2009年09月07日 20:04:20 UTC (rev 7691) @@ -1,63 +0,0 @@ -#======================================================================= -"""The Plot unit-test class implementation.""" -#======================================================================= - -from mplTest import * - -#======================================================================= -# Add import modules below. -import matplotlib -matplotlib.use( "Agg", warn = False ) - -import pylab -import numpy as npy -# -#======================================================================= - -#======================================================================= -class TestPlot( MplTestCase ): - """Plot unit test class.""" - - # Uncomment any appropriate tags - tags = [ - # 'gui', # requires the creation of a gui window - 'agg', # uses agg in the backend - 'agg-only', # uses only agg in the backend - # 'wx', # uses wx in the backend - # 'qt', # uses qt in the backend - # 'ps', # uses the postscript backend - # 'units', # uses units in the test - 'PIL', # uses PIL for image comparison - ] - - #-------------------------------------------------------------------- - def setUp( self ): - """Setup any data needed for the unit test.""" - pass - - #-------------------------------------------------------------------- - def tearDown( self ): - """Clean-up any generated files here.""" - pass - - #-------------------------------------------------------------------- - def test_const_xy( self ): - """Test constant xy data.""" - - fname = self.outFile( "const_xy.png" ) - fig = pylab.figure() - - pylab.subplot( 311 ) - pylab.plot( npy.arange(10), npy.ones( (10,) ) ) - - pylab.subplot( 312 ) - pylab.plot( npy.ones( (10,) ), npy.arange(10) ) - - pylab.subplot( 313 ) - pylab.plot( npy.ones( (10,) ), npy.ones( (10,) ), 'o' ) - - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- - Deleted: trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7690 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7690&view=rev Author: astraw Date: 2009年09月07日 20:04:04 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py trunk/matplotlib/test/test_plots/TestPlot.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/shaped_data.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/baseline/TestPlot/shaped_data.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/shaped_data.png (from rev 7689, trunk/matplotlib/test/test_plots/baseline/TestPlot/shaped_data.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:03:46 UTC (rev 7689) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:04:04 UTC (rev 7690) @@ -197,3 +197,49 @@ pylab.plot( time1, data1, 'o', color='r' ) fig.savefig( 'single_date' ) + +@image_comparison(baseline_images=['single_date']) +def test_shaped_data(): + """Test numpy shaped data.""" + + xdata = np.array([[ 0.53295185, 0.23052951, 0.19057629, 0.66724975, 0.96577916, + 0.73136095, 0.60823287, 0.017921 , 0.29744742, 0.27164665], + [ 0.2798012 , 0.25814229, 0.02818193, 0.12966456, 0.57446277, + 0.58167607, 0.71028245, 0.69112737, 0.89923072, 0.99072476], + [ 0.81218578, 0.80464528, 0.76071809, 0.85616314, 0.12757994, + 0.94324936, 0.73078663, 0.09658102, 0.60703967, 0.77664978], + [ 0.28332265, 0.81479711, 0.86985333, 0.43797066, 0.32540082, + 0.43819229, 0.92230363, 0.49414252, 0.68168256, 0.05922372], + [ 0.10721335, 0.93904142, 0.79163075, 0.73232848, 0.90283839, + 0.68408046, 0.25502302, 0.95976614, 0.59214115, 0.13663711], + [ 0.28087456, 0.33127607, 0.15530412, 0.76558121, 0.83389773, + 0.03735974, 0.98717738, 0.71432229, 0.54881366, 0.86893953], + [ 0.77995937, 0.995556 , 0.29688434, 0.15646162, 0.051848 , + 0.37161935, 0.12998491, 0.09377296, 0.36882507, 0.36583435], + [ 0.37851836, 0.05315792, 0.63144617, 0.25003433, 0.69586032, + 0.11393988, 0.92362096, 0.88045438, 0.93530252, 0.68275072], + [ 0.86486596, 0.83236675, 0.82960664, 0.5779663 , 0.25724233, + 0.84841095, 0.90862812, 0.64414887, 0.3565272 , 0.71026066], + [ 0.01383268, 0.3406093 , 0.76084285, 0.70800694, 0.87634056, + 0.08213693, 0.54655021, 0.98123181, 0.44080053, 0.86815815]]) + + y1 = np.arange( 10 ) + y1.shape = 1, 10 + + y2 = np.arange( 10 ) + y2.shape = 10, 1 + + fig = pylab.figure() + pylab.subplot( 411 ) + pylab.plot( y1 ) + pylab.subplot( 412 ) + pylab.plot( y2 ) + + pylab.subplot( 413 ) + from nose.tools import assert_raises + assert_raises(ValueError,pylab.plot, (y1,y2)) + + pylab.subplot( 414 ) + pylab.plot( xdata[:,1], xdata[1,:], 'o' ) + + fig.savefig( 'shaped data' ) Modified: trunk/matplotlib/test/test_plots/TestPlot.py =================================================================== --- trunk/matplotlib/test/test_plots/TestPlot.py 2009年09月07日 20:03:46 UTC (rev 7689) +++ trunk/matplotlib/test/test_plots/TestPlot.py 2009年09月07日 20:04:04 UTC (rev 7690) @@ -41,60 +41,6 @@ pass #-------------------------------------------------------------------- - def test_shaped_data( self ): - """Test numpy shaped data.""" - - xdata = npy.array([[ 0.53295185, 0.23052951, 0.19057629, 0.66724975, 0.96577916, - 0.73136095, 0.60823287, 0.017921 , 0.29744742, 0.27164665], - [ 0.2798012 , 0.25814229, 0.02818193, 0.12966456, 0.57446277, - 0.58167607, 0.71028245, 0.69112737, 0.89923072, 0.99072476], - [ 0.81218578, 0.80464528, 0.76071809, 0.85616314, 0.12757994, - 0.94324936, 0.73078663, 0.09658102, 0.60703967, 0.77664978], - [ 0.28332265, 0.81479711, 0.86985333, 0.43797066, 0.32540082, - 0.43819229, 0.92230363, 0.49414252, 0.68168256, 0.05922372], - [ 0.10721335, 0.93904142, 0.79163075, 0.73232848, 0.90283839, - 0.68408046, 0.25502302, 0.95976614, 0.59214115, 0.13663711], - [ 0.28087456, 0.33127607, 0.15530412, 0.76558121, 0.83389773, - 0.03735974, 0.98717738, 0.71432229, 0.54881366, 0.86893953], - [ 0.77995937, 0.995556 , 0.29688434, 0.15646162, 0.051848 , - 0.37161935, 0.12998491, 0.09377296, 0.36882507, 0.36583435], - [ 0.37851836, 0.05315792, 0.63144617, 0.25003433, 0.69586032, - 0.11393988, 0.92362096, 0.88045438, 0.93530252, 0.68275072], - [ 0.86486596, 0.83236675, 0.82960664, 0.5779663 , 0.25724233, - 0.84841095, 0.90862812, 0.64414887, 0.3565272 , 0.71026066], - [ 0.01383268, 0.3406093 , 0.76084285, 0.70800694, 0.87634056, - 0.08213693, 0.54655021, 0.98123181, 0.44080053, 0.86815815]]) - - fname = self.outFile( "shaped_data.png" ) - - y1 = npy.arange( 10 ) - y1.shape = 1, 10 - - y2 = npy.arange( 10 ) - y2.shape = 10, 1 - - fig = pylab.figure() - pylab.subplot( 411 ) - pylab.plot( y1 ) - pylab.subplot( 412 ) - pylab.plot( y2 ) - - pylab.subplot( 413 ) - try: - pylab.plot( y1, y2 ) - except: - # This should fail - pass - else: - self.fail( "Failed to raise an exception for mis-matched dimensions." ) - - pylab.subplot( 414 ) - pylab.plot( xdata[:,1], xdata[1,:], 'o' ) - - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- def test_const_xy( self ): """Test constant xy data.""" Deleted: trunk/matplotlib/test/test_plots/baseline/TestPlot/shaped_data.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7689 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7689&view=rev Author: astraw Date: 2009年09月07日 20:03:46 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py trunk/matplotlib/test/test_plots/TestPlot.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/single_date.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/baseline/TestPlot/single_date.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/single_date.png (from rev 7688, trunk/matplotlib/test/test_plots/baseline/TestPlot/single_date.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:03:29 UTC (rev 7688) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:03:46 UTC (rev 7689) @@ -181,3 +181,19 @@ pylab.plot( [1], [1], 'o' ) fig.savefig( 'single_point' ) + +@image_comparison(baseline_images=['single_date']) +def test_single_date(): + """Test single-point date plots.""" + + time1=[ 721964.0 ] + data1=[ -65.54 ] + + fig = pylab.figure() + pylab.subplot( 211 ) + pylab.plot_date( time1, data1, 'o', color='r' ) + + pylab.subplot( 212 ) + pylab.plot( time1, data1, 'o', color='r' ) + + fig.savefig( 'single_date' ) Modified: trunk/matplotlib/test/test_plots/TestPlot.py =================================================================== --- trunk/matplotlib/test/test_plots/TestPlot.py 2009年09月07日 20:03:29 UTC (rev 7688) +++ trunk/matplotlib/test/test_plots/TestPlot.py 2009年09月07日 20:03:46 UTC (rev 7689) @@ -41,25 +41,6 @@ pass #-------------------------------------------------------------------- - def test_single_date( self ): - """Test single-point date plots.""" - - fname = self.outFile( "single_date.png" ) - - time1=[ 721964.0 ] - data1=[ -65.54 ] - - fig = pylab.figure() - pylab.subplot( 211 ) - pylab.plot_date( time1, data1, 'o', color='r' ) - - pylab.subplot( 212 ) - pylab.plot( time1, data1, 'o', color='r' ) - - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- def test_shaped_data( self ): """Test numpy shaped data.""" Deleted: trunk/matplotlib/test/test_plots/baseline/TestPlot/single_date.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7688 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7688&view=rev Author: astraw Date: 2009年09月07日 20:03:29 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py trunk/matplotlib/test/test_plots/TestPlot.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/single_point.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/baseline/TestPlot/single_point.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/single_point.png (from rev 7687, trunk/matplotlib/test/test_plots/baseline/TestPlot/single_point.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:03:12 UTC (rev 7687) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:03:29 UTC (rev 7688) @@ -170,3 +170,14 @@ fig.autofmt_xdate() fig.savefig( 'fill_units' ) +@image_comparison(baseline_images=['single_point']) +def test_single_point(): + """Test single-point plots.""" + fig = pylab.figure() + pylab.subplot( 211 ) + pylab.plot( [0], [0], 'o' ) + + pylab.subplot( 212 ) + pylab.plot( [1], [1], 'o' ) + + fig.savefig( 'single_point' ) Modified: trunk/matplotlib/test/test_plots/TestPlot.py =================================================================== --- trunk/matplotlib/test/test_plots/TestPlot.py 2009年09月07日 20:03:12 UTC (rev 7687) +++ trunk/matplotlib/test/test_plots/TestPlot.py 2009年09月07日 20:03:29 UTC (rev 7688) @@ -41,21 +41,6 @@ pass #-------------------------------------------------------------------- - def test_single_point( self ): - """Test single-point plots.""" - fname = self.outFile( "single_point.png" ) - - fig = pylab.figure() - pylab.subplot( 211 ) - pylab.plot( [0], [0], 'o' ) - - pylab.subplot( 212 ) - pylab.plot( [1], [1], 'o' ) - - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- def test_single_date( self ): """Test single-point date plots.""" Deleted: trunk/matplotlib/test/test_plots/baseline/TestPlot/single_point.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7687 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7687&view=rev Author: astraw Date: 2009年09月07日 20:03:12 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/fill_units.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/TestFill.py trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/fill_units.png (from rev 7686, trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:02:56 UTC (rev 7686) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:03:12 UTC (rev 7687) @@ -128,3 +128,45 @@ ax.set_ylim( -20, 20 ) fig.savefig( 'polar_coords' ) +@image_comparison(baseline_images=['fill_units']) +def test_fill_units(): + """Test the fill method with unitized-data.""" + from datetime import datetime + import matplotlib.testing.jpl_units as units + units.register() + + # generate some data + t = units.Epoch( "ET", dt=datetime(2009, 4, 27) ) + value = 10.0 * units.deg + day = units.Duration( "ET", 24.0 * 60.0 * 60.0 ) + + fig = pylab.figure() + + # Top-Left + ax1 = fig.add_subplot( 221 ) + ax1.plot( [t], [value], yunits='deg', color='red' ) + ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0], + [0.0, 0.0, 90.0, 0.0], 'b' ) + + # Top-Right + ax2 = fig.add_subplot( 222 ) + ax2.plot( [t], [value], yunits='deg', color='red' ) + ax2.fill( [t, t, t+day, t+day], + [0.0, 0.0, 90.0, 0.0], 'b' ) + + # Bottom-Left + ax3 = fig.add_subplot( 223 ) + ax3.plot( [t], [value], yunits='deg', color='red' ) + ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0], + [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], 'b' ) + + # Bottom-Right + ax4 = fig.add_subplot( 224 ) + ax4.plot( [t], [value], yunits='deg', color='red' ) + ax4.fill( [t, t, t+day, t+day], + [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], + facecolor="blue" ) + + fig.autofmt_xdate() + fig.savefig( 'fill_units' ) + Deleted: trunk/matplotlib/test/test_plots/TestFill.py =================================================================== --- trunk/matplotlib/test/test_plots/TestFill.py 2009年09月07日 20:02:56 UTC (rev 7686) +++ trunk/matplotlib/test/test_plots/TestFill.py 2009年09月07日 20:03:12 UTC (rev 7687) @@ -1,87 +0,0 @@ -#======================================================================= -"""The Fill unit-test class implementation.""" -#======================================================================= - -from mplTest import * - -#======================================================================= -# Add import modules below. -import matplotlib -matplotlib.use( "Agg", warn = False ) - -import pylab -import numpy as npy -from datetime import datetime -# -#======================================================================= - -#======================================================================= -class TestFill( MplTestCase ): - """Test the various axes fill methods.""" - - # Uncomment any appropriate tags - tags = [ - # 'gui', # requires the creation of a gui window - 'agg', # uses agg in the backend - 'agg-only', # uses only agg in the backend - # 'wx', # uses wx in the backend - # 'qt', # uses qt in the backend - # 'ps', # uses the postscript backend - # 'units', # uses units in the test - 'PIL', # uses PIL for image comparison - ] - - #-------------------------------------------------------------------- - def setUp( self ): - """Setup any data needed for the unit test.""" - units.register() - - #-------------------------------------------------------------------- - def tearDown( self ): - """Clean-up any generated files here.""" - pass - - #-------------------------------------------------------------------- - def test_fill_units( self ): - """Test the fill method with unitized-data.""" - - fname = self.outFile( "fill_units.png" ) - - # generate some data - t = units.Epoch( "ET", dt=datetime(2009, 4, 27) ) - value = 10.0 * units.deg - day = units.Duration( "ET", 24.0 * 60.0 * 60.0 ) - - fig = pylab.figure() - - # Top-Left - ax1 = fig.add_subplot( 221 ) - ax1.plot( [t], [value], yunits='deg', color='red' ) - ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0], - [0.0, 0.0, 90.0, 0.0], 'b' ) - - # Top-Right - ax2 = fig.add_subplot( 222 ) - ax2.plot( [t], [value], yunits='deg', color='red' ) - ax2.fill( [t, t, t+day, t+day], - [0.0, 0.0, 90.0, 0.0], 'b' ) - - # Bottom-Left - ax3 = fig.add_subplot( 223 ) - ax3.plot( [t], [value], yunits='deg', color='red' ) - ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0], - [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], 'b' ) - - # Bottom-Right - ax4 = fig.add_subplot( 224 ) - ax4.plot( [t], [value], yunits='deg', color='red' ) - ax4.fill( [t, t, t+day, t+day], - [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], - facecolor="blue" ) - - fig.autofmt_xdate() - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- - Deleted: trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7686 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7686&view=rev Author: astraw Date: 2009年09月07日 20:02:56 +0000 (2009年9月07日) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_coords.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/TestAnnotation.py trunk/matplotlib/test/test_plots/baseline/TestAnnotation/polar_coords.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_coords.png (from rev 7685, trunk/matplotlib/test/test_plots/baseline/TestAnnotation/polar_coords.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:02:39 UTC (rev 7685) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009年09月07日 20:02:56 UTC (rev 7686) @@ -94,3 +94,37 @@ ) fig.savefig( 'polar_axes' ) + + #-------------------------------------------------------------------- +@image_comparison(baseline_images=['polar_coords']) +def test_polar_coord_annotations(): + """Polar Coordinate Annotations""" + + # You can also use polar notation on a catesian axes. Here the + # native coordinate system ('data') is cartesian, so you need to + # specify the xycoords and textcoords as 'polar' if you want to + # use (theta, radius) + from matplotlib.patches import Ellipse + el = Ellipse((0,0), 10, 20, facecolor='r', alpha=0.5) + + fig = pylab.figure() + ax = fig.add_subplot( 111, aspect='equal' ) + + ax.add_artist( el ) + el.set_clip_box( ax.bbox ) + + ax.annotate('the top', + xy=(np.pi/2., 10.), # theta, radius + xytext=(np.pi/3, 20.), # theta, radius + xycoords='polar', + textcoords='polar', + arrowprops=dict(facecolor='black', shrink=0.05), + horizontalalignment='left', + verticalalignment='bottom', + clip_on=True, # clip to the axes bounding box + ) + + ax.set_xlim( -20, 20 ) + ax.set_ylim( -20, 20 ) + fig.savefig( 'polar_coords' ) + Deleted: trunk/matplotlib/test/test_plots/TestAnnotation.py =================================================================== --- trunk/matplotlib/test/test_plots/TestAnnotation.py 2009年09月07日 20:02:39 UTC (rev 7685) +++ trunk/matplotlib/test/test_plots/TestAnnotation.py 2009年09月07日 20:02:56 UTC (rev 7686) @@ -1,78 +0,0 @@ -#======================================================================= -"""The Annotation unite-test class implementation.""" -#======================================================================= - -from mplTest import * - -#======================================================================= -# Add import modules below. -import matplotlib -matplotlib.use( "Agg", warn = False ) - -from matplotlib.pyplot import figure -from matplotlib.patches import Ellipse -import numpy as npy -# -#======================================================================= - -#======================================================================= -class TestAnnotation( MplTestCase ): - """Annotation unit test class.""" - - # Uncomment any appropriate tags - tags = [ - # 'gui', # requires the creation of a gui window - 'agg', # uses agg in the backend - 'agg-only', # uses only agg in the backend - # 'wx', # uses wx in the backend - # 'qt', # uses qt in the backend - # 'ps', # uses the postscript backend - # 'units', # uses units in the test - 'PIL', # uses PIL for image comparison - ] - - #-------------------------------------------------------------------- - def setUp( self ): - """Setup any data needed for the unit test.""" - pass - - #-------------------------------------------------------------------- - def tearDown( self ): - """Clean-up any generated files here.""" - pass - - #-------------------------------------------------------------------- - def testPolarCoordAnnotations( self ): - """Polar Coordinate Annotations""" - - # You can also use polar notation on a catesian axes. Here the - # native coordinate system ('data') is cartesian, so you need to - # specify the xycoords and textcoords as 'polar' if you want to - # use (theta, radius) - - el = Ellipse((0,0), 10, 20, facecolor='r', alpha=0.5) - - fname = self.outFile( "polar_coords.png" ) - - fig = figure() - ax = fig.add_subplot( 111, aspect='equal' ) - - ax.add_artist( el ) - el.set_clip_box( ax.bbox ) - - ax.annotate('the top', - xy=(npy.pi/2., 10.), # theta, radius - xytext=(npy.pi/3, 20.), # theta, radius - xycoords='polar', - textcoords='polar', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='left', - verticalalignment='bottom', - clip_on=True, # clip to the axes bounding box - ) - - ax.set_xlim( -20, 20 ) - ax.set_ylim( -20, 20 ) - fig.savefig( fname ) - self.checkImage( fname ) - Deleted: trunk/matplotlib/test/test_plots/baseline/TestAnnotation/polar_coords.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.