[Scipy-svn] r6529 - in trunk/scipy/io: . tests

scipy-svn at scipy.org scipy-svn at scipy.org
Fri Jun 18 09:04:16 EDT 2010


Author: rgommers
Date: 2010-06-18 08:04:16 -0500 (Fri, 18 Jun 2010)
New Revision: 6529

Modified:
   trunk/scipy/io/recaster.py
   trunk/scipy/io/tests/test_recaster.py
Log:
Deprecate io.recaster module.

Modified: trunk/scipy/io/recaster.py
===================================================================
--- trunk/scipy/io/recaster.py	2010-06-18 13:03:56 UTC (rev 6528)
+++ trunk/scipy/io/recaster.py	2010-06-18 13:04:16 UTC (rev 6529)
@@ -5,9 +5,20 @@
 """
 
 from numpy import *
+from numpy.lib.utils import deprecate
 
+# deprecated in 0.8, will be removed in 0.9.
+ at deprecate
 def sctype_attributes():
-    ''' Return dictionary describing numpy scalar types '''
+    """Return dictionary describing numpy scalar types
+
+    .. deprecated:: sctype_attributes is deprecated in scipy 0.8 and
+                    will be removed in scipy 0.9.
+    """
+    return _sctype_attributes()
+
+
+def _sctype_attributes():
     d_dict = {}
     for sc_type in ('complex','float'):
         t_list = sctypes[sc_type]
@@ -46,9 +57,13 @@
 class RecastError(ValueError):
     pass
 
+# deprecated in 0.8, will be removed in 0.9.
 class Recaster(object):
     ''' Class to recast arrays to one of acceptable scalar types
 
+    .. deprecated:: Recaster is deprecated in scipy 0.8 and will be
+                    removed in scipy 0.9.
+
     Initialization specifies acceptable types (ATs)
 
     Implements recast method - returns array that may be of different
@@ -58,7 +73,7 @@
     specified in options at object creation.
     '''
 
-    _sctype_attributes = sctype_attributes()
+    _sctype_attributes = _sctype_attributes()
     _k = 2**10
     _option_defaults = {
         'only_if_none': {
@@ -107,6 +122,7 @@
         }
         }
 
+    @deprecate
     def __init__(self, sctype_list=None,
                  sctype_tols=None,
                  recast_options='only_if_none'):

Modified: trunk/scipy/io/tests/test_recaster.py
===================================================================
--- trunk/scipy/io/tests/test_recaster.py	2010-06-18 13:03:56 UTC (rev 6528)
+++ trunk/scipy/io/tests/test_recaster.py	2010-06-18 13:04:16 UTC (rev 6529)
@@ -1,3 +1,5 @@
+import warnings
+
 import numpy as np
 from numpy.testing import *
 
@@ -167,5 +169,7 @@
             assert dtt is outp, \
                    'Expected %s from %s, got %s' % (outp, inp, dtt)
 
+warnings.simplefilter('ignore', category=DeprecationWarning)
+
 if __name__ == "__main__":
     run_module_suite()




More information about the Scipy-svn mailing list