Revision: 4122 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4122&view=rev Author: mdboom Date: 2007-11-06 07:37:44 -0800 (Tue, 06 Nov 2007)
Log Message: ----------- Minor speed improvement (thanks to Eric Firing). Also use matplotlib.numerix.npyma instead of numpy.ma Modified Paths: -------------- branches/transforms/lib/matplotlib/path.py branches/transforms/lib/matplotlib/transforms.py Modified: branches/transforms/lib/matplotlib/path.py =================================================================== --- branches/transforms/lib/matplotlib/path.py 2007-11-06 13:14:08 UTC (rev 4121) +++ branches/transforms/lib/matplotlib/path.py 2007-11-06 15:37:44 UTC (rev 4122) @@ -7,7 +7,7 @@ import math import numpy as npy -from numpy import ma as ma +from matplotlib.numerix import npyma as ma from matplotlib._path import point_in_path, get_path_extents, \ point_in_path_collection @@ -86,7 +86,8 @@ resulting path will be compressed, with MOVETO codes inserted in the correct places to jump over the masked regions. """ - if not ma.isMaskedArray(vertices): + mask = ma.getmask(vertices) + if not mask: vertices = ma.asarray(vertices, npy.float_) if codes is None: @@ -112,7 +113,6 @@ # itself), are not expected to deal with masked arrays, so we # must remove them from the array (using compressed), and add # MOVETO commands to the codes array accordingly. - mask = ma.getmask(vertices) if mask is not ma.nomask: mask1d = ma.mask_or(mask[:, 0], mask[:, 1]) vertices = ma.compress(npy.invert(mask1d), vertices, 0) @@ -125,7 +125,6 @@ assert vertices.ndim == 2 assert vertices.shape[1] == 2 - assert codes.ndim == 1 self._codes = codes self._vertices = vertices Modified: branches/transforms/lib/matplotlib/transforms.py =================================================================== --- branches/transforms/lib/matplotlib/transforms.py 2007-11-06 13:14:08 UTC (rev 4121) +++ branches/transforms/lib/matplotlib/transforms.py 2007-11-06 15:37:44 UTC (rev 4122) @@ -24,7 +24,7 @@ """ import numpy as npy -from numpy import ma as ma +from matplotlib.numerix import npyma as ma from numpy.linalg import inv from weakref import WeakKeyDictionary This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins