[Scipy-svn] r3669 - branches/io_new
scipy-svn at scipy.org
scipy-svn at scipy.org
Sat Dec 15 17:40:28 EST 2007
Author: brian.hawthorne
Date: 2007-12-15 16:39:53 -0600 (Sat, 15 Dec 2007)
New Revision: 3669
Modified:
branches/io_new/__init__.py
branches/io_new/array_import.py
branches/io_new/data_store.py
branches/io_new/pickler.py
Log:
add stub deprecate_with_doc decorators
Modified: branches/io_new/__init__.py
===================================================================
--- branches/io_new/__init__.py 2007-12-15 22:19:46 UTC (rev 3668)
+++ branches/io_new/__init__.py 2007-12-15 22:39:53 UTC (rev 3669)
@@ -18,6 +18,8 @@
from recaster import sctype_attributes, Recaster
from array_import import read_array, write_array
+from data_store import save as save_as_module
+from data_store import load, create_module, create_shelf
from pickler import objload, objsave
from mmio import mminfo, mmread, mmwrite
Modified: branches/io_new/array_import.py
===================================================================
--- branches/io_new/array_import.py 2007-12-15 22:19:46 UTC (rev 3668)
+++ branches/io_new/array_import.py 2007-12-15 22:39:53 UTC (rev 3669)
@@ -17,7 +17,13 @@
# Numpy imports.
import numpy
-from numpy import array, take, concatenate, asarray, real, imag
+
+# snip on----- DELETE after numpy.deprecate_with_doc is available
+numpy.deprecate_with_doc = lambda doc: (lambda func: func)
+# snip off---- DELETE after numpy.deprecate_with_doc is available
+
+from numpy import array, take, concatenate, asarray, real, imag, \
+ deprecate_with_doc
# Sadly, this module is still written with typecodes in mind.
from numpy.oldnumeric import Float
@@ -310,6 +316,7 @@
return cols, atype
+ at deprecate_with_doc('')
def read_array(fileobject, separator=default, columns=default, comment="#",
lines=default, atype=Float, linesep='\n',
rowsize=10000, missing=0):
@@ -437,6 +444,7 @@
return row_sep.join(thestr)
+ at deprecate_with_doc('')
def write_array(fileobject, arr, separator=" ", linesep='\n',
precision=5, suppress_small=0, keep_open=0):
"""Write a rank-2 or less array to file represented by fileobject.
Modified: branches/io_new/data_store.py
===================================================================
--- branches/io_new/data_store.py 2007-12-15 22:19:46 UTC (rev 3668)
+++ branches/io_new/data_store.py 2007-12-15 22:39:53 UTC (rev 3669)
@@ -19,6 +19,15 @@
import dumb_shelve
import os
+# snip on----- DELETE after numpy.deprecate_with_doc is available
+import numpy
+numpy.deprecate_with_doc = lambda doc: (lambda func: func)
+# snip off---- DELETE after numpy.deprecate_with_doc is available
+
+from numpy deprecate_with_doc
+
+
+ at deprecate_with_doc('')
def load(module):
""" Load data into module from a shelf with
the same name as the module.
@@ -34,7 +43,7 @@
# print i, 'loaded...'
# print 'done'
-def save(file_name=None,data=None):
+def save_as_module(file_name=None,data=None):
""" Save the dictionary "data" into
a module and shelf named save
"""
@@ -42,6 +51,9 @@
create_module(file_name)
create_shelf(file_name,data)
+save = @deprecate_with_doc('')(save_as_module)
+
+ at deprecate_with_doc('')
def create_module(file_name):
""" Create the module file.
"""
@@ -53,6 +65,7 @@
f.write('data_store.load(%s)' % module_name)
f.close()
+ at deprecate_with_doc('')
def create_shelf(file_name,data):
"""Use this to write the data to a new file
"""
Modified: branches/io_new/pickler.py
===================================================================
--- branches/io_new/pickler.py 2007-12-15 22:19:46 UTC (rev 3668)
+++ branches/io_new/pickler.py 2007-12-15 22:39:53 UTC (rev 3669)
@@ -1,5 +1,13 @@
import cPickle
+# snip on----- DELETE after numpy.deprecate_with_doc is available
+import numpy
+numpy.deprecate_with_doc = lambda doc: (lambda func: func)
+# snip off---- DELETE after numpy.deprecate_with_doc is available
+
+from numpy deprecate_with_doc
+
+ at deprecate_with_doc('')
def objsave(file, allglobals, *args):
"""Pickle the part of a dictionary containing the argument list
into file string.
More information about the Scipy-svn
mailing list