[Scipy-svn] r6530 - in branches/0.8.x/scipy/io: . tests

scipy-svn@scip... scipy-svn@scip...
Fri Jun 18 08:10:39 CDT 2010


Author: rgommers
Date: 2010-06-18 08:10:38 -0500 (Fri, 18 Jun 2010)
New Revision: 6530

Removed:
   branches/0.8.x/scipy/io/array_import.py
   branches/0.8.x/scipy/io/fopen.py
   branches/0.8.x/scipy/io/npfile.py
   branches/0.8.x/scipy/io/pickler.py
   branches/0.8.x/scipy/io/tests/test_array_import.py
   branches/0.8.x/scipy/io/tests/test_npfile.py
Modified:
   branches/0.8.x/scipy/io/__init__.py
   branches/0.8.x/scipy/io/data_store.py
Log:
Remove deprecated objects in scipy.io on Python level.

Modified: branches/0.8.x/scipy/io/__init__.py
===================================================================
--- branches/0.8.x/scipy/io/__init__.py	2010-06-18 13:04:16 UTC (rev 6529)
+++ branches/0.8.x/scipy/io/__init__.py	2010-06-18 13:10:38 UTC (rev 6530)
@@ -6,11 +6,6 @@
 
 from numpy import deprecate
 
-# These are all deprecated (until the end deprecated tag)
-from npfile import npfile
-from data_store import save, load, create_module, create_shelf
-from array_import import read_array, write_array
-from pickler import objload, objsave
 
 from numpyio import packbits, unpackbits, bswap, fread, fwrite, \
      convert_objectarray

Deleted: branches/0.8.x/scipy/io/array_import.py
===================================================================
--- branches/0.8.x/scipy/io/array_import.py	2010-06-18 13:04:16 UTC (rev 6529)
+++ branches/0.8.x/scipy/io/array_import.py	2010-06-18 13:10:38 UTC (rev 6530)
@@ -1,500 +0,0 @@
-# Authors:  Travis Oliphant, Trent Oliphant
-# with support from Lee Barford's group at Agilent, Inc.
-#
-
-"""This module allows for the loading of an array from an ASCII
-Text File
-
-"""
-
-__all__ = ['read_array', 'write_array']
-
-# Standard library imports.
-import os
-import re
-import sys
-import types
-
-# Numpy imports.
-import numpy
-
-from numpy import array, take, concatenate, asarray, real, imag, \
-                  deprecate
-# Sadly, this module is still written with typecodes in mind.
-from numpy.oldnumeric import Float
-
-# Local imports.
-import numpyio
-
-default = None
-_READ_BUFFER_SIZE = 1024*1024
-#_READ_BUFFER_SIZE = 1000
-#_READ_BUFFER_SIZE = 160
-
-# ASCII Text object stream with automatic (un)compression and URL access.
-#
-# Adapted from
-#    TextFile class Written by: Konrad Hinsen <hinsen@cnrs-orleans.fr>
-#
-# Written by Travis Oliphant and Trent Oliphant
-#   with support from Agilent, Inc.
-#
-
-
-def convert_separator(sep):
-    newsep = ''
-    for k in sep:
-        if k in '.^$*+?{[\\|()':
-            newsep = newsep + '\\' + k
-        else:
-            newsep = newsep + k
-    return newsep
-
-def build_numberlist(lines):
-    if lines is default:
-        linelist = [-1]
-    else:
-        linelist = []
-        errstr = "Argument lines must be a sequence of integers and/or range tuples."
-        try:
-            for num in lines[:-1]:  # handle all but last element
-                if type(num) not in [types.IntType, types.TupleType]:
-                    raise ValueError, errstr
-                if isinstance(num, types.IntType):
-                    linelist.append(num)
-                else:
-                    if not 1 < len(num) < 4:
-                        raise ValueError, "Tuples must be valid range tuples."
-                    linelist.extend(range(*num))
-        except TypeError:
-            raise ValueError, errstr
-        num = lines[-1]
-        if type(num) is types.IntType:
-            linelist.append(num)
-        elif type(num) is types.TupleType:
-            if [types.IntType]*len(num) != map(type, num):
-                if len(num) > 1 and num[1] is not None:
-                    raise ValueError, errstr
-            if len(num) == 1:
-                linelist.extend([num[0],-1])
-            elif len(num) == 2:
-                if num[1] is None:
-                    linelist.extend([num[0], -1])
-                else:
-                    linelist.extend(range(*num))
-            elif len(num) == 3:
-                if num[1] is None:
-                    linelist.extend([num[0], -num[2]])
-                else:
-                    linelist.extend(range(*num))
-            else:
-                raise ValueError, errstr
-    return linelist
-
-def get_open_file(fileobject, mode='rb'):
-    try:
-        # this is the duck typing check: if fileobject
-        # can be used is os.path.expanduser, it is a string
-        # otherwise it is a fileobject
-        fileobject = os.path.expanduser(fileobject)
-
-        if mode[0]=='r' and not os.path.exists(fileobject):
-            raise IOError, (2, 'No such file or directory: '
-                            + fileobject)
-        else:
-            try:
-                file = open(fileobject, mode)
-            except IOError, details:
-                file = None
-                if type(details) == type(()):
-                    details = details + (fileobject,)
-                raise IOError, details
-    except (AttributeError, TypeError):
-        # it is assumed that the fileobject is a python
-        # file object if it can not be used in os.path.expanduser
-        file = fileobject
-
-    return file
-
-
-class ascii_stream(object):
-    """Text files with line iteration
-
-    Ascii_stream instances can be used like normal read-only file objects
-    (i.e. by calling readline() and readlines()), but can
-    also be used as sequences of lines in for-loops.
-
-    Finally, ascii_stream objects accept file names that start with '~' or
-    '~user' to indicate a home directory(for reading only).
-
-    Constructor: ascii_stream(|fileobject|, |lines|,|comment|),
-    where |fileobject| is either an open python file object or
-    the name of the file, |lines| is a sequence of integers
-    or tuples(indicating ranges) of lines to be read, |comment| is the
-    comment line identifier """
-
-    def __init__(self, fileobject, lines=default, comment="#",
-                 linesep='\n'):
-        if not isinstance(comment, types.StringType):
-            raise ValueError, "Comment must be a string."
-        self.linelist = build_numberlist(lines)
-        self.comment = comment
-        self.lencomment = len(comment)
-        self.file = get_open_file(fileobject, mode='r')
-        self.should_close_file = not (self.file is fileobject)
-        self._pos = self.file.tell()
-        self._lineindex = 0
-        if self.linelist[-1] < 0:
-            self._linetoget = self.linelist[-1]
-        else:
-            self._linetoget = 0
-        self._oldbuflines = 0
-        self._linesplitter = linesep
-        self._buffer = self.readlines(_READ_BUFFER_SIZE)
-        self._totbuflines = len(self._buffer)
-
-    def readlines(self, sizehint):
-        buffer = self.file.read(sizehint)
-        lines = buffer.split(self._linesplitter)
-        if len(buffer) < sizehint:  # EOF
-            if buffer == '':
-                return []
-            else:
-                return lines
-        else:
-            if len(lines) < 2:
-                raise ValueError, "Buffer size too small."
-            backup = len(lines[-1])
-            self.file.seek(-backup, 1)
-            return lines[:-1]
-
-    def __del__(self):
-        if hasattr(getattr(self, 'file', None),'close') and self.should_close_file:
-            self.file.close()
-
-    def __getitem__(self, item):
-        while 1:
-            line = self.readnextline()
-            if line is None:
-                raise IndexError
-            if len(line) < self.lencomment or line[:self.lencomment] != self.comment:
-                break
-        return line
-
-    def readnextline(self):
-        if self.linelist[self._lineindex] >= 0:
-            self._linetoget = self.linelist[self._lineindex]
-            self._lineindex += 1
-        else:
-            self._linetoget = self._linetoget - self.linelist[self._lineindex]
-        while self._linetoget >= self._totbuflines:
-            self._buffer = self.readlines(_READ_BUFFER_SIZE)
-            self._oldbuflines = self._totbuflines
-            self._totbuflines += len(self._buffer)
-            if (self._totbuflines == self._oldbuflines):
-                return None
-        line = self._buffer[self._linetoget - self._oldbuflines]
-        return line
-
-    def close(self):
-        self.file.close()
-
-    def flush(self):
-        self.file.flush()
-
-
-def move_past_spaces(firstline):
-    ind = 0
-    firstline = firstline.lstrip()
-    while firstline[ind] not in [' ','\n','\t','\v','\f','\r']:
-        ind += 1
-    return firstline[ind:], ind
-
-
-def extract_columns(arlist, collist, atype, missing):
-    if collist[-1] < 0:
-        if len(collist) == 1:
-            toconvlist = arlist[::-collist[-1]]
-        else:
-            toconvlist = take(arlist,collist[:-1],0)
-            toconvlist = concatenate((toconvlist,
-                                      arlist[(collist[-2]-collist[-1])::(-collist[-1])]))
-    else:
-        toconvlist = take(arlist, collist,0)
-
-    return numpyio.convert_objectarray(toconvlist, atype, missing)
-
-
-# Given a string representing one line, a separator tuple, a list of
-#  columns to read for each element of the atype list and a missing
-#  value to insert when conversion fails.
-
-# Regular expressions for detecting complex numbers and for dealing
-#  with spaces between the real and imaginary parts
-
-_obj = re.compile(r"""
-      ([0-9.eE]+)            # Real part
-      ([\t ]*)               # Space between real and imaginary part
-      ([+-])                 # +/- sign
-      ([\t ]*)               # 0 or more spaces
-      (([0-9.eE]+[iIjJ])
-      |([iIjJ][0-9.eE]+))    # Imaginary part
-      """, re.VERBOSE)
-
-_not_warned = 1
-def process_line(line, separator, collist, atype, missing):
-    global _not_warned
-    strlist = []
-    line = _obj.sub(r"\1\3\5",line)  # remove spaces between real
-                                     # and imaginary parts of complex numbers
-
-    if _not_warned:
-        warn = 0
-        if (_obj.search(line) is not None):
-            warn = 1
-            for k in range(len(atype)):
-                if atype[k] in numpy.typecodes['Complex']:
-                    warn = 0
-        if warn:
-            numpy.disp("Warning: Complex data detected, but no requested typecode was complex.")
-            _not_warned = 0
-    for mysep in separator[:-1]:
-        if mysep is None:
-            newline, ind = move_past_spaces(line)
-            strlist.append(line[:ind])
-            line = newline
-        else:
-            ind = line.find(mysep)
-            strlist.append(line[:ind])
-            line = line[ind+len(mysep):]
-    strlist.extend(line.split(separator[-1]))
-    arlist = array(strlist,'O')
-    N = len(atype)
-    vals = [None]*N
-    for k in range(len(atype)):
-        vals[k] = extract_columns(arlist, collist[k], atype[k], missing)
-    return vals
-
-def getcolumns(stream, columns, separator):
-    global _not_warned
-    comment = stream.comment
-    lenc = stream.lencomment
-    k, K = stream.linelist[0], len(stream._buffer)
-    while k < K:
-        firstline = stream._buffer[k]
-        if firstline != '' and firstline[:lenc] != comment:
-            break
-        k = k + 1
-    if k == K:
-        raise ValueError, "First line to read not within %d lines of top." % K
-    firstline = stream._buffer[k]
-    N = len(columns)
-    collist = [None]*N
-    colsize = [None]*N
-    for k in range(N):
-        collist[k] = build_numberlist(columns[k])
-    _not_warned = 0
-    val = process_line(firstline, separator, collist, [Float]*N, 0)
-    for k in range(N):
-        colsize[k] = len(val[k])
-    return colsize, collist
-
-def convert_to_equal_lists(cols, atype):
-    if not isinstance(cols, types.ListType):
-        cols = [cols]
-    if not isinstance(atype, types.ListType):
-        atype = [atype]
-    N = len(cols) - len(atype)
-    if N > 0:
-        atype.extend([atype[-1]]*N)
-    elif N < 0:
-        cols.extend([cols[-1]]*(-N))
-    return cols, atype
-
-
-@deprecate(message="""
-The functionality of read_array is in numpy.loadtxt which allows the same
-functionality using different syntax.
-""")
-def read_array(fileobject, separator=default, columns=default, comment="#",
-               lines=default, atype=Float, linesep='\n',
-               rowsize=10000, missing=0):
-    """Return an array or arrays from ascii_formatted data in |fileobject|.
-
-    Inputs:
-
-      fileobject -- An open file object or a string for a valid filename.
-                    The string can be prepended by "~/" or "~<name>/" to
-                    read a file from the home directory.
-      separator -- a string or a tuple of strings to indicate the column
-                   separators.  If the length of the string tuple is less
-                   than the total number of columns, then the last separator
-                   is assumed to be the separator for the rest of the columns.
-      columns -- a tuple of integers and range-tuples which describe the
-                 columns to read from the file.  A negative entry in the
-                 last column specifies the negative skip value to the end.
-                 Example:  columns=(1, 4, (5, 9), (11, 15, 3), 17, -2)
-                         will read [1,4,5,6,7,8,11,14,17,19,21,23,...]
-                 If multiple arrays are to be returned, then this argument
-                 should be an ordered list of such tuples.  There should be
-                 one entry in the list for each arraytype in the atype list.
-      lines   -- a tuple with the same structure as columns which indicates
-                 the lines to read.
-      comment -- the comment character (line will be ignored even if it is
-                 specified by the lines tuple)
-      linesep -- separator between rows.
-      missing -- value to insert in array when conversion to number fails.
-      atype -- the typecode of the output array.  If multiple outputs are
-               desired, then this should be a list of typecodes.  The columns
-               to fill the array represented by the given typecode is
-               determined from the columns argument.  If the length of atype
-               does not match the length of the columns list, then, the
-               smallest one is expanded to match the largest by repeatedly
-               copying the last entry.
-      rowsize -- the allocation row size (array grows by this amount as
-               data is read in).
-
-    Output -- the 1 or 2d array, or a tuple of output arrays of different
-              types, sorted in order of the first column to be placed
-              in the output array.
-
-    """
-
-    global _not_warned
-    # Make separator into a tuple of separators.
-    if type(separator) in [types.StringType, type(default)]:
-        sep = (separator,)
-    else:
-        sep = tuple(separator)
-    # Create ascii_object from |fileobject| argument.
-    ascii_object = ascii_stream(fileobject, lines=lines, comment=comment, linesep=linesep)
-    columns, atype = convert_to_equal_lists(columns, atype)
-    numout = len(atype)
-    # Get the number of columns to read and expand the columns argument
-    colsize, collist = getcolumns(ascii_object, columns, sep)
-    # Intialize the output arrays
-    outrange = range(numout)
-    outarr = []
-    typecodes = "".join(numpy.typecodes.values())
-    for k in outrange:
-        if not atype[k] in typecodes:
-            raise ValueError, "One of the array types is invalid, k=%d" % k
-        outarr.append(numpy.zeros((rowsize, colsize[k]),atype[k]))
-    row = 0
-    block_row = 0
-    _not_warned = 1
-    for line in ascii_object:
-        if line.strip() == '':
-            continue
-        vals = process_line(line, sep, collist, atype, missing)
-        for k in outrange:
-            outarr[k][row] = vals[k]
-        row += 1
-        block_row += 1
-        if block_row >= rowsize:
-            for k in outrange:
-                outarr[k].resize((outarr[k].shape[0] + rowsize,colsize[k]))
-            block_row = 0
-    for k in outrange:
-        if outarr[k].shape[0] != row:
-            outarr[k].resize((row,colsize[k]))
-        a = outarr[k]
-        if a.shape[0] == 1 or a.shape[1] == 1:
-            outarr[k] = numpy.ravel(a)
-    if len(outarr) == 1:
-        return outarr[0]
-    else:
-        return tuple(outarr)
-
-
-# takes 1-d array and returns a string
-def str_array(arr, precision=5,col_sep=' ',row_sep="\n",ss=0):
-    thestr = []
-    arr = asarray(arr)
-    N,M = arr.shape
-    thistype = arr.dtype.char
-    nofloat = (thistype in '1silbwu') or (thistype in 'Oc')
-    cmplx = thistype in 'FD'
-    fmtstr = "%%.%de" % precision
-    cmpnum = pow(10.0,-precision)
-    for n in xrange(N):
-        theline = []
-        for m in xrange(M):
-            val = arr[n,m]
-            if ss and abs(val) < cmpnum:
-                val = 0*val
-            if nofloat or val==0:
-                thisval = str(val)
-            elif cmplx:
-                rval = real(val)
-                ival = imag(val)
-                thisval = eval('fmtstr % rval')
-                if (ival >= 0):
-                    istr = eval('fmtstr % ival')
-                    thisval = '%s+j%s' % (thisval, istr)
-                else:
-                    istr = eval('fmtstr % abs(ival)')
-                    thisval = '%s-j%s' % (thisval, istr)
-            else:
-                thisval = eval('fmtstr % val')
-            theline.append(thisval)
-        strline = col_sep.join(theline)
-        thestr.append(strline)
-    return row_sep.join(thestr)
-
-
-@deprecate(message="""
-This function is replaced by numpy.savetxt which allows the same functionality
-through a different syntax.
-""")
-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.
-
-    Inputs:
-
-      fileobject -- An open file object or a string to a valid filename.
-      arr -- The array to write.
-      separator -- separator to write between elements of the array.
-      linesep -- separator to write between rows of array
-      precision -- number of digits after the decimal place to write.
-      suppress_small -- non-zero to round small numbers down to 0.0
-      keep_open = non-zero to return the open file, otherwise, the file is closed.
-    Outputs:
-
-      file -- The open file (if keep_open is non-zero)
-    """
-    # XXX: What to when appending to files ? 'wa' does not do what one might
-    # expect, and opening a file twice to create it first is not easily doable
-    # with get_open_file ?
-    file = get_open_file(fileobject, mode='w')
-    rank = numpy.rank(arr)
-    if rank > 2:
-        raise ValueError, "Can-only write up to 2-D arrays."
-
-    if rank == 0:
-        h = 1
-        arr = numpy.reshape(arr, (1,1))
-    elif rank == 1:
-        h = numpy.shape(arr)[0]
-        arr = numpy.reshape(arr, (h,1))
-    else:
-        h = numpy.shape(arr)[0]
-        arr = asarray(arr)
-
-    for ch in separator:
-        if ch in '0123456789-+FfeEgGjJIi.':
-            raise ValueError, "Bad string for separator"
-
-    astr = str_array(arr, precision=precision,
-                     col_sep=separator, row_sep=linesep,
-                     ss = suppress_small)
-    file.write(astr)
-    file.write('\n')
-    if keep_open:
-        return file
-    else:
-        if file is sys.stdout or file is sys.stderr:
-            return
-        file.close()
-    return

Modified: branches/0.8.x/scipy/io/data_store.py
===================================================================
--- branches/0.8.x/scipy/io/data_store.py	2010-06-18 13:04:16 UTC (rev 6529)
+++ branches/0.8.x/scipy/io/data_store.py	2010-06-18 13:10:38 UTC (rev 6530)
@@ -15,39 +15,12 @@
     1
 """
 
-__all__ = ['save_as_module',
-           # The rest of these are all deprecated
-           'save', 'create_module',
-           'create_shelf', 'load']
+__all__ = ['save_as_module']
 
 import dumb_shelve
 import os
 
-from numpy import deprecate
 
-def _load(module):
-    """ Load data into module from a shelf with
-        the same name as the module.
-    """
-    dir,filename = os.path.split(module.__file__)
-    filebase = filename.split('.')[0]
-    fn = os.path.join(dir, filebase)
-    f = dumb_shelve.open(fn, "r")
-    #exec( 'import ' + module.__name__)
-    for i in f.keys():
-        exec( 'import ' + module.__name__+ ';' +
-              module.__name__+'.'+i + '=' + 'f["' + i + '"]')
-#       print i, 'loaded...'
-#   print 'done'
-
-load = deprecate(_load, message="""
-This is an internal function used with scipy.io.save_as_module
-
-If you are saving arrays into a module, you should think about using
-HDF5 or .npz files instead.
-""")
-
-
 def _create_module(file_name):
     """ Create the module file.
     """
@@ -59,13 +32,7 @@
         f.write('data_store._load(%s)' % module_name)
         f.close()
 
-create_module = deprecate(_create_module, message="""
-This is an internal function used with scipy.io.save_as_module
 
-If you are saving arrays into a module, you should think about
-using HDF5 or .npz files instead.
-""")
-
 def _create_shelf(file_name,data):
     """Use this to write the data to a new file
     """
@@ -77,14 +44,7 @@
 #   print 'done'
     f.close()
 
-create_shelf = deprecate(_create_shelf, message="""
-This is an internal function used with scipy.io.save_as_module
 
-If you are saving arrays into a module, you should think about using
-HDF5 or .npz files instead.
-""")
-
-
 def save_as_module(file_name=None,data=None):
     """
     Save the dictionary "data" into a module and shelf named save.
@@ -100,4 +60,3 @@
     _create_module(file_name)
     _create_shelf(file_name,data)
 
-save = deprecate(save_as_module, old_name='save', new_name='save_as_module')

Deleted: branches/0.8.x/scipy/io/fopen.py
===================================================================
--- branches/0.8.x/scipy/io/fopen.py	2010-06-18 13:04:16 UTC (rev 6529)
+++ branches/0.8.x/scipy/io/fopen.py	2010-06-18 13:10:38 UTC (rev 6530)
@@ -1,356 +0,0 @@
-# Author: Travis Oliphant
-
-import struct
-import sys
-import types
-
-from numpy import *
-import numpyio
-
-import warnings
-warnings.warn('fopen module is deprecated, please use npfile instead',
-              DeprecationWarning, stacklevel=2)
-
-LittleEndian = (sys.byteorder == 'little')
-
-__all__ = ['fopen']
-
-def getsize_type(mtype):
-    if mtype in ['B','uchar','byte','unsigned char','integer*1', 'int8']:
-        mtype = 'B'
-    elif mtype in ['S1', 'char', 'char*1']:
-        mtype = 'B'
-    elif mtype in ['b', 'schar', 'signed char']:
-        mtype = 'b'
-    elif mtype in ['h','short','int16','integer*2']:
-        mtype = 'h'
-    elif mtype in ['H','ushort','uint16','unsigned short']:
-        mtype = 'H'
-    elif mtype in ['i','int']:
-        mtype = 'i'
-    elif mtype in ['I','uint','uint32','unsigned int']:
-        mtype = 'I'
-    elif mtype in ['u4','int32','integer*4']:
-        mtype = 'u4'
-    elif mtype in ['f','float','float32','real*4', 'real']:
-        mtype = 'f'
-    elif mtype in ['d','double','float64','real*8', 'double precision']:
-        mtype = 'd'
-    elif mtype in ['F','complex float','complex*8','complex64']:
-        mtype = 'F'
-    elif mtype in ['D','complex*16','complex128','complex','complex double']:
-        mtype = 'D'
-    else:
-        mtype = obj2sctype(mtype)
-
-    newarr = empty((1,),mtype)
-    return newarr.itemsize, newarr.dtype.char
-
-class fopen(object):
-    """Class for reading and writing binary files into numpy arrays.
-
-    Inputs:
-
-      file_name -- The complete path name to the file to open.
-      permission -- Open the file with given permissions: ('r', 'H', 'a')
-                    for reading, writing, or appending.  This is the same
-                    as the mode argument in the builtin open command.
-      format -- The byte-ordering of the file:
-                (['native', 'n'], ['ieee-le', 'l'], ['ieee-be', 'B']) for
-                native, little-endian, or big-endian respectively.
-
-    Attributes (Read only):
-
-      bs -- non-zero if byte-swapping is performed on read and write.
-      format -- 'native', 'ieee-le', or 'ieee-be'
-      closed -- non-zero if the file is closed.
-      mode -- permissions with which this file was opened
-      name -- name of the file
-    """
-
-#    Methods:
-#
-#      read -- read data from file and return numpy array
-#      write -- write to file from numpy array
-#      fort_read -- read Fortran-formatted binary data from the file.
-#      fort_write -- write Fortran-formatted binary data to the file.
-#      rewind -- rewind to beginning of file
-#      size -- get size of file
-#      seek -- seek to some position in the file
-#      tell -- return current position in file
-#      close -- close the file
-
-    def __init__(self,file_name,permission='rb',format='n'):
-        if 'b' not in permission: permission += 'b'
-        if isinstance(file_name, basestring):
-            self.file = file(file_name, permission)
-        elif isinstance(file_name, file) and not file_name.closed:
-            # first argument is an open file
-            self.file = file_name
-        else:
-            raise TypeError, 'Need filename or open file as input'
-        self.setformat(format)
-
-    def __del__(self):
-        try:
-            self.file.close()
-        except:
-            pass
-
-    def close(self):
-        self.file.close()
-
-    def seek(self, *args):
-        self.file.seek(*args)
-
-    def tell(self):
-        return self.file.tell()
-
-    def raw_read(self, size=-1):
-        """Read raw bytes from file as string."""
-        return self.file.read(size)
-
-    def raw_write(self, str):
-        """Write string to file as raw bytes."""
-        return self.file.write(str)
-
-    def setformat(self, format):
-        """Set the byte-order of the file."""
-        if format in ['native','n','default']:
-            self.bs = False
-            self.format = 'native'
-        elif format in ['ieee-le','l','little-endian','le']:
-            self.bs = not LittleEndian
-            self.format = 'ieee-le'
-        elif format in ['ieee-be','B','big-endian','be']:
-            self.bs = LittleEndian
-            self.format = 'ieee-be'
-        else:
-            raise ValueError, "Unrecognized format: " + format
-        return
-
-    def write(self,data,mtype=None,bs=None):
-        """Write to open file object the flattened numpy array data.
-
-        Inputs:
-
-          data -- the numpy array to write.
-          mtype -- a string indicating the binary type to write.
-                   The default is the type of data. If necessary a cast is made.
-                   unsigned byte  : 'B', 'uchar', 'byte' 'unsigned char', 'int8',
-                                    'integer*1'
-                   character      : 'S1', 'char', 'char*1'
-                   signed char    : 'b', 'schar', 'signed char'
-                   short          : 'h', 'short', 'int16', 'integer*2'
-                   unsigned short : 'H', 'ushort','uint16','unsigned short'
-                   int            : 'i', 'int'
-                   unsigned int   : 'I', 'uint32','uint','unsigned int'
-                   int32           : 'u4', 'int32', 'integer*4'
-                   float          : 'f', 'float', 'float32', 'real*4'
-                   double         : 'd', 'double', 'float64', 'real*8'
-                   complex float  : 'F', 'complex float', 'complex*8', 'complex64'
-                   complex double : 'D', 'complex', 'complex double', 'complex*16',
-                                    'complex128'
-        """
-        if bs is None:
-            bs = self.bs
-        else:
-            bs = (bs == 1)
-        if isinstance(data, str):
-            N, buf = len(data), buffer(data)
-            data = ndarray(shape=(N,),dtype='B',buffer=buf)
-        else:
-            data = asarray(data)
-        if mtype is None:
-            mtype = data.dtype.char
-        howmany,mtype = getsize_type(mtype)
-        count = product(data.shape,axis=0)
-        numpyio.fwrite(self.file,count,data,mtype,bs)
-        return
-
-    fwrite = write
-
-    def read(self,count,stype,rtype=None,bs=None,c_is_b=0):
-        """Read data from file and return it in a numpy array.
-
-        Inputs:
-
-          count -- an integer specifying the number of elements of type
-                   stype to read or a tuple indicating the shape of
-                   the output array.
-          stype -- The data type of the stored data (see fwrite method).
-          rtype -- The type of the output array.  Same as stype if None.
-          bs -- Whether or not to byteswap (or use self.bs if None)
-          c_is_b --- If non-zero then the count is an integer
-                   specifying the total number of bytes to read
-                   (must be a multiple of the size of stype).
-
-        Outputs: (output,)
-
-          output -- a numpy array of type rtype.
-        """
-        if bs is None:
-            bs = self.bs
-        else:
-            bs = (bs == 1)
-        howmany,stype = getsize_type(stype)
-        shape = None
-        if c_is_b:
-            if count % howmany != 0:
-                raise ValueError, "When c_is_b is non-zero then " \
-                      "count is bytes\nand must be multiple of basic size."
-            count = count / howmany
-        elif type(count) in [types.TupleType, types.ListType]:
-            shape = list(count)
-            # allow -1 to specify unknown dimension size as in reshape
-            minus_ones = shape.count(-1)
-            if minus_ones == 0:
-                count = product(shape,axis=0)
-            elif minus_ones == 1:
-                now = self.tell()
-                self.seek(0,2)
-                end = self.tell()
-                self.seek(now)
-                remaining_bytes = end - now
-                know_dimensions_size = -product(count,axis=0) * getsize_type(stype)[0]
-                unknown_dimension_size, illegal = divmod(remaining_bytes,
-                                                         know_dimensions_size)
-                if illegal:
-                    raise ValueError("unknown dimension doesn't match filesize")
-                shape[shape.index(-1)] = unknown_dimension_size
-                count = product(shape,axis=0)
-            else:
-                raise ValueError(
-                    "illegal count; can only specify one unknown dimension")
-            shape = tuple(shape)
-        if rtype is None:
-            rtype = stype
-        else:
-            howmany,rtype = getsize_type(rtype)
-        if count == 0:
-            return zeros(0,rtype)
-        retval = numpyio.fread(self.file, count, stype, rtype, bs)
-        if shape is not None:
-            retval = resize(retval, shape)
-        return retval
-
-    fread = read
-
-    def rewind(self,howmany=None):
-        """Rewind a file to its beginning or by a specified amount.
-        """
-        if howmany is None:
-            self.seek(0)
-        else:
-            self.seek(-howmany,1)
-
-    def size(self):
-        """Return the size of the file.
-        """
-        try:
-            sz = self.thesize
-        except AttributeError:
-            curpos = self.tell()
-            self.seek(0,2)
-            sz = self.tell()
-            self.seek(curpos)
-            self.thesize = sz
-        return sz
-
-    def fort_write(self,fmt,*args):
-        """Write a Fortran binary record.
-
-        Inputs:
-
-          fmt -- If a string then it represents the same format string as
-                 used by struct.pack.  The remaining arguments are passed
-                 to struct.pack.
-
-                 If fmt is an array, then this array will be written as
-                 a Fortran record using the output type args[0].
-
-          *args -- Arguments representing data to write.
-        """
-        if self.format == 'ieee-le':
-            nfmt = "<i"
-        elif self.format == 'ieee-be':
-            nfmt = ">i"
-        else:
-            nfmt = "i"
-        if isinstance(fmt, basestring):
-            if self.format == 'ieee-le':
-                fmt = "<"+fmt
-            elif self.format == 'ieee-be':
-                fmt = ">"+fmt
-            str = apply(struct.pack,(fmt,)+args)
-            strlen = struct.pack(nfmt,len(str))
-            self.write(strlen)
-            self.write(str)
-            self.write(strlen)
-        elif type(fmt) == type(array([0])):
-            if len(args) > 0:
-                sz,mtype = getsize_type(args[0])
-            else:
-                sz,mtype = getsize_type(fmt.dtype.char)
-            count = product(fmt.shape,axis=0)
-            strlen = struct.pack(nfmt,count*sz)
-            self.write(strlen)
-            numpyio.fwrite(self.file,count,fmt,mtype,self.bs)
-            self.write(strlen)
-        else:
-            raise TypeError, "Unknown type in first argument"
-
-    def fort_read(self,fmt,dtype=None):
-        """Read a Fortran binary record.
-
-        Inputs:
-
-          fmt -- If dtype is not given this represents a struct.pack
-                 format string to interpret the next record.  Otherwise this
-                 argument is ignored.
-          dtype -- If dtype is not None, then read in the next record as
-                   an array of type dtype.
-
-        Outputs: (data,)
-
-          data -- If dtype is None, then data is a tuple containing the output
-                  of struct.unpack on the next Fortan record.
-                  If dtype is a datatype string, then the next record is
-                  read in as a 1-D array of type datatype.
-        """
-        lookup_dict = {'ieee-le':"<",'ieee-be':">",'native':''}
-        if dtype is None:
-            fmt = lookup_dict[self.format] + fmt
-            numbytes = struct.calcsize(fmt)
-            nn = struct.calcsize("i");
-            if (self.raw_read(nn) == ''):
-                raise ValueError, "Unexpected end of file..."
-            strdata = self.raw_read(numbytes)
-            if strdata == '':
-                raise ValueError, "Unexpected end of file..."
-            data = struct.unpack(fmt,strdata)
-            if (self.raw_read(nn) == ''):
-                raise ValueError, "Unexpected end of file..."
-            return data
-        else:  # Ignore format string and read in next record as an array.
-            fmt = lookup_dict[self.format] + "i"
-            nn = struct.calcsize(fmt)
-            nbytestr = self.raw_read(nn)
-            if nbytestr == '':
-                raise ValueError, "Unexpected end of file..."
-            nbytes = struct.unpack(fmt,nbytestr)[0]
-            howmany, dtype = getsize_type(dtype)
-            ncount = nbytes / howmany
-            if ncount*howmany != nbytes:
-                self.rewind(4)
-                raise ValueError, "A mismatch between the type requested and the data stored."
-            if ncount < 0:
-                raise ValueError, "Negative number of bytes to read:\n    file is probably not opened with correct endian-ness."
-            if ncount == 0:
-                raise ValueError, "End of file?  Zero-bytes to read."
-            retval = numpyio.fread(self.file, ncount, dtype, dtype, self.bs)
-            if len(retval) == 1:
-                retval = retval[0]
-            if (self.raw_read(nn) == ''):
-                raise ValueError, "Unexpected end of file..."
-            return retval

Deleted: branches/0.8.x/scipy/io/npfile.py
===================================================================
--- branches/0.8.x/scipy/io/npfile.py	2010-06-18 13:04:16 UTC (rev 6529)
+++ branches/0.8.x/scipy/io/npfile.py	2010-06-18 13:10:38 UTC (rev 6530)
@@ -1,232 +0,0 @@
-# Authors: Matthew Brett, Travis Oliphant
-
-"""
-Class for reading and writing numpy arrays from / to binary files
-"""
-
-import sys
-
-import numpy as np
-
-__all__ = ['sys_endian_code', 'npfile']
-
-sys_endian_code = (sys.byteorder == 'little') and '<' or '>'
-
-class npfile(object):
-    ''' Class for reading and writing numpy arrays to/from files
-
-    Inputs:
-      file_name -- The complete path name to the file to open
-                   or an open file-like object
-      permission -- Open the file with given permissions: ('r', 'w', 'a')
-                    for reading, writing, or appending.  This is the same
-                    as the mode argument in the builtin open command.
-      format -- The byte-ordering of the file:
-                (['native', 'n'], ['ieee-le', 'l'], ['ieee-be', 'B']) for
-                native, little-endian, or big-endian respectively.
-
-    Attributes:
-      endian   -- default endian code for reading / writing
-      order    -- default order for reading writing ('C' or 'F')
-      file     -- file object containing read / written data
-
-    Methods:
-      seek, tell, close  -- as for file objects
-      rewind             -- set read position to beginning of file
-      read_raw           -- read string data from file (read method of file)
-      write_raw          -- write string data to file (write method of file)
-      read_array         -- read numpy array from binary file data
-      write_array        -- write numpy array contents to binary file
-
-    Example use:
-    >>> from StringIO import StringIO
-    >>> import numpy as np
-    >>> from scipy.io import npfile
-    >>> arr = np.arange(10).reshape(5,2)
-    >>> # Make file-like object (could also be file name)
-    >>> my_file = StringIO()
-    >>> npf = npfile(my_file)
-    >>> npf.write_array(arr)
-    >>> npf.rewind()
-    >>> npf.read_array((5,2), arr.dtype)
-    >>> npf.close()
-    >>> # Or read write in Fortran order, Big endian
-    >>> # and read back in C, system endian
-    >>> my_file = StringIO()
-    >>> npf = npfile(my_file, order='F', endian='>')
-    >>> npf.write_array(arr)
-    >>> npf.rewind()
-    >>> npf.read_array((5,2), arr.dtype)
-    '''
-
-    def __init__(self, file_name,
-                 permission='rb',
-                 endian = 'dtype',
-                 order = 'C'):
-        if 'b' not in permission: permission += 'b'
-        if isinstance(file_name, basestring):
-            self.file = file(file_name, permission)
-        else:
-            try:
-                closed = file_name.closed
-            except AttributeError:
-                raise TypeError, 'Need filename or file object as input'
-            if closed:
-                raise TypeError, 'File object should be open'
-            self.file = file_name
-        self.endian = endian
-        self.order = order
-
-    def get_endian(self):
-        return self._endian
-    def set_endian(self, endian_code):
-        self._endian = self.parse_endian(endian_code)
-    endian = property(get_endian, set_endian, None, 'get/set endian code')
-
-    def parse_endian(self, endian_code):
-        ''' Returns valid endian code from wider input options'''
-        if endian_code in ['native', 'n', 'N','default', '=']:
-            return sys_endian_code
-        elif endian_code in ['swapped', 's', 'S']:
-            return sys_endian_code == '<' and '>' or '<'
-        elif endian_code in ['ieee-le','l','L','little-endian',
-                             'little','le','<']:
-            return '<'
-        elif endian_code in ['ieee-be','B','b','big-endian',
-                             'big','be', '>']:
-            return '>'
-        elif endian_code == 'dtype':
-            return 'dtype'
-        else:
-            raise ValueError, "Unrecognized endian code: " + endian_code
-        return
-
-    def __del__(self):
-        try:
-            self.file.close()
-        except:
-            pass
-
-    def close(self):
-        self.file.close()
-
-    def seek(self, *args):
-        self.file.seek(*args)
-
-    def tell(self):
-        return self.file.tell()
-
-    def rewind(self,howmany=None):
-        """Rewind a file to its beginning or by a specified amount.
-        """
-        if howmany is None:
-            self.seek(0)
-        else:
-            self.seek(-howmany,1)
-
-    def read_raw(self, size=-1):
-        """Read raw bytes from file as string."""
-        return self.file.read(size)
-
-    def write_raw(self, str):
-        """Write string to file as raw bytes."""
-        return self.file.write(str)
-
-    def remaining_bytes(self):
-        cur_pos = self.tell()
-        self.seek(0, 2)
-        end_pos = self.tell()
-        self.seek(cur_pos)
-        return end_pos - cur_pos
-
-    def _endian_order(self, endian, order):
-        ''' Housekeeping function to return endian, order from input args '''
-        if endian is None:
-            endian = self.endian
-        else:
-            endian = self.parse_endian(endian)
-        if order is None:
-            order = self.order
-        return endian, order
-
-    def _endian_from_dtype(self, dt):
-        dt_endian = dt.byteorder
-        if dt_endian == '=':
-            dt_endian = sys_endian_code
-        return dt_endian
-
-    def write_array(self, data, endian=None, order=None):
-        ''' Write to open file object the flattened numpy array data
-
-        Inputs
-        data      - numpy array or object convertable to array
-        endian    - endianness of written data
-                    (can be None, 'dtype', '<', '>')
-                    (if None, get from self.endian)
-        order     - order of array to write (C, F)
-                    (if None from self.order)
-        '''
-        endian, order = self._endian_order(endian, order)
-        data = np.asarray(data)
-        dt_endian = self._endian_from_dtype(data.dtype)
-        if not endian == 'dtype':
-            if dt_endian != endian:
-                data = data.byteswap()
-        self.file.write(data.tostring(order=order))
-
-    def read_array(self, dt, shape=-1, endian=None, order=None):
-        '''Read data from file and return it in a numpy array.
-
-        Inputs
-        ------
-        dt        - dtype of array to be read
-        shape     - shape of output array, or number of elements
-                    (-1 as number of elements or element in shape
-                    means unknown dimension as in reshape; size
-                    of array calculated from remaining bytes in file)
-        endian    - endianness of data in file
-                    (can be None, 'dtype', '<', '>')
-                    (if None, get from self.endian)
-        order     - order of array in file (C, F)
-                    (if None get from self.order)
-
-        Outputs
-        arr       - array from file with given dtype (dt)
-        '''
-        endian, order = self._endian_order(endian, order)
-        dt = np.dtype(dt)
-        try:
-            shape = list(shape)
-        except TypeError:
-            shape = [shape]
-        minus_ones = shape.count(-1)
-        if minus_ones == 0:
-            pass
-        elif minus_ones == 1:
-            known_dimensions_size = -np.product(shape,axis=0) * dt.itemsize
-            unknown_dimension_size, illegal = divmod(self.remaining_bytes(),
-                                                     known_dimensions_size)
-            if illegal:
-                raise ValueError("unknown dimension doesn't match filesize")
-            shape[shape.index(-1)] = unknown_dimension_size
-        else:
-            raise ValueError(
-                "illegal -1 count; can only specify one unknown dimension")
-        sz = dt.itemsize * np.product(shape)
-        dt_endian = self._endian_from_dtype(dt)
-        buf = self.file.read(sz)
-        arr = np.ndarray(shape=shape,
-                         dtype=dt,
-                         buffer=buf,
-                         order=order)
-        if (not endian == 'dtype') and (dt_endian != endian):
-            return arr.byteswap()
-        return arr.copy()
-
-npfile = np.deprecate(npfile, message="""
-You can achieve the same effect as using npfile using numpy.save and
-numpy.load.
-
-You can use memory-mapped arrays and data-types to map out a
-file format for direct manipulation in NumPy.
-""")

Deleted: branches/0.8.x/scipy/io/pickler.py
===================================================================
--- branches/0.8.x/scipy/io/pickler.py	2010-06-18 13:04:16 UTC (rev 6529)
+++ branches/0.8.x/scipy/io/pickler.py	2010-06-18 13:10:38 UTC (rev 6530)
@@ -1,38 +0,0 @@
-import cPickle
-
-from numpy import deprecate
-
-@deprecate(message="""
-Just use cPickle.dump directly or numpy.savez
-""")
-def objsave(file, allglobals, *args):
-    """Pickle the part of a dictionary containing the argument list
-    into file string.
-
-    Syntax:  objsave(file, globals(), obj1, obj2, ... )
-    """
-    fid = open(file,'w')
-    savedict = {}
-    for key in allglobals.keys():
-        inarglist = 0
-        for obj in args:
-            if allglobals[key] is obj:
-                inarglist = 1
-                break
-        if inarglist:
-            savedict[key] = obj
-    cPickle.dump(savedict,fid,1)
-    fid.close()
-
-@deprecate(message="""
-Just use cPickle.load or numpy.load.
-""")
-def objload(file, allglobals):
-    """Load a previously pickled dictionary and insert into given dictionary.
-
-    Syntax:  objload(file, globals())
-    """
-    fid = open(file,'r')
-    savedict = cPickle.load(fid)
-    allglobals.update(savedict)
-    fid.close()

Deleted: branches/0.8.x/scipy/io/tests/test_array_import.py
===================================================================
--- branches/0.8.x/scipy/io/tests/test_array_import.py	2010-06-18 13:04:16 UTC (rev 6529)
+++ branches/0.8.x/scipy/io/tests/test_array_import.py	2010-06-18 13:10:38 UTC (rev 6530)
@@ -1,68 +0,0 @@
-#!/usr/bin/env python
-
-# This python script tests the numpyio module.
-# also check out numpyio.fread.__doc__ and other method docstrings.
-
-import os
-from numpy.testing import *
-import scipy.io as io
-from scipy.io import numpyio
-from scipy.io import array_import
-
-import numpy.oldnumeric as N
-import tempfile
-
-class TestNumpyio(TestCase):
-    def test_basic(self):
-        # Generate some data
-        a = 255*rand(20)
-        # Open a file
-        fname = tempfile.mktemp('.dat')
-        fid = open(fname,"wb")
-        # Write the data as shorts
-        numpyio.fwrite(fid,20,a,N.Int16)
-        fid.close()
-        # Reopen the file and read in data
-        fid = open(fname,"rb")
-        if verbose >= 3:
-            print "\nDon't worry about a warning regarding the number of bytes read."
-        b = numpyio.fread(fid,1000000,N.Int16,N.Int)
-        fid.close()
-        assert(N.product(a.astype(N.Int16) == b,axis=0))
-        os.remove(fname)
-
-class TestReadArray(TestCase):
-    def test_complex(self):
-        a = rand(13,4) + 1j*rand(13,4)
-        fname = tempfile.mktemp('.dat')
-        io.write_array(fname,a)
-        b = io.read_array(fname,atype=N.Complex)
-        assert_array_almost_equal(a,b,decimal=4)
-        os.remove(fname)
-
-    def test_float(self):
-        a = rand(3,4)*30
-        fname = tempfile.mktemp('.dat')
-        io.write_array(fname,a)
-        b = io.read_array(fname)
-        assert_array_almost_equal(a,b,decimal=4)
-        os.remove(fname)
-
-    def test_integer(self):
-        from scipy import stats
-        a = stats.randint.rvs(1,20,size=(3,4))
-        fname = tempfile.mktemp('.dat')
-        io.write_array(fname,a)
-        b = io.read_array(fname,atype=a.dtype.char)
-        assert_array_equal(a,b)
-        os.remove(fname)
-
-class TestRegression(TestCase):
-    def test_get_open_file_works_with_filelike_objects(self):
-        f = tempfile.TemporaryFile()
-        f2 = array_import.get_open_file(f)
-        assert f2 is f
-        f.close()
-
-if __name__ == "__main__":
-    run_module_suite()

Deleted: branches/0.8.x/scipy/io/tests/test_npfile.py
===================================================================
--- branches/0.8.x/scipy/io/tests/test_npfile.py	2010-06-18 13:04:16 UTC (rev 6529)
+++ branches/0.8.x/scipy/io/tests/test_npfile.py	2010-06-18 13:10:38 UTC (rev 6530)
@@ -1,105 +0,0 @@
-import os
-from StringIO import StringIO
-from tempfile import mkstemp
-from numpy.testing import *
-import numpy as np
-
-from scipy.io.npfile import npfile, sys_endian_code
-
-class TestNpFile(TestCase):
-
-    def test_init(self):
-        fd, fname = mkstemp()
-        os.close(fd)
-        npf = npfile(fname)
-        arr = np.reshape(np.arange(10), (5,2))
-        self.assertRaises(IOError, npf.write_array, arr)
-        npf.close()
-        npf = npfile(fname, 'w')
-        npf.write_array(arr)
-        npf.rewind()
-        self.assertRaises(IOError, npf.read_array,
-                          arr.dtype, arr.shape)
-        npf.close()
-        os.remove(fname)
-
-        npf = npfile(StringIO(), endian='>', order='F')
-        assert npf.endian == '>', 'Endian not set correctly'
-        assert npf.order == 'F', 'Order not set correctly'
-        npf.endian = '<'
-        assert npf.endian == '<', 'Endian not set correctly'
-
-    def test_parse_endian(self):
-        npf = npfile(StringIO())
-        swapped_code = sys_endian_code == '<' and '>' or '<'
-        assert npf.parse_endian('native') == sys_endian_code
-        assert npf.parse_endian('swapped') == swapped_code
-        assert npf.parse_endian('l') == '<'
-        assert npf.parse_endian('B') == '>'
-        assert npf.parse_endian('dtype') == 'dtype'
-        self.assertRaises(ValueError, npf.parse_endian, 'nonsense')
-
-    def test_read_write_raw(self):
-        npf = npfile(StringIO())
-        str = 'test me with this string'
-        npf.write_raw(str)
-        npf.rewind()
-        assert str == npf.read_raw(len(str))
-
-    def test_remaining_bytes(self):
-        npf = npfile(StringIO())
-        assert npf.remaining_bytes() == 0
-        npf.write_raw('+' * 10)
-        assert npf.remaining_bytes() == 0
-        npf.rewind()
-        assert npf.remaining_bytes() == 10
-        npf.seek(5)
-        assert npf.remaining_bytes() == 5
-
-    def test_read_write_array(self):
-        npf = npfile(StringIO())
-        arr = np.reshape(np.arange(10), (5,2))
-        # Arr as read in fortran order
-        f_arr = arr.reshape((2,5)).T
-        # Arr written in fortran order read in C order
-        cf_arr = arr.T.reshape((5,2))
-        # Byteswapped array
-        bo = arr.dtype.byteorder
-        swapped_code = sys_endian_code == '<' and '>' or '<'
-        if bo in ['=', sys_endian_code]:
-            nbo = swapped_code
-        else:
-            nbo = sys_endian_code
-        bs_arr = arr.newbyteorder(nbo)
-        adt = arr.dtype
-        shp = arr.shape
-        npf.write_array(arr)
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt), arr.flatten())
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt, shp), arr)
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt, shp, endian=swapped_code),
-                           bs_arr)
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt, shp, order='F'),
-                           f_arr)
-        npf.rewind()
-        npf.write_array(arr, order='F')
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt), arr.flatten('F'))
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt, shp),
-                           cf_arr)
-
-        npf = npfile(StringIO(), endian='swapped', order='F')
-        npf.write_array(arr)
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt, shp), arr)
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt, shp, endian='dtype'), bs_arr)
-        npf.rewind()
-        assert_array_equal(npf.read_array(adt, shp, order='C'), cf_arr)
-
-if __name__ == "__main__":
-    run_module_suite()



More information about the Scipy-svn mailing list