From: <ef...@us...> - 2008-07-20 18:21:17
|
Revision: 5796 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5796&view=rev Author: efiring Date: 2008-07-20 18:21:11 +0000 (Sun, 20 Jul 2008) Log Message: ----------- Moved and modified axes_unit.py to cbook_unit.py. At present it is only testing delete_masked_points, which was moved from axes to cbook. Modified Paths: -------------- trunk/matplotlib/CHANGELOG Added Paths: ----------- trunk/matplotlib/unit/cbook_unit.py Removed Paths: ------------- trunk/matplotlib/unit/axes_unit.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-07-20 07:14:46 UTC (rev 5795) +++ trunk/matplotlib/CHANGELOG 2008-07-20 18:21:11 UTC (rev 5796) @@ -1,8 +1,13 @@ + +2008-07-20 Renamed unit/axes_unit.py to cbook_unit.py and modified + in accord with Ryan's move of delete_masked_points from + axes to cbook. - EF + 2008-07-18 Check for nan and inf in axes.delete_masked_points(). - This should help hexbin and scatter deal with nans. - ADS + This should help hexbin and scatter deal with nans. - ADS 2008-07-17 Added ability to manually select contour label locations. - Also added a waitforbuttonpress function. - DMK + Also added a waitforbuttonpress function. - DMK 2008-07-17 Fix bug with NaNs at end of path (thanks, Andrew Straw for the report) - MGD Deleted: trunk/matplotlib/unit/axes_unit.py =================================================================== --- trunk/matplotlib/unit/axes_unit.py 2008-07-20 07:14:46 UTC (rev 5795) +++ trunk/matplotlib/unit/axes_unit.py 2008-07-20 18:21:11 UTC (rev 5796) @@ -1,62 +0,0 @@ -import unittest -import numpy as np -import matplotlib.axes as axes - -class TestAxes(unittest.TestCase): - def test_delete_masked_points_arrays(self): - input = ( [1,2,3,np.nan,5], - np.array((1,2,3,4,5)), - ) - expected = [np.array((1,2,3,5))]*2 - actual = axes.delete_masked_points(*input) - assert np.allclose(actual, expected) - - input = ( np.ma.array( [1,2,3,4,5], mask=[False,False,False,True,False] ), - np.array((1,2,3,4,5)), - ) - expected = [np.array((1,2,3,5))]*2 - actual = axes.delete_masked_points(*input) - assert np.allclose(actual, expected) - - input = ( [1,2,3,np.nan,5], - np.ma.array( [1,2,3,4,5], mask=[False,False,False,True,False] ), - np.array((1,2,3,4,5)), - ) - expected = [np.array((1,2,3,5))]*3 - actual = axes.delete_masked_points(*input) - assert np.allclose(actual, expected) - - input = () - expected = () - actual = axes.delete_masked_points(*input) - assert np.allclose(actual, expected) - - - input = ( [1,2,3,np.nan,5], - ) - expected = [np.array((1,2,3,5))]*1 - actual = axes.delete_masked_points(*input) - assert np.allclose(actual, expected) - - input = ( np.array((1,2,3,4,5)), - ) - expected = [np.array((1,2,3,4,5))]*1 - actual = axes.delete_masked_points(*input) - assert np.allclose(actual, expected) - - def test_delete_masked_points_strings(self): - input = ( 'hello', - ) - expected = ('hello',) - actual = axes.delete_masked_points(*input) - assert actual == expected - - input = ( u'hello', - ) - expected = (u'hello',) - actual = axes.delete_masked_points(*input) - assert actual == expected - - -if __name__=='__main__': - unittest.main() Copied: trunk/matplotlib/unit/cbook_unit.py (from rev 5795, trunk/matplotlib/unit/axes_unit.py) =================================================================== --- trunk/matplotlib/unit/cbook_unit.py (rev 0) +++ trunk/matplotlib/unit/cbook_unit.py 2008-07-20 18:21:11 UTC (rev 5796) @@ -0,0 +1,62 @@ +import unittest +import numpy as np +import matplotlib.cbook as cbook + +class TestAxes(unittest.TestCase): + def test_delete_masked_points_arrays(self): + input = ( [1,2,3,np.nan,5], + np.array((1,2,3,4,5)), + ) + expected = [np.array((1,2,3,5))]*2 + actual = cbook.delete_masked_points(*input) + assert np.allclose(actual, expected) + + input = ( np.ma.array( [1,2,3,4,5], mask=[False,False,False,True,False] ), + np.array((1,2,3,4,5)), + ) + expected = [np.array((1,2,3,5))]*2 + actual = cbook.delete_masked_points(*input) + assert np.allclose(actual, expected) + + input = ( [1,2,3,np.nan,5], + np.ma.array( [1,2,3,4,5], mask=[False,False,False,True,False] ), + np.array((1,2,3,4,5)), + ) + expected = [np.array((1,2,3,5))]*3 + actual = cbook.delete_masked_points(*input) + assert np.allclose(actual, expected) + + input = () + expected = () + actual = cbook.delete_masked_points(*input) + assert np.allclose(actual, expected) + + + input = ( [1,2,3,np.nan,5], + ) + expected = [np.array((1,2,3,5))]*1 + actual = cbook.delete_masked_points(*input) + assert np.allclose(actual, expected) + + input = ( np.array((1,2,3,4,5)), + ) + expected = [np.array((1,2,3,4,5))]*1 + actual = cbook.delete_masked_points(*input) + assert np.allclose(actual, expected) + + def test_delete_masked_points_strings(self): + input = ( 'hello', + ) + expected = ('hello',) + actual = cbook.delete_masked_points(*input) + assert actual == expected + + input = ( u'hello', + ) + expected = (u'hello',) + actual = cbook.delete_masked_points(*input) + assert actual == expected + + +if __name__=='__main__': + unittest.main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |