[Numpy-svn] r6316 - in trunk/numpy/ma: . tests

numpy-svn@scip... numpy-svn@scip...
Fri Jan 9 19:53:10 CST 2009


Author: pierregm
Date: 2009-01-09 19:53:05 -0600 (Fri, 09 Jan 2009)
New Revision: 6316

Modified:
   trunk/numpy/ma/core.py
   trunk/numpy/ma/tests/test_core.py
Log:
* Add flatten_structured_array to the namespace

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2009-01-09 20:18:12 UTC (rev 6315)
+++ trunk/numpy/ma/core.py	2009-01-10 01:53:05 UTC (rev 6316)
@@ -34,7 +34,8 @@
            'default_fill_value', 'diag', 'diagonal', 'divide', 'dump', 'dumps',
            'empty', 'empty_like', 'equal', 'exp', 'expand_dims',
            'fabs', 'flatten_mask', 'fmod', 'filled', 'floor', 'floor_divide',
-           'fix_invalid', 'frombuffer', 'fromflex', 'fromfunction',
+           'fix_invalid', 'flatten_structured_array', 'frombuffer', 'fromflex',
+           'fromfunction',
            'getdata','getmask', 'getmaskarray', 'greater', 'greater_equal',
            'harden_mask', 'hypot',
            'identity', 'ids', 'indices', 'inner', 'innerproduct',

Modified: trunk/numpy/ma/tests/test_core.py
===================================================================
--- trunk/numpy/ma/tests/test_core.py	2009-01-09 20:18:12 UTC (rev 6315)
+++ trunk/numpy/ma/tests/test_core.py	2009-01-10 01:53:05 UTC (rev 6316)
@@ -518,20 +518,20 @@
         assert_equal(test, control)
         assert_equal(test.dtype, control.dtype)
         # On masked_array
-        a = ma.array([(1, 1), (2, 2)], mask=[(0, 1), (1, 0)], dtype=ndtype)
+        a = array([(1, 1), (2, 2)], mask=[(0, 1), (1, 0)], dtype=ndtype)
         test = flatten_structured_array(a)
-        control = ma.array([[1., 1.], [2., 2.]], 
-                           mask=[[0, 1], [1, 0]], dtype=np.float)
+        control = array([[1., 1.], [2., 2.]], 
+                        mask=[[0, 1], [1, 0]], dtype=np.float)
         assert_equal(test, control)
         assert_equal(test.dtype, control.dtype)
         assert_equal(test.mask, control.mask)
         # On masked array with nested structure
         ndtype = [('a', int), ('b', [('ba', int), ('bb', float)])]
-        a = ma.array([(1, (1, 1.1)), (2, (2, 2.2))],
-                     mask=[(0, (1, 0)), (1, (0, 1))], dtype=ndtype)
+        a = array([(1, (1, 1.1)), (2, (2, 2.2))],
+                  mask=[(0, (1, 0)), (1, (0, 1))], dtype=ndtype)
         test = flatten_structured_array(a)
-        control = ma.array([[1., 1., 1.1], [2., 2., 2.2]], 
-                           mask=[[0, 1, 0], [1, 0, 1]], dtype=np.float)
+        control = array([[1., 1., 1.1], [2., 2., 2.2]], 
+                        mask=[[0, 1, 0], [1, 0, 1]], dtype=np.float)
         assert_equal(test, control)
         assert_equal(test.dtype, control.dtype)
         assert_equal(test.mask, control.mask)



More information about the Numpy-svn mailing list