summaryrefslogtreecommitdiff
path: root/numpy/ma/tests
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2010-02-07 22:26:04 +0000
committerpierregm <pierregm@localhost>2010-02-07 22:26:04 +0000
commit5bad51bf3afc9d2256e9f6a5a1883233b3065ddd (patch)
tree28448899d301f091b5eaab30ab52dbaa5f1634be /numpy/ma/tests
parent5d87b02f5512c14238ddff3ae6982fe735be973a (diff)
downloadnumpy-5bad51bf3afc9d2256e9f6a5a1883233b3065ddd.tar.gz
* Force the fill_value of a structured masked array to be defined (bug #1332)
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r--numpy/ma/tests/test_core.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index ada858b01..b849d0c48 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -1440,6 +1440,7 @@ class TestFillingValues(TestCase):
def test_fillvalue_individual_fields(self):
"Test setting fill_value on individual fields"
ndtype = [('a', int), ('b', int)]
+ # Explicit fill_value
a = array(zip([1, 2, 3], [4, 5, 6]),
fill_value=(-999, -999), dtype=ndtype)
f = a._fill_value
@@ -1449,6 +1450,12 @@ class TestFillingValues(TestCase):
assert_equal(tuple(a.fill_value), (10, -999))
a.fill_value['b'] = -10
assert_equal(tuple(a.fill_value), (10, -10))
+ # Implicit fill_value
+ t = array(zip([1, 2, 3], [4, 5, 6]), dtype=[('a', int), ('b', int)])
+ tt = t['a']
+ tt.set_fill_value(10)
+ assert_equal(tt._fill_value, np.array(10))
+ assert_equal(tuple(t.fill_value), (10, default_fill_value(0)))
#------------------------------------------------------------------------------