Skip to content

Commit a9be4e9

Browse files
committed
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. svn path=/trunk/matplotlib/; revision=5796
1 parent eebbeb4 commit a9be4e9

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

CHANGELOG

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
2+
2008-07-20 Renamed unit/axes_unit.py to cbook_unit.py and modified
3+
in accord with Ryan's move of delete_masked_points from
4+
axes to cbook. - EF
5+
16
2008-07-18 Check for nan and inf in axes.delete_masked_points().
2-
This should help hexbin and scatter deal with nans. - ADS
7+
This should help hexbin and scatter deal with nans. - ADS
38

49
2008-07-17 Added ability to manually select contour label locations.
5-
Also added a waitforbuttonpress function. - DMK
10+
Also added a waitforbuttonpress function. - DMK
611

712
2008-07-17 Fix bug with NaNs at end of path (thanks, Andrew Straw for
813
the report) - MGD

unit/axes_unit.py unit/cbook_unit.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
11
import unittest
22
import numpy as np
3-
import matplotlib.axes as axes
3+
import matplotlib.cbook as cbook
44

55
class TestAxes(unittest.TestCase):
66
def test_delete_masked_points_arrays(self):
77
input = ( [1,2,3,np.nan,5],
88
np.array((1,2,3,4,5)),
99
)
1010
expected = [np.array((1,2,3,5))]*2
11-
actual = axes.delete_masked_points(*input)
11+
actual = cbook.delete_masked_points(*input)
1212
assert np.allclose(actual, expected)
1313

1414
input = ( np.ma.array( [1,2,3,4,5], mask=[False,False,False,True,False] ),
1515
np.array((1,2,3,4,5)),
1616
)
1717
expected = [np.array((1,2,3,5))]*2
18-
actual = axes.delete_masked_points(*input)
18+
actual = cbook.delete_masked_points(*input)
1919
assert np.allclose(actual, expected)
2020

2121
input = ( [1,2,3,np.nan,5],
2222
np.ma.array( [1,2,3,4,5], mask=[False,False,False,True,False] ),
2323
np.array((1,2,3,4,5)),
2424
)
2525
expected = [np.array((1,2,3,5))]*3
26-
actual = axes.delete_masked_points(*input)
26+
actual = cbook.delete_masked_points(*input)
2727
assert np.allclose(actual, expected)
2828

2929
input = ()
3030
expected = ()
31-
actual = axes.delete_masked_points(*input)
31+
actual = cbook.delete_masked_points(*input)
3232
assert np.allclose(actual, expected)
3333

3434

3535
input = ( [1,2,3,np.nan,5],
3636
)
3737
expected = [np.array((1,2,3,5))]*1
38-
actual = axes.delete_masked_points(*input)
38+
actual = cbook.delete_masked_points(*input)
3939
assert np.allclose(actual, expected)
4040

4141
input = ( np.array((1,2,3,4,5)),
4242
)
4343
expected = [np.array((1,2,3,4,5))]*1
44-
actual = axes.delete_masked_points(*input)
44+
actual = cbook.delete_masked_points(*input)
4545
assert np.allclose(actual, expected)
4646

4747
def test_delete_masked_points_strings(self):
4848
input = ( 'hello',
4949
)
5050
expected = ('hello',)
51-
actual = axes.delete_masked_points(*input)
51+
actual = cbook.delete_masked_points(*input)
5252
assert actual == expected
5353

5454
input = ( u'hello',
5555
)
5656
expected = (u'hello',)
57-
actual = axes.delete_masked_points(*input)
57+
actual = cbook.delete_masked_points(*input)
5858
assert actual == expected
5959

6060

0 commit comments

Comments
 (0)