SF.net SVN: matplotlib:[7858] branches/v0_99_maint/src/_backend_agg.cpp

2009-10-09 Thread mdboom
Revision: 7858
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7858&view=rev
Author:   mdboom
Date: 2009-10-09 15:24:25 + (Fri, 09 Oct 2009)

Log Message:
---
Don't perform path simplification when hatch is drawn.

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

Modified: branches/v0_99_maint/src/_backend_agg.cpp
===
--- branches/v0_99_maint/src/_backend_agg.cpp   2009-10-07 16:03:23 UTC (rev 
7857)
+++ branches/v0_99_maint/src/_backend_agg.cpp   2009-10-09 15:24:25 UTC (rev 
7858)
@@ -56,7 +56,7 @@
  (GCAgg::dash_t)
 */
 void convert_dashes(const Py::Tuple& dashes, double dpi, GCAgg::dash_t& 
dashes_out,
-   double& dashOffset_out) {
+double& dashOffset_out) {
   if (dashes.length()!=2)
 throw Py::ValueError(Printf("Dash descriptor must be a length 2 tuple; 
found %d", dashes.length()).str());
 
@@ -298,7 +298,7 @@
 RendererAgg::PIXELS_PER_INCH(96);
 
 RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi,
-int debug) :
+ int debug) :
   width(width),
   height(height),
   dpi(dpi),
@@ -324,7 +324,7 @@
   _VERBOSE("RendererAgg::RendererAgg");
   unsigned stride(width*4);
 
-  pixBuffer  = new agg::int8u[NUMBYTES];
+  pixBuffer   = new agg::int8u[NUMBYTES];
   renderingBuffer.attach(pixBuffer, width, height, stride);
   pixFmt.attach(renderingBuffer);
   rendererBase.attach(pixFmt);
@@ -337,7 +337,7 @@
 void RendererAgg::create_alpha_buffers() {
   if (!alphaBuffer) {
 unsigned stride(width*4);
-alphaBuffer   = new agg::int8u[NUMBYTES];
+alphaBuffer= new agg::int8u[NUMBYTES];
 alphaMaskRenderingBuffer.attach(alphaBuffer, width, height, stride);
 rendererBaseAlphaMask.attach(pixfmtAlphaMask);
 rendererAlphaMask.attach(rendererBaseAlphaMask);
@@ -428,9 +428,9 @@
 
   agg::rendering_buffer rbuf;
   rbuf.attach(region->data,
- region->width,
- region->height,
- region->stride);
+  region->width,
+  region->height,
+  region->stride);
 
   rendererBase.copy_from(rbuf, 0, region->rect.x1, region->rect.y1);
 
@@ -465,14 +465,14 @@
 throw Py::ValueError("Cannot restore_region from NULL data");
 
   agg::rect_i rect(xx1-region->rect.x1, (yy1-region->rect.y1),
-  xx2-region->rect.x1, (yy2-region->rect.y1));
+   xx2-region->rect.x1, (yy2-region->rect.y1));
 
 
   agg::rendering_buffer rbuf;
   rbuf.attach(region->data,
- region->width,
- region->height,
- region->stride);
+  region->width,
+  region->height,
+  region->stride);
 
   rendererBase.copy_from(rbuf, &rect, x, y);
 
@@ -512,21 +512,21 @@
 
 Py::Object
 RendererAgg::draw_markers(const Py::Tuple& args) {
-  typedef agg::conv_transform transformed_path_t;
-  typedef PathQuantizer quantize_t;
-  typedef agg::conv_curve   curve_t;
-  typedef agg::conv_stroke stroke_t;
+  typedef agg::conv_transform  
transformed_path_t;
+  typedef PathQuantizer  quantize_t;
+  typedef agg::conv_curvecurve_t;
+  typedef agg::conv_stroke  stroke_t;
   typedef agg::pixfmt_amask_adaptor pixfmt_amask_type;
-  typedef agg::renderer_base 
amask_ren_type;
+  typedef agg::renderer_base  amask_ren_type;
   typedef agg::renderer_scanline_aa_solid
amask_aa_renderer_type;
   typedef agg::renderer_scanline_bin_solid   
amask_bin_renderer_type;
   args.verify_length(5, 6);
 
-  Py::Object   gc_obj  = args[0];
-  Py::Object   marker_path_obj = args[1];
+  Py::Objectgc_obj  = args[0];
+  Py::Objectmarker_path_obj = args[1];
   agg::trans_affine marker_trans= 
py_to_agg_transformation_matrix(args[2].ptr());
-  Py::Object   path_obj= args[3];
-  agg::trans_affine trans  = 
py_to_agg_transformation_matrix(args[4].ptr());
+  Py::Objectpath_obj= args[3];
+  agg::trans_affine trans   = 
py_to_agg_transformation_matrix(args[4].ptr());
   Py::Objectface_obj;
   if (args.size() == 6)
 face_obj = args[5];
@@ -541,15 +541,15 @@
   PathIterator   marker_path(marker_path_obj);
   transformed_path_t marker_path_transformed(marker_path, marker_trans);
   quantize_t marker_path_quantized(marker_path_transformed,
-  gc.quantize_mode,
+   gc.quantize_mode,
marker_path.total_vertices());
   curve_tmarker_path_curve(marker_path_quantized);
 
   PathIterator path(path_obj);
   transformed_path_t path_transformed(pat

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

2009-10-09 Thread mdboom
Revision: 7859
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7859&view=rev
Author:   mdboom
Date: 2009-10-09 15:31:59 + (Fri, 09 Oct 2009)

Log Message:
---
Merged revisions 7858 via svnmerge from 
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint


  r7858 | mdboom | 2009-10-09 11:24:25 -0400 (Fri, 09 Oct 2009) | 2 lines
  
  Don't perform path simplification when hatch is drawn.


Modified Paths:
--
trunk/matplotlib/src/_backend_agg.cpp

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/mathtex:1-7263 /branches/v0_99_maint:1-7849
   + /branches/mathtex:1-7263 /branches/v0_99_maint:1-7858
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,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849
   + /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,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858


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,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849
   + 
/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,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858


Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
__

SF.net SVN: matplotlib:[7860] trunk/matplotlib/lib/matplotlib/testing/ decorators.py

2009-10-09 Thread jouni
Revision: 7860
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7860&view=rev
Author:   jouni
Date: 2009-10-09 16:10:28 + (Fri, 09 Oct 2009)

Log Message:
---
Don't skip running tests if a baseline image is missing

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-10-09 
15:31:59 UTC (rev 7859)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py   2009-10-09 
16:10:28 UTC (rev 7860)
@@ -54,11 +54,7 @@
 # separate test case for each file format.
 def compare_images_decorator(func):
 baseline_dir, result_dir = _image_directories(func)
-# Only run the test if there is a baseline image in the
-# correct format for comparison.
-extensions = [ext for ext in ['png', 'pdf']
-  if os.path.exists(os.path.join(
-  baseline_dir, baseline_images[0] + '.' + ext))]
+extensions = ['png', 'pdf']
 
 def compare_images_generator():
 for extension in extensions:


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

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7861] trunk/matplotlib/lib/matplotlib/tests

2009-10-09 Thread mdboom
Revision: 7861
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7861&view=rev
Author:   mdboom
Date: 2009-10-09 16:32:29 + (Fri, 09 Oct 2009)

Log Message:
---
Add regression test for Agg backend hatch clipping

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/tests/test_simplification.py

Added Paths:
---

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/hatch_simplify.pdf

trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/hatch_simplify.png

Added: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/hatch_simplify.pdf
===
(Binary files differ)


Property changes on: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/hatch_simplify.pdf
___
Added: svn:mime-type
   + application/octet-stream

Added: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/hatch_simplify.png
===
(Binary files differ)


Property changes on: 
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/hatch_simplify.png
___
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/matplotlib/lib/matplotlib/tests/test_simplification.py
===
--- trunk/matplotlib/lib/matplotlib/tests/test_simplification.py
2009-10-09 16:10:28 UTC (rev 7860)
+++ trunk/matplotlib/lib/matplotlib/tests/test_simplification.py
2009-10-09 16:32:29 UTC (rev 7861)
@@ -106,6 +106,17 @@
 
 fig.savefig('simplify_curve')
 
+...@image_comparison(baseline_images=['hatch_simplify'])
+def test_hatch():
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.add_patch(Rectangle((0, 0), 1, 1, fill=False, hatch="/"))
+ax.set_xlim((0.45, 0.55))
+ax.set_ylim((0.45, 0.55))
+
+fig.savefig('hatch_simplify')
+
+
 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.

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7862] trunk/matplotlib/lib/matplotlib/testing/ decorators.py

2009-10-09 Thread astraw
Revision: 7862
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7862&view=rev
Author:   astraw
Date: 2009-10-09 17:20:23 + (Fri, 09 Oct 2009)

Log Message:
---
testing: don't compare images if baseline does not exist

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-10-09 
16:32:29 UTC (rev 7861)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py   2009-10-09 
17:20:23 UTC (rev 7862)
@@ -4,6 +4,7 @@
 import nose
 import matplotlib
 import matplotlib.tests
+import numpy as np
 from matplotlib.testing.compare import comparable_formats, compare_images
 
 def knownfailureif(fail_condition, msg=None):
@@ -58,8 +59,19 @@
 
 def compare_images_generator():
 for extension in extensions:
-@knownfailureif(extension not in comparable_formats(),
-'Cannot compare %s files on this system' % 
extension)
+expected_fnames = [os.path.join(baseline_dir,fname) + '.' + 
extension for fname in baseline_images]
+actual_fnames = [os.path.join(result_dir, fname) + '.' + 
extension for fname in baseline_images]
+have_baseline_images = [os.path.exists(expected) for expected 
in expected_fnames]
+have_baseline_image = np.all(have_baseline_images)
+is_comparable = extension in comparable_formats()
+if not is_comparable:
+fail_msg = 'Cannot compare %s files on this system' % 
extension
+elif not have_baseline_image:
+fail_msg = 'Do not have baseline images %s' % 
expected_fnames
+else:
+fail_msg = 'No failure expected'
+will_fail = not (is_comparable and have_baseline_image)
+@knownfailureif(will_fail, fail_msg )
 def decorated_compare_images():
 # set the default format of savefig
 matplotlib.rc('savefig', extension=extension)
@@ -70,9 +82,7 @@
 result = func() # actually call the test function
 finally:
 os.chdir(old_dir)
-for fname in baseline_images:
-actual = os.path.join(result_dir, fname) + '.' + 
extension
-expected = os.path.join(baseline_dir,fname) + '.' + 
extension
+for actual,expected in zip(actual_fnames,expected_fnames):
 
 # compare the images
 tol=1e-3 # default tolerance


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

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7863] trunk/matplotlib/lib/matplotlib/testing/ decorators.py

2009-10-09 Thread astraw
Revision: 7863
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7863&view=rev
Author:   astraw
Date: 2009-10-09 17:38:48 + (Fri, 09 Oct 2009)

Log Message:
---
testing: allow limiting the extensions to test on image comparison

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-10-09 
17:20:23 UTC (rev 7862)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py   2009-10-09 
17:38:48 UTC (rev 7863)
@@ -39,23 +39,42 @@
 return nose.tools.make_decorator(f)(failer)
 return known_fail_decorator
 
-def image_comparison(baseline_images=None):
+def image_comparison(baseline_images=None,extensions=None):
 """
-compare images generated by the test with those specified in
+call signature::
+
+  image_comparison(baseline_images=['my_figure'], extensions=None)
+
+Compare images generated by the test with those specified in
 *baseline_images*, which must correspond else an
 ImageComparisonFailure exception will be raised.
+
+Keyword arguments:
+
+  *baseline_images*: list
+A list of strings specifying the names of the images generated
+by calls to :meth:`matplotlib.figure.savefig`.
+
+  *extensions*: [ None | list ]
+
+If *None*, default to all supported extensions.
+
+Otherwise, a list of extensions to test. For example ['png','pdf'].
 """
 
 if baseline_images is None:
 raise ValueError('baseline_images must be specified')
 
+if extensions is None:
+# default extensions to test
+extensions = ['png', 'pdf']
+
 # The multiple layers of defs are required because of how
 # parameterized decorators work, and because we want to turn the
 # single test_foo function to a generator that generates a
 # separate test case for each file format.
 def compare_images_decorator(func):
 baseline_dir, result_dir = _image_directories(func)
-extensions = ['png', 'pdf']
 
 def compare_images_generator():
 for extension in extensions:


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

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins