From scipy-svn at scipy.org Tue Nov 2 01:44:29 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 2 Nov 2010 00:44:29 -0500 (CDT) Subject: [Scipy-svn] r6857 - trunk/scipy/signal Message-ID: <20101102054429.6588237CD03@scipy.org> Author: warren.weckesser Date: 2010-11-02 00:44:28 -0500 (Tue, 02 Nov 2010) New Revision: 6857 Modified: trunk/scipy/signal/wavelets.py trunk/scipy/signal/windows.py Log: Remove an unused import. Update 'raise' syntax. Modified: trunk/scipy/signal/wavelets.py =================================================================== --- trunk/scipy/signal/wavelets.py 2010-10-25 20:10:06 UTC (rev 6856) +++ trunk/scipy/signal/wavelets.py 2010-11-02 05:44:28 UTC (rev 6857) @@ -62,8 +62,8 @@ q = q / np.sum(q) * sqrt(2) return q.c[::-1] else: - raise ValueError, "Polynomial factorization does not work "\ - "well for p too large." + raise ValueError("Polynomial factorization does not work " + "well for p too large.") def qmf(hk): """Return high-pass qmf filter from low-pass @@ -118,9 +118,9 @@ N = len(hk)-1 if (J > 30 - np.log2(N+1)): - raise ValueError, "Too many levels." + raise ValueError("Too many levels.") if (J < 1): - raise ValueError, "Too few levels." + raise ValueError("Too few levels.") # construct matrices needed Modified: trunk/scipy/signal/windows.py =================================================================== --- trunk/scipy/signal/windows.py 2010-10-25 20:10:06 UTC (rev 6856) +++ trunk/scipy/signal/windows.py 2010-11-02 05:44:28 UTC (rev 6857) @@ -1,7 +1,5 @@ """The suite of window functions.""" -import types - import numpy as np from scipy import special, linalg from scipy.fftpack import fft @@ -340,8 +338,8 @@ """ if (M*width > 27.38): - raise ValueError, "Cannot reliably obtain slepian sequences for"\ - " M*width > 27.38." + raise ValueError("Cannot reliably obtain slepian sequences for" + " M*width > 27.38.") if M < 1: return np.array([]) if M == 1: @@ -473,7 +471,7 @@ elif winstr in ['chebwin', 'cheb']: winfunc = chebwin else: - raise ValueError, "Unknown window type." + raise ValueError("Unknown window type.") params = (Nx,) + args + (sym,) else: From scipy-svn at scipy.org Tue Nov 2 02:05:12 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 2 Nov 2010 01:05:12 -0500 (CDT) Subject: [Scipy-svn] r6858 - trunk/scipy/signal Message-ID: <20101102060512.6700337D433@scipy.org> Author: warren.weckesser Date: 2010-11-02 01:05:10 -0500 (Tue, 02 Nov 2010) New Revision: 6858 Modified: trunk/scipy/signal/bsplines.py Log: ENH: signal: In bsplines.py, don't use 'import *', and update 'raise' statements. Modified: trunk/scipy/signal/bsplines.py =================================================================== --- trunk/scipy/signal/bsplines.py 2010-11-02 05:44:28 UTC (rev 6857) +++ trunk/scipy/signal/bsplines.py 2010-11-02 06:05:10 UTC (rev 6858) @@ -4,10 +4,15 @@ piecewise, array, arctan2, tan, zeros, arange, floor from numpy.core.umath import sqrt, exp, greater, less, cos, add, sin, \ less_equal, greater_equal -from spline import * # C-modules + +# From splinemodule.c +from spline import cspline2d, qspline2d, sepfir2d, symiirorder1, symiirorder2 + from scipy.misc import comb + gamma = scipy.special.gamma + def factorial(n): return gamma(n+1) @@ -31,7 +36,7 @@ out = sepfir2d(ckr, hcol, hcol) out = out.astype(intype) else: - raise TypeError; + raise TypeError("Invalid data type for Iin") return out _splinefunc_cache = {} @@ -181,7 +186,7 @@ c0 = 5040 P = array([1,120,1191,2416,1191, 120, 1]) else: - raise ValueError, "Unknown order." + raise ValueError("Unknown order %d" % order) def _coeff_smooth(lam): xi = 1 - 96*lam + 24*lam * sqrt(3 + 144*lam) @@ -302,7 +307,7 @@ Cubic spline coefficients. """ if lamb != 0.0: - raise ValueError, "Smoothing quadratic splines not supported yet." + raise ValueError("Smoothing quadratic splines not supported yet.") else: return _quadratic_coeff(signal) From scipy-svn at scipy.org Tue Nov 2 11:19:29 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 2 Nov 2010 10:19:29 -0500 (CDT) Subject: [Scipy-svn] r6859 - trunk Message-ID: <20101102151929.7E88337CCE9@scipy.org> Author: rgommers Date: 2010-11-02 10:19:28 -0500 (Tue, 02 Nov 2010) New Revision: 6859 Modified: trunk/pavement.py Log: REL: Update pavement.py for 0.9.0 and add paths for python 2.7. Modified: trunk/pavement.py =================================================================== --- trunk/pavement.py 2010-11-02 06:05:10 UTC (rev 6858) +++ trunk/pavement.py 2010-11-02 15:19:28 UTC (rev 6859) @@ -77,22 +77,26 @@ if sys.platform == "win32": WINE_PY25 = [r"C:\Python25\python.exe"] WINE_PY26 = [r"C:\Python26\python26.exe"] + WINE_PY27 = [r"C:\Python27\python27.exe"] MAKENSIS = ["makensis"] elif sys.platform == "darwin": WINE_PY25 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python25/python.exe"] WINE_PY26 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python26/python.exe"] + WINE_PY27 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe"] MAKENSIS = ["wine", "makensis"] else: WINE_PY25 = [os.environ['HOME'] + "/.wine/drive_c/Python25/python.exe"] WINE_PY26 = [os.environ['HOME'] + "/.wine/drive_c/Python26/python.exe"] + WINE_PY27 = [os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe"] MAKENSIS = ["wine", "makensis"] -WINE_PYS = {'2.6' : WINE_PY26, '2.5': WINE_PY25} +WINE_PYS = {'2.7' : WINE_PY27, '2.6' : WINE_PY26, '2.5': WINE_PY25} SUPERPACK_BUILD = 'build-superpack' SUPERPACK_BINDIR = os.path.join(SUPERPACK_BUILD, 'binaries') # XXX: fix this in a sane way MPKG_PYTHON = {"2.5": "/Library/Frameworks/Python.framework/Versions/2.5/bin/python", - "2.6": "/Library/Frameworks/Python.framework/Versions/2.6/bin/python"} + "2.6": "/Library/Frameworks/Python.framework/Versions/2.6/bin/python", + "2.7": "/Library/Frameworks/Python.framework/Versions/2.7/bin/python"} # Full path to the *static* gfortran runtime LIBGFORTRAN_A_PATH = "/usr/local/lib/libgfortran.a" @@ -106,10 +110,10 @@ DOC_BLD_LATEX = DOC_BLD / "latex" # Source of the release notes -RELEASE = 'doc/release/0.8.0-notes.rst' +RELEASE = 'doc/release/0.9.0-notes.rst' # Start/end of the log (from git) -LOG_START = 'svn/tags/0.7.0' +LOG_START = 'svn/tags/0.8.0' LOG_END = 'master' # Virtualenv bootstrap stuff @@ -124,7 +128,7 @@ options(sphinx=Bunch(builddir="build", sourcedir="source", docroot='doc'), virtualenv=Bunch(script_name=BOOTSTRAP_SCRIPT, - packages_to_install=["sphinx==0.6.5"]), + packages_to_install=["sphinx==1.0.4"]), wininst=Bunch(pyver=PYVER, scratch=True)) def parse_numpy_version(pyexec): From scipy-svn at scipy.org Thu Nov 11 19:55:57 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 11 Nov 2010 18:55:57 -0600 (CST) Subject: [Scipy-svn] r6860 - trunk/scipy/io/matlab Message-ID: <20101112005557.7721C32340@scipy.org> Author: matthew.brett at gmail.com Date: 2010-11-11 18:55:56 -0600 (Thu, 11 Nov 2010) New Revision: 6860 Modified: trunk/scipy/io/matlab/mio5_utils.pyx Log: ENH: allow non-conforming strings with zero bytes and non-zero length Modified: trunk/scipy/io/matlab/mio5_utils.pyx =================================================================== --- trunk/scipy/io/matlab/mio5_utils.pyx 2010-11-02 15:19:28 UTC (rev 6859) +++ trunk/scipy/io/matlab/mio5_utils.pyx 2010-11-12 00:55:56 UTC (rev 6860) @@ -705,7 +705,7 @@ return scipy.sparse.csc_matrix( (data,rowind,indptr), shape=(M,N)) - + cpdef cnp.ndarray read_char(self, VarHeader5 header): ''' Read char matrices from stream as arrays @@ -713,7 +713,7 @@ string by later processing in array_from_header ''' '''Notes to friendly fellow-optimizer - + This routine is not much optimized. If I was going to do it, I'd store the codecs as an object pointer array, as for the .dtypes, I might use python_string.PyBytes_Decode for decoding, @@ -724,7 +724,7 @@ deals with unicode strings passed as memory, My own unicode introduction here: - https://cirl.berkeley.edu/mb312/pydagogue/python_unicode.html + http://matthew-brett.github.com/pydagogue/python_unicode.html ''' cdef: cnp.uint32_t mdtype, byte_count @@ -732,14 +732,23 @@ size_t el_count object data, res, codec cnp.ndarray arr + cnp.dtype dt cdef size_t length = self.size_from_header(header) data = self.read_element( &mdtype, &byte_count, &data_ptr, True) + # There are mat files in the wild that have 0 byte count strings, but + # maybe with non-zero length. + if byte_count == 0: + arr = np.array(' ' * length, dtype='U') + return np.ndarray(shape=header.dims, + dtype=self.U1_dtype, + buffer=arr, + order='F') # Character data can be of apparently numerical types, # specifically np.uint8, np.int8, np.uint16. np.unit16 can have # a length 1 type encoding, like ascii, or length 2 type # encoding - cdef cnp.dtype dt = self.dtypes[mdtype] + dt = self.dtypes[mdtype] if mdtype == miUINT16: codec = self.uint16_codec if self.codecs['uint16_len'] == 1: # need LSBs only @@ -759,14 +768,13 @@ uc_str = data.decode(codec) # cast to array to deal with 2, 4 byte width characters arr = np.array(uc_str, dtype='U') - dt = self.U1_dtype # could take this to numpy C-API level, but probably not worth # it return np.ndarray(shape=header.dims, - dtype=dt, + dtype=self.U1_dtype, buffer=arr, order='F') - + cpdef cnp.ndarray read_cells(self, VarHeader5 header): ''' Read cell array from stream ''' cdef: From scipy-svn at scipy.org Thu Nov 11 19:56:02 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 11 Nov 2010 18:56:02 -0600 (CST) Subject: [Scipy-svn] r6861 - trunk/scipy/io/matlab Message-ID: <20101112005602.2D8723234F@scipy.org> Author: matthew.brett at gmail.com Date: 2010-11-11 18:56:02 -0600 (Thu, 11 Nov 2010) New Revision: 6861 Modified: trunk/scipy/io/matlab/mio5.py Log: ENH: add utility function to pull variables out of mat file as individual mat files Modified: trunk/scipy/io/matlab/mio5.py =================================================================== --- trunk/scipy/io/matlab/mio5.py 2010-11-12 00:55:56 UTC (rev 6860) +++ trunk/scipy/io/matlab/mio5.py 2010-11-12 00:56:02 UTC (rev 6861) @@ -436,7 +436,76 @@ break return mdict - + +def varmats_from_mat(file_obj): + """ Pull variables out of mat 5 file as a sequence of mat file objects + + This can be useful with a difficult mat file, containing unreadable + variables. This routine pulls the variables out in raw form and puts them, + unread, back into a file stream for saving or reading. Another use is the + pathological case where there is more than one variable of the same name in + the file; this routine returns the duplicates, whereas the standard reader + will overwrite duplicates in the returned dictionary. + + The file pointer in file_obj will be undefined. File pointers for the + returned file-like objects are set at 0. + + Parameters + ---------- + file_obj : file-like + file object containing mat file + + Returns + ------- + named_mats : list + list contains tuples of (name, BytesIO) where BytesIO is a file-like + object containing mat file contents as for a single variable. The + BytesIO contains a string with the original header and a single var. If + var_file_obj is an individual BytesIO instance, then save as a mat + file with something like open('test.mat', + 'wb').write(var_file_obj.read()) + + Example + ------- + >>> import scipy.io + + BytesIO is from the io module in python 3, and is cStringIO for + python < 3. + + >>> mat_fileobj = BytesIO() + >>> scipy.io.savemat(mat_fileobj, {'b': np.arange(10), 'a': 'a string'}) + >>> varmats = varmats_from_mat(mat_fileobj) + >>> sorted([name for name, str_obj in varmats]) + ['a', 'b'] + """ + rdr = MatFile5Reader(file_obj) + file_obj.seek(0) + # Raw read of top-level file header + hdr_len = np.dtype(mdtypes_template['file_header']).itemsize + raw_hdr = file_obj.read(hdr_len) + # Initialize variable reading + file_obj.seek(0) + rdr.initialize_read() + mdict = rdr.read_file_header() + next_position = file_obj.tell() + named_mats = [] + while not rdr.end_of_stream(): + start_position = next_position + hdr, next_position = rdr.read_var_header() + name = asstr(hdr.name) + # Read raw variable string + file_obj.seek(start_position) + byte_count = next_position - start_position + var_str = file_obj.read(byte_count) + # write to stringio object + out_obj = BytesIO() + out_obj.write(raw_hdr) + out_obj.write(var_str) + out_obj.seek(0) + named_mats.append((name, out_obj)) + return named_mats + + def to_writeable(source): ''' Convert input object source to something we can write From scipy-svn at scipy.org Thu Nov 11 19:56:10 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 11 Nov 2010 18:56:10 -0600 (CST) Subject: [Scipy-svn] r6862 - in trunk/scipy/io/matlab: . tests Message-ID: <20101112005610.355553234F@scipy.org> Author: matthew.brett at gmail.com Date: 2010-11-11 18:56:10 -0600 (Thu, 11 Nov 2010) New Revision: 6862 Modified: trunk/scipy/io/matlab/mio5.py trunk/scipy/io/matlab/mio5_params.py trunk/scipy/io/matlab/mio5_utils.pyx trunk/scipy/io/matlab/tests/test_mio5_utils.py Log: RF: move dtype etc calculation to readers / writers Modified: trunk/scipy/io/matlab/mio5.py =================================================================== --- trunk/scipy/io/matlab/mio5.py 2010-11-12 00:56:02 UTC (rev 6861) +++ trunk/scipy/io/matlab/mio5.py 2010-11-12 00:56:10 UTC (rev 6862) @@ -86,8 +86,10 @@ import scipy.sparse +import byteordercodes as boc + from miobase import MatFileReader, docfiller, matdims, \ - read_dtype, convert_dtypes, arr_to_chars, arr_dtype_number, \ + read_dtype, arr_to_chars, arr_dtype_number, \ MatWriteError, MatReadError # Reader object for matlab 5 format variables @@ -95,139 +97,12 @@ # Constants and helper objects from mio5_params import MatlabObject, MatlabFunction, \ - miINT8, miUINT8, miINT16, miUINT16, miINT32, miUINT32, \ - miSINGLE, miDOUBLE, miINT64, miUINT64, miMATRIX, \ - miCOMPRESSED, miUTF8, miUTF16, miUTF32, \ - mxCELL_CLASS, mxSTRUCT_CLASS, mxOBJECT_CLASS, mxCHAR_CLASS, \ - mxSPARSE_CLASS, mxDOUBLE_CLASS, mxSINGLE_CLASS, mxINT8_CLASS, \ - mxUINT8_CLASS, mxINT16_CLASS, mxUINT16_CLASS, mxINT32_CLASS, \ - mxUINT32_CLASS, mxINT64_CLASS, mxUINT64_CLASS + MDTYPES, NP_TO_MTYPES, NP_TO_MXTYPES, \ + miCOMPRESSED, miMATRIX, miINT8, miUTF8, miUINT32, \ + mxCELL_CLASS, mxSTRUCT_CLASS, mxOBJECT_CLASS, mxCHAR_CLASS, \ + mxSPARSE_CLASS, mxDOUBLE_CLASS -mdtypes_template = { - miINT8: 'i1', - miUINT8: 'u1', - miINT16: 'i2', - miUINT16: 'u2', - miINT32: 'i4', - miUINT32: 'u4', - miSINGLE: 'f4', - miDOUBLE: 'f8', - miINT64: 'i8', - miUINT64: 'u8', - miUTF8: 'u1', - miUTF16: 'u2', - miUTF32: 'u4', - 'file_header': [('description', 'S116'), - ('subsystem_offset', 'i8'), - ('version', 'u2'), - ('endian_test', 'S2')], - 'tag_full': [('mdtype', 'u4'), ('byte_count', 'u4')], - 'tag_smalldata':[('byte_count_mdtype', 'u4'), ('data', 'S4')], - 'array_flags': [('data_type', 'u4'), - ('byte_count', 'u4'), - ('flags_class','u4'), - ('nzmax', 'u4')], - 'U1': 'U1', - } - -mclass_dtypes_template = { - mxINT8_CLASS: 'i1', - mxUINT8_CLASS: 'u1', - mxINT16_CLASS: 'i2', - mxUINT16_CLASS: 'u2', - mxINT32_CLASS: 'i4', - mxUINT32_CLASS: 'u4', - mxINT64_CLASS: 'i8', - mxUINT64_CLASS: 'u8', - mxSINGLE_CLASS: 'f4', - mxDOUBLE_CLASS: 'f8', - } - - -np_to_mtypes = { - 'f8': miDOUBLE, - 'c32': miDOUBLE, - 'c24': miDOUBLE, - 'c16': miDOUBLE, - 'f4': miSINGLE, - 'c8': miSINGLE, - 'i1': miINT8, - 'i2': miINT16, - 'i4': miINT32, - 'i8': miINT64, - 'u1': miUINT8, - 'u2': miUINT16, - 'u4': miUINT32, - 'u8': miUINT64, - 'S1': miUINT8, - 'U1': miUTF16, - } - - -np_to_mxtypes = { - 'f8': mxDOUBLE_CLASS, - 'c32': mxDOUBLE_CLASS, - 'c24': mxDOUBLE_CLASS, - 'c16': mxDOUBLE_CLASS, - 'f4': mxSINGLE_CLASS, - 'c8': mxSINGLE_CLASS, - 'i8': mxINT64_CLASS, - 'i4': mxINT32_CLASS, - 'i2': mxINT16_CLASS, - 'u8': mxUINT64_CLASS, - 'u2': mxUINT16_CLASS, - 'u1': mxUINT8_CLASS, - 'S1': mxUINT8_CLASS, - } - - - -''' Before release v7.1 (release 14) matlab (TM) used the system -default character encoding scheme padded out to 16-bits. Release 14 -and later use Unicode. When saving character data, R14 checks if it -can be encoded in 7-bit ascii, and saves in that format if so.''' - -codecs_template = { - miUTF8: {'codec': 'utf_8', 'width': 1}, - miUTF16: {'codec': 'utf_16', 'width': 2}, - miUTF32: {'codec': 'utf_32','width': 4}, - } - - -def convert_codecs(template, byte_order): - ''' Convert codec template mapping to byte order - - Set codecs not on this system to None - - Parameters - ---------- - template : mapping - key, value are respectively codec name, and root name for codec - (without byte order suffix) - byte_order : {'<', '>'} - code for little or big endian - - Returns - ------- - codecs : dict - key, value are name, codec (as in .encode(codec)) - ''' - codecs = {} - postfix = byte_order == '<' and '_le' or '_be' - for k, v in template.items(): - codec = v['codec'] - try: - " ".encode(codec) - except LookupError: - codecs[k] = None - continue - if v['width'] > 1: - codec += postfix - codecs[k] = codec - return codecs.copy() - - class MatFile5Reader(MatFileReader): ''' Reader for Mat 5 mat files Adds the following attribute to base class @@ -281,10 +156,6 @@ if not uint16_codec: uint16_codec = sys.getdefaultencoding() self.uint16_codec = uint16_codec - # placeholders for dtypes, codecs - see initialize_read - self.dtypes = None - self.class_dtypes = None - self.codecs = None # placeholders for readers - see initialize_read method self._file_reader = None self._matrix_reader = None @@ -300,7 +171,8 @@ def read_file_header(self): ''' Read in mat 5 file header ''' hdict = {} - hdr = read_dtype(self.mat_stream, self.dtypes['file_header']) + hdr_dtype = MDTYPES[self.byte_order]['dtypes']['file_header'] + hdr = read_dtype(self.mat_stream, hdr_dtype) hdict['__header__'] = hdr['description'].item().strip(asbytes(' \t\n\000')) v_major = hdr['version'] >> 8 v_minor = hdr['version'] & 0xFF @@ -312,15 +184,6 @@ Sets up readers from parameters in self ''' - self.dtypes = convert_dtypes(mdtypes_template, self.byte_order) - self.class_dtypes = convert_dtypes(mclass_dtypes_template, - self.byte_order) - self.codecs = convert_codecs(codecs_template, self.byte_order) - uint16_codec = self.uint16_codec - # Set length of miUINT16 char encoding - self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ - - len(" ".encode(uint16_codec)) - self.codecs['uint16_codec'] = uint16_codec # reader for top level stream. We need this extra top-level # reader because we use the matrix_reader object to contain # compressed matrices (so they have their own stream) @@ -481,7 +344,7 @@ rdr = MatFile5Reader(file_obj) file_obj.seek(0) # Raw read of top-level file header - hdr_len = np.dtype(mdtypes_template['file_header']).itemsize + hdr_len = MDTYPES[boc.native_code]['dtypes']['file_header'].itemsize raw_hdr = file_obj.read(hdr_len) # Initialize variable reading file_obj.seek(0) @@ -594,9 +457,16 @@ return narr +# Native byte ordered dtypes for convenience for writers +NDT_FILE_HDR = MDTYPES[boc.native_code]['dtypes']['file_header'] +NDT_TAG_FULL = MDTYPES[boc.native_code]['dtypes']['tag_full'] +NDT_TAG_SMALL = MDTYPES[boc.native_code]['dtypes']['tag_smalldata'] +NDT_ARRAY_FLAGS = MDTYPES[boc.native_code]['dtypes']['array_flags'] + + class VarWriter5(object): ''' Generic matlab matrix writing class ''' - mat_tag = np.zeros((), mdtypes_template['tag_full']) + mat_tag = np.zeros((), NDT_TAG_FULL) mat_tag['mdtype'] = miMATRIX def __init__(self, file_writer): @@ -617,7 +487,7 @@ def write_element(self, arr, mdtype=None): ''' write tag and data ''' if mdtype is None: - mdtype = np_to_mtypes[arr.dtype.str[1:]] + mdtype = NP_TO_MTYPES[arr.dtype.str[1:]] byte_count = arr.size*arr.itemsize if byte_count <= 4: self.write_smalldata_element(arr, mdtype, byte_count) @@ -626,7 +496,7 @@ def write_smalldata_element(self, arr, mdtype, byte_count): # write tag with embedded data - tag = np.zeros((), mdtypes_template['tag_smalldata']) + tag = np.zeros((), NDT_TAG_SMALL) tag['byte_count_mdtype'] = (byte_count << 16) + mdtype # if arr.tostring is < 4, the element will be zero-padded as needed. tag['data'] = arr.tostring(order='F') @@ -634,7 +504,7 @@ def write_regular_element(self, arr, mdtype, byte_count): # write tag, data - tag = np.zeros((), mdtypes_template['tag_full']) + tag = np.zeros((), NDT_TAG_FULL) tag['mdtype'] = mdtype tag['byte_count'] = byte_count self.write_bytes(tag) @@ -668,7 +538,7 @@ self._mat_tag_pos = self.file_stream.tell() self.write_bytes(self.mat_tag) # write array flags (complex, global, logical, class, nzmax) - af = np.zeros((), mdtypes_template['array_flags']) + af = np.zeros((), NDT_ARRAY_FLAGS) af['data_type'] = miUINT32 af['byte_count'] = 8 flags = is_complex << 3 | is_global << 2 | is_logical << 1 @@ -755,7 +625,7 @@ def write_numeric(self, arr): imagf = arr.dtype.kind == 'c' try: - mclass = np_to_mxtypes[arr.dtype.str[1:]] + mclass = NP_TO_MXTYPES[arr.dtype.str[1:]] except KeyError: if imagf: arr = arr.astype('c128') @@ -875,6 +745,7 @@ class MatFile5Writer(object): ''' Class for writing mat5 files ''' + @docfiller def __init__(self, file_stream, do_compression=False, @@ -912,7 +783,7 @@ def write_file_header(self): # write header - hdr = np.zeros((), mdtypes_template['file_header']) + hdr = np.zeros((), NDT_FILE_HDR) hdr['description']='MATLAB 5.0 MAT-file Platform: %s, Created on: %s' \ % (os.name,time.asctime()) hdr['version']= 0x0100 @@ -953,7 +824,7 @@ self._matrix_writer.file_stream = stream self._matrix_writer.write_top(var, asbytes(name), is_global) out_str = zlib.compress(stream.getvalue()) - tag = np.empty((), mdtypes_template['tag_full']) + tag = np.empty((), NDT_TAG_FULL) tag['mdtype'] = miCOMPRESSED tag['byte_count'] = len(out_str) self.file_stream.write(tag.tostring() + out_str) Modified: trunk/scipy/io/matlab/mio5_params.py =================================================================== --- trunk/scipy/io/matlab/mio5_params.py 2010-11-12 00:56:02 UTC (rev 6861) +++ trunk/scipy/io/matlab/mio5_params.py 2010-11-12 00:56:10 UTC (rev 6862) @@ -7,6 +7,7 @@ import numpy as np +from miobase import convert_dtypes miINT8 = 1 miUINT8 = 2 @@ -51,7 +52,137 @@ # https://www-old.cae.wisc.edu/pipermail/octave-maintainers/2007-May/002824.html mxOBJECT_CLASS_FROM_MATRIX_H = 18 +mdtypes_template = { + miINT8: 'i1', + miUINT8: 'u1', + miINT16: 'i2', + miUINT16: 'u2', + miINT32: 'i4', + miUINT32: 'u4', + miSINGLE: 'f4', + miDOUBLE: 'f8', + miINT64: 'i8', + miUINT64: 'u8', + miUTF8: 'u1', + miUTF16: 'u2', + miUTF32: 'u4', + 'file_header': [('description', 'S116'), + ('subsystem_offset', 'i8'), + ('version', 'u2'), + ('endian_test', 'S2')], + 'tag_full': [('mdtype', 'u4'), ('byte_count', 'u4')], + 'tag_smalldata':[('byte_count_mdtype', 'u4'), ('data', 'S4')], + 'array_flags': [('data_type', 'u4'), + ('byte_count', 'u4'), + ('flags_class','u4'), + ('nzmax', 'u4')], + 'U1': 'U1', + } +mclass_dtypes_template = { + mxINT8_CLASS: 'i1', + mxUINT8_CLASS: 'u1', + mxINT16_CLASS: 'i2', + mxUINT16_CLASS: 'u2', + mxINT32_CLASS: 'i4', + mxUINT32_CLASS: 'u4', + mxINT64_CLASS: 'i8', + mxUINT64_CLASS: 'u8', + mxSINGLE_CLASS: 'f4', + mxDOUBLE_CLASS: 'f8', + } + + +NP_TO_MTYPES = { + 'f8': miDOUBLE, + 'c32': miDOUBLE, + 'c24': miDOUBLE, + 'c16': miDOUBLE, + 'f4': miSINGLE, + 'c8': miSINGLE, + 'i1': miINT8, + 'i2': miINT16, + 'i4': miINT32, + 'i8': miINT64, + 'u1': miUINT8, + 'u2': miUINT16, + 'u4': miUINT32, + 'u8': miUINT64, + 'S1': miUINT8, + 'U1': miUTF16, + } + + +NP_TO_MXTYPES = { + 'f8': mxDOUBLE_CLASS, + 'c32': mxDOUBLE_CLASS, + 'c24': mxDOUBLE_CLASS, + 'c16': mxDOUBLE_CLASS, + 'f4': mxSINGLE_CLASS, + 'c8': mxSINGLE_CLASS, + 'i8': mxINT64_CLASS, + 'i4': mxINT32_CLASS, + 'i2': mxINT16_CLASS, + 'u8': mxUINT64_CLASS, + 'u2': mxUINT16_CLASS, + 'u1': mxUINT8_CLASS, + 'S1': mxUINT8_CLASS, + } + +''' Before release v7.1 (release 14) matlab (TM) used the system +default character encoding scheme padded out to 16-bits. Release 14 +and later use Unicode. When saving character data, R14 checks if it +can be encoded in 7-bit ascii, and saves in that format if so.''' + +codecs_template = { + miUTF8: {'codec': 'utf_8', 'width': 1}, + miUTF16: {'codec': 'utf_16', 'width': 2}, + miUTF32: {'codec': 'utf_32','width': 4}, + } + + +def _convert_codecs(template, byte_order): + ''' Convert codec template mapping to byte order + + Set codecs not on this system to None + + Parameters + ---------- + template : mapping + key, value are respectively codec name, and root name for codec + (without byte order suffix) + byte_order : {'<', '>'} + code for little or big endian + + Returns + ------- + codecs : dict + key, value are name, codec (as in .encode(codec)) + ''' + codecs = {} + postfix = byte_order == '<' and '_le' or '_be' + for k, v in template.items(): + codec = v['codec'] + try: + " ".encode(codec) + except LookupError: + codecs[k] = None + continue + if v['width'] > 1: + codec += postfix + codecs[k] = codec + return codecs.copy() + + +MDTYPES = {} +for _bytecode in '<>': + _def = {} + _def['dtypes'] = convert_dtypes(mdtypes_template, _bytecode) + _def['classes'] = convert_dtypes(mclass_dtypes_template, _bytecode) + _def['codecs'] = _convert_codecs(codecs_template, _bytecode) + MDTYPES[_bytecode] = _def + + class mat_struct(object): ''' Placeholder for holding read data from structs Modified: trunk/scipy/io/matlab/mio5_utils.pyx =================================================================== --- trunk/scipy/io/matlab/mio5_utils.pyx 2010-11-12 00:56:02 UTC (rev 6861) +++ trunk/scipy/io/matlab/mio5_utils.pyx 2010-11-12 00:56:10 UTC (rev 6862) @@ -135,8 +135,6 @@ cdef PyObject* dtypes[_N_MIS] # pointers to stuff in preader.class_dtypes cdef PyObject* class_dtypes[_N_MXS] - # necessary to keep memory alive for .dtypes, .class_dtypes - cdef object preader # cached here for convenience in later array creation cdef cnp.dtype U1_dtype cdef cnp.dtype bool_dtype @@ -145,9 +143,22 @@ int mat_dtype int squeeze_me int chars_as_strings - + + """ Initialize from file reader object + + preader needs the following fields defined: + + * mat_stream (file-like) + * byte_order (str) + * uint16_codec (str) + * struct_as_record (bool) + * chars_as_strings (bool) + * mat_dtype (bool) + * squeeze_me (bool) + """ def __new__(self, preader): - self.is_swapped = preader.byte_order == swapped_code + byte_order = preader.byte_order + self.is_swapped = byte_order == swapped_code if self.is_swapped: self.little_endian = not sys_is_le else: @@ -155,24 +166,27 @@ # option affecting reading of matlab struct arrays self.struct_as_record = preader.struct_as_record # store codecs for text matrix reading - self.codecs = preader.codecs + self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy() self.uint16_codec = preader.uint16_codec + uint16_codec = self.uint16_codec + # Set length of miUINT16 char encoding + self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ + - len(" ".encode(uint16_codec)) + self.codecs['uint16_codec'] = uint16_codec # set c-optimized stream object from python file-like object self.set_stream(preader.mat_stream) # options for element processing self.mat_dtype = preader.mat_dtype self.chars_as_strings = preader.chars_as_strings self.squeeze_me = preader.squeeze_me - # copy refs to dtypes into object pointer array. Store preader - # to keep preader.dtypes, class_dtypes alive. We only need the + # copy refs to dtypes into object pointer array. We only need the # integer-keyed dtypes - self.preader = preader - for key, dt in preader.dtypes.items(): + for key, dt in mio5p.MDTYPES[byte_order]['dtypes'].items(): if isinstance(key, str): continue self.dtypes[key] = dt # copy refs to class_dtypes into object pointer array - for key, dt in preader.class_dtypes.items(): + for key, dt in mio5p.MDTYPES[byte_order]['classes'].items(): if isinstance(key, str): continue self.class_dtypes[key] = dt Modified: trunk/scipy/io/matlab/tests/test_mio5_utils.py =================================================================== --- trunk/scipy/io/matlab/tests/test_mio5_utils.py 2010-11-12 00:56:02 UTC (rev 6861) +++ trunk/scipy/io/matlab/tests/test_mio5_utils.py 2010-11-12 00:56:10 UTC (rev 6862) @@ -20,8 +20,7 @@ import scipy.io.matlab.byteordercodes as boc import scipy.io.matlab.streams as streams -import scipy.io.matlab.miobase as miob -import scipy.io.matlab.mio5 as mio5 +import scipy.io.matlab.mio5_params as mio5p import scipy.io.matlab.mio5_utils as m5u @@ -84,11 +83,8 @@ pass r = R() r.byte_order = boc.native_code - r.dtypes = {} - r.class_dtypes = {} - r.codecs = {} r.struct_as_record = True - r.uint16_codec = None + r.uint16_codec = sys.getdefaultencoding() r.chars_as_strings = False r.mat_dtype = False r.squeeze_me = False @@ -105,14 +101,14 @@ # This works for StringIO but _not_ cStringIO yield assert_raises, IOError, c_reader.read_tag # bad SDE - tag = _make_tag('i4', 1, mio5.miINT32, sde=True) + tag = _make_tag('i4', 1, mio5p.miINT32, sde=True) tag['byte_count'] = 5 _write_stream(str_io, tag.tostring()) yield assert_raises, ValueError, c_reader.read_tag def test_read_stream(): - tag = _make_tag('i4', 1, mio5.miINT32, sde=True) + tag = _make_tag('i4', 1, mio5p.miINT32, sde=True) tag_str = tag.tostring() str_io = cStringIO(tag_str) st = streams.make_stream(str_io) @@ -127,12 +123,12 @@ r.mat_stream = str_io # check simplest of tags for base_dt, val, mdtype in ( - ('u2', 30, mio5.miUINT16), - ('i4', 1, mio5.miINT32), - ('i2', -1, mio5.miINT16)): + ('u2', 30, mio5p.miUINT16), + ('i4', 1, mio5p.miINT32), + ('i2', -1, mio5p.miINT16)): for byte_code in ('<', '>'): r.byte_order = byte_code - r.dtypes = miob.convert_dtypes(mio5.mdtypes_template, byte_code) + r.dtypes = mio5p.MDTYPES[byte_code]['dtypes'] c_reader = m5u.VarReader5(r) yield assert_equal, c_reader.little_endian, byte_code == '<' yield assert_equal, c_reader.is_swapped, byte_code != boc.native_code @@ -149,22 +145,22 @@ yield assert_equal, el, val el = c_reader.read_numeric() yield assert_equal, el, val - + def test_read_numeric_writeable(): # make reader-like thing str_io = cStringIO() r = _make_readerlike() r.mat_stream = str_io r.byte_order = '<' - r.dtypes = miob.convert_dtypes(mio5.mdtypes_template, '<') c_reader = m5u.VarReader5(r) dt = np.dtype(' Author: matthew.brett at gmail.com Date: 2010-11-11 18:56:16 -0600 (Thu, 11 Nov 2010) New Revision: 6863 Modified: trunk/scipy/io/matlab/tests/test_mio5_utils.py Log: RF - small refactoring of tests to reflect refactoring of mio5 and friends Modified: trunk/scipy/io/matlab/tests/test_mio5_utils.py =================================================================== --- trunk/scipy/io/matlab/tests/test_mio5_utils.py 2010-11-12 00:56:10 UTC (rev 6862) +++ trunk/scipy/io/matlab/tests/test_mio5_utils.py 2010-11-12 00:56:16 UTC (rev 6863) @@ -78,11 +78,12 @@ stream.seek(0) -def _make_readerlike(): +def _make_readerlike(stream, byte_order=boc.native_code): class R(object): pass r = R() - r.byte_order = boc.native_code + r.mat_stream = stream + r.byte_order = byte_order r.struct_as_record = True r.uint16_codec = sys.getdefaultencoding() r.chars_as_strings = False @@ -95,8 +96,7 @@ # mainly to test errors # make reader-like thing str_io = BytesIO() - r = _make_readerlike() - r.mat_stream = str_io + r = _make_readerlike(str_io) c_reader = m5u.VarReader5(r) # This works for StringIO but _not_ cStringIO yield assert_raises, IOError, c_reader.read_tag @@ -119,8 +119,7 @@ def test_read_numeric(): # make reader-like thing str_io = cStringIO() - r = _make_readerlike() - r.mat_stream = str_io + r = _make_readerlike(str_io) # check simplest of tags for base_dt, val, mdtype in ( ('u2', 30, mio5p.miUINT16), @@ -128,7 +127,6 @@ ('i2', -1, mio5p.miINT16)): for byte_code in ('<', '>'): r.byte_order = byte_code - r.dtypes = mio5p.MDTYPES[byte_code]['dtypes'] c_reader = m5u.VarReader5(r) yield assert_equal, c_reader.little_endian, byte_code == '<' yield assert_equal, c_reader.is_swapped, byte_code != boc.native_code @@ -150,9 +148,7 @@ def test_read_numeric_writeable(): # make reader-like thing str_io = cStringIO() - r = _make_readerlike() - r.mat_stream = str_io - r.byte_order = '<' + r = _make_readerlike(str_io, '<') c_reader = m5u.VarReader5(r) dt = np.dtype(' Author: matthew.brett at gmail.com Date: 2010-11-11 18:56:23 -0600 (Thu, 11 Nov 2010) New Revision: 6864 Modified: trunk/scipy/io/matlab/mio5_utils.pyx trunk/scipy/io/matlab/tests/test_mio5_utils.py Log: TEST: added test for zero bytes char read Modified: trunk/scipy/io/matlab/mio5_utils.pyx =================================================================== --- trunk/scipy/io/matlab/mio5_utils.pyx 2010-11-12 00:56:16 UTC (rev 6863) +++ trunk/scipy/io/matlab/mio5_utils.pyx 2010-11-12 00:56:23 UTC (rev 6864) @@ -124,7 +124,17 @@ cdef public int is_global cdef size_t nzmax + def set_dims(self, dims): + """ Allow setting of dimensions from python + This is for constructing headers for tests + """ + self.dims = dims + self.n_dims = len(dims) + for i, dim in enumerate(dims): + self.dims_ptr[i] = int(dim) + + cdef class VarReader5: cdef public int is_swapped, little_endian cdef int struct_as_record @@ -571,6 +581,7 @@ ''' # calculate number of items in array from dims product cdef size_t size = 1 + cdef int i for i in range(header.n_dims): size *= header.dims_ptr[i] return size Modified: trunk/scipy/io/matlab/tests/test_mio5_utils.py =================================================================== --- trunk/scipy/io/matlab/tests/test_mio5_utils.py 2010-11-12 00:56:16 UTC (rev 6863) +++ trunk/scipy/io/matlab/tests/test_mio5_utils.py 2010-11-12 00:56:23 UTC (rev 6864) @@ -158,5 +158,35 @@ yield assert_true, el.flags.writeable +def test_zero_byte_string(): + # Tests hack to allow chars of non-zero length, but 0 bytes + # make reader-like thing + str_io = cStringIO() + r = _make_readerlike(str_io, '<') + c_reader = m5u.VarReader5(r) + tag_dt = np.dtype([('mdtype', 'u4'), ('byte_count', 'u4')]) + tag = np.zeros((1,), dtype=tag_dt) + tag['mdtype'] = mio5p.miINT8 + tag['byte_count'] = 1 + hdr = m5u.VarHeader5() + # Try when string is 1 length + hdr.set_dims([1,]) + _write_stream(str_io, tag.tostring() + ' ') + str_io.seek(0) + val = c_reader.read_char(hdr) + assert_equal(val, u' ') + # Now when string has 0 bytes 1 length + tag['byte_count'] = 0 + _write_stream(str_io, tag.tostring()) + str_io.seek(0) + val = c_reader.read_char(hdr) + assert_equal(val, u' ') + # Now when string has 0 bytes 4 length + str_io.seek(0) + hdr.set_dims([4,]) + val = c_reader.read_char(hdr) + assert_array_equal(val, [u' '] * 4) + + if __name__ == "__main__": run_module_suite() From scipy-svn at scipy.org Thu Nov 11 19:56:29 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 11 Nov 2010 18:56:29 -0600 (CST) Subject: [Scipy-svn] r6865 - in trunk/scipy/io/matlab/tests: . data Message-ID: <20101112005629.8C46A32361@scipy.org> Author: matthew.brett at gmail.com Date: 2010-11-11 18:56:28 -0600 (Thu, 11 Nov 2010) New Revision: 6865 Added: trunk/scipy/io/matlab/tests/data/nasty_duplicate_fieldnames.mat trunk/scipy/io/matlab/tests/test_pathological.py Log: TEST - failing test for duplicate fieldnames Added: trunk/scipy/io/matlab/tests/data/nasty_duplicate_fieldnames.mat =================================================================== --- trunk/scipy/io/matlab/tests/data/nasty_duplicate_fieldnames.mat (rev 0) +++ trunk/scipy/io/matlab/tests/data/nasty_duplicate_fieldnames.mat 2010-11-12 00:56:28 UTC (rev 6865) @@ -0,0 +1,9 @@ +MATLAB 5.0 MAT-file, Platform: PCWIN, Created on: Mon Oct 04 09:42:29 2010 IMSummaryTop_QMiddle_QBottom_QLeft_QRight_QTotal_QDepthCellsTrackMean_VelBoat_VelStation_QStation_QStation_QStation_QTrack_ReferenceUnits@" @" @" @" @" @" @" ??????j??? Zd??????? ???@?????$??@?$???????@??????(??@5^@ @?A@??K@@^? @?Z @?Z @?? @@? +@b +@??S @?? @7? @ ?G +@?G?@??@??t@ X9@@?@??n@ -?@??@?@@" @@@????@@@@ @&@.@2@4@7@9@;@<@=@=@=@<@<@;@:@6@5@5@5@5@6@6@6@6@P" ?t??/? @ l@?k@?#@V'@X?+@??0@ C\2@ ??4@?R7@??9@?8<@@f?>@s?@@??A@??B@(D@ ?E@??F@?f?G@?v?H@??J@?.K@?LL@? cM@?}uN@?j?O@??FP@???P@ ?FQ@?"?Q@@[=R@?=?R@????????@&S??????????N@???vO???@????%????Di???h? +????????????=j ??'o#????&??x *???-??!?0? Eg2? 04???6???7???9?@x;?@Jj=? ?n?? ?@????A??B????C?? E?P" @?0??iY?? P???@???? ?,???q&??@????w?????????????\$?? +?????-?????????@X????&???@?????v???9?????? o??? .????b???????????p???????? i????m??S????A????"???8??u?????-????A??@_i???O??????????4??(???@ +:??@(???@k????(???????Z??????????@?t??@O +??@?q???????????o???G????*??? 1N??@ o??z ??@?Q???Y????q????R???????V???????p" @?t????E???????????? ?G? X9??O??????@#J???? ???@??@{??k ???? ?F???m???U????? ??@?????????A??,?????Mb??'??????-???A??M??@? +???!????????????????Y???vOn?@????Q???????@?U?? ?D???Pk???????):??@*?S???F??Mbp?@*?c?@*?3??t?X?@*?C??Mb???{??Q?~??????t?x????o??N@???R? Q?k??L??????*???Mb???b???6Z????vO~????????6z??R?@?zd?@?}m?@?zd???6Z?@*????+ei???6z??O??@" @" @" @" @" ????????????????????????????????????????????????????????????????????8?Top_QMiddle_QBottom_QLeft_QRight_QTotal_QDepthCellsTrackMean_VelBoat_VelStation_QTrack_Reference8m3/s8m3/s8m3/s8m3/s8m3/s8m3/s8m08m8m/s8m/s8m3/s0 \ No newline at end of file Added: trunk/scipy/io/matlab/tests/test_pathological.py =================================================================== --- trunk/scipy/io/matlab/tests/test_pathological.py (rev 0) +++ trunk/scipy/io/matlab/tests/test_pathological.py 2010-11-12 00:56:28 UTC (rev 6865) @@ -0,0 +1,31 @@ +""" Test reading of files not conforming to matlab specification + +We try and read any file that matlab reads, these files included +""" +from os.path import dirname, join as pjoin +import sys + +if sys.version_info[0] >= 3: + from io import BytesIO + cStringIO = BytesIO +else: + from cStringIO import StringIO as cStringIO + from StringIO import StringIO as BytesIO + +import numpy as np + +from nose.tools import assert_true, assert_false, \ + assert_equal, assert_raises + +from numpy.testing import assert_array_equal, assert_array_almost_equal, \ + run_module_suite + +from scipy.io.matlab.mio import loadmat + +TEST_DATA_PATH = pjoin(dirname(__file__), 'data') + +def test_multiple_fieldnames(): + # Example provided by Dharhas Pothina + # Extracted using mio5.varmats_from_mat + multi_fname = pjoin(TEST_DATA_PATH, 'nasty_duplicate_fieldnames.mat') + vars = loadmat(multi_fname) From scipy-svn at scipy.org Thu Nov 11 19:56:41 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 11 Nov 2010 18:56:41 -0600 (CST) Subject: [Scipy-svn] r6866 - in trunk/scipy/io/matlab: . tests Message-ID: <20101112005641.B307532350@scipy.org> Author: matthew.brett at gmail.com Date: 2010-11-11 18:56:41 -0600 (Thu, 11 Nov 2010) New Revision: 6866 Modified: trunk/scipy/io/matlab/mio5.py trunk/scipy/io/matlab/mio5_utils.c trunk/scipy/io/matlab/mio5_utils.pyx trunk/scipy/io/matlab/tests/test_mio.py trunk/scipy/io/matlab/tests/test_pathological.py Log: NF - duplicate fieldnames as hidden feature, with tests Modified: trunk/scipy/io/matlab/mio5.py =================================================================== --- trunk/scipy/io/matlab/mio5.py 2010-11-12 00:56:28 UTC (rev 6865) +++ trunk/scipy/io/matlab/mio5.py 2010-11-12 00:56:41 UTC (rev 6866) @@ -270,6 +270,12 @@ while not self.end_of_stream(): hdr, next_position = self.read_var_header() name = asstr(hdr.name) + if name in mdict: + warnings.warn('Duplicate variable name "%s" in stream' + ' - replacing previous with new\n' + 'Consider mio5.varmats_from_mat to split ' + 'file into single variable files' % name, + UserWarning, stacklevel=2) if name == '': # can only be a matlab 7 function workspace name = '__function_workspace__' Modified: trunk/scipy/io/matlab/mio5_utils.c =================================================================== --- trunk/scipy/io/matlab/mio5_utils.c 2010-11-12 00:56:28 UTC (rev 6865) +++ trunk/scipy/io/matlab/mio5_utils.c 2010-11-12 00:56:41 UTC (rev 6866) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.13 on Sat Sep 11 22:32:56 2010 */ +/* Generated by Cython 0.13 on Mon Oct 11 20:27:08 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -196,9 +196,10 @@ #endif #include #define __PYX_HAVE_API__scipy__io__matlab__mio5_utils +#include "stdlib.h" +#include "string.h" #include "stdio.h" #include "pythread.h" -#include "stdlib.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "numpy_rephrasing.h" @@ -372,7 +373,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":6 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pxd":6 * cdef object fobj * * cpdef int seek(self, long int offset, int whence=*) except -1 # <<<<<<<<<<<<<< @@ -385,7 +386,7 @@ int whence; }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":9 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pxd":9 * cpdef long int tell(self) except -1 * cdef int read_into(self, void *buf, size_t n) except -1 * cdef object read_string(self, size_t n, void **pp, int copy=*) # <<<<<<<<<<<<<< @@ -398,7 +399,7 @@ int copy; }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":65 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":68 * * * cdef enum: # <<<<<<<<<<<<<< @@ -424,7 +425,7 @@ __pyx_e_5scipy_2io_6matlab_10mio5_utils_miUTF32 = 18 }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":82 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":85 * miUTF32 = 18 * * cdef enum: # see comments in mio5_params # <<<<<<<<<<<<<< @@ -453,7 +454,7 @@ __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxOBJECT_CLASS_FROM_MATRIX_H = 18 }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":289 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":316 * return 1 * * cdef object read_element(self, # <<<<<<<<<<<<<< @@ -466,7 +467,7 @@ int copy; }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":385 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":412 * return 0 * * cpdef inline cnp.ndarray read_numeric(self, int copy=True): # <<<<<<<<<<<<<< @@ -479,7 +480,7 @@ int copy; }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":564 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":592 * return size * * cdef read_mi_matrix(self, int process=1): # <<<<<<<<<<<<<< @@ -492,7 +493,7 @@ int process; }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":596 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":624 * return self.array_from_header(header, process) * * cpdef array_from_header(self, VarHeader5 header, int process=1): # <<<<<<<<<<<<<< @@ -505,7 +506,7 @@ int process; }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":3 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pxd":3 * # -*- python -*- or rather like * * cdef class GenericStream: # <<<<<<<<<<<<<< @@ -519,7 +520,7 @@ PyObject *fobj; }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":116 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":119 * * * cdef class VarHeader5: # <<<<<<<<<<<<<< @@ -540,7 +541,7 @@ size_t nzmax; }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":128 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":141 * * * cdef class VarReader5: # <<<<<<<<<<<<<< @@ -559,7 +560,6 @@ struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *cstream; PyObject *dtypes[20]; PyObject *class_dtypes[20]; - PyObject *preader; PyArray_Descr *U1_dtype; PyArray_Descr *bool_dtype; int mat_dtype; @@ -568,7 +568,7 @@ }; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":3 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pxd":3 * # -*- python -*- or rather like * * cdef class GenericStream: # <<<<<<<<<<<<<< @@ -585,7 +585,7 @@ static struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *__pyx_vtabptr_5scipy_2io_6matlab_7streams_GenericStream; -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":128 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":141 * * * cdef class VarReader5: # <<<<<<<<<<<<<< @@ -836,6 +836,8 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_uint32(npy_uint32); +static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject *); + static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32); @@ -968,6 +970,10 @@ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ +/* Module declarations from libc.stdlib */ + +/* Module declarations from libc.string */ + /* Module declarations from cpython.version */ /* Module declarations from cpython.ref */ @@ -1041,8 +1047,6 @@ /* Module declarations from cpython */ -/* Module declarations from libc.stdlib */ - /* Module declarations from numpy */ /* Module declarations from numpy */ @@ -1075,48 +1079,53 @@ int __pyx_module_is_main_scipy__io__matlab__mio5_utils = 0; /* Implementation of scipy.io.matlab.mio5_utils */ +static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_RuntimeError; -static char __pyx_k_1[] = "> 8 & 0xff00u)) | * (u4 >> 24)) # <<<<<<<<<<<<<< @@ -1447,7 +1473,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":109 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":112 * * * cpdef cnp.uint32_t byteswap_u4(cnp.uint32_t u4): # <<<<<<<<<<<<<< @@ -1463,7 +1489,7 @@ __Pyx_RefNannySetupContext("byteswap_u4"); __pyx_self = __pyx_self; assert(__pyx_arg_u4); { - __pyx_v_u4 = __Pyx_PyInt_from_py_npy_uint32(__pyx_arg_u4); if (unlikely((__pyx_v_u4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_u4 = __Pyx_PyInt_from_py_npy_uint32(__pyx_arg_u4); if (unlikely((__pyx_v_u4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -1472,7 +1498,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(__pyx_v_u4, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(__pyx_v_u4, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1490,7 +1516,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":117 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":120 * * cdef class VarHeader5: * cdef readonly object name # <<<<<<<<<<<<<< @@ -1514,7 +1540,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":118 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":121 * cdef class VarHeader5: * cdef readonly object name * cdef readonly int mclass # <<<<<<<<<<<<<< @@ -1528,7 +1554,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__"); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->mclass); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->mclass); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1546,7 +1572,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":119 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":122 * cdef readonly object name * cdef readonly int mclass * cdef readonly object dims # <<<<<<<<<<<<<< @@ -1570,7 +1596,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":124 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":127 * cdef int is_complex * cdef int is_logical * cdef public int is_global # <<<<<<<<<<<<<< @@ -1584,7 +1610,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__"); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->is_global); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->is_global); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1607,7 +1633,7 @@ int __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->is_global = __pyx_t_1; __pyx_r = 0; @@ -1620,8 +1646,138 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":129 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":130 + * cdef size_t nzmax * + * def set_dims(self, dims): # <<<<<<<<<<<<<< + * """ Allow setting of dimensions from python + * + */ + +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_set_dims(PyObject *__pyx_v_self, PyObject *__pyx_v_dims); /*proto*/ +static char __pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_set_dims[] = " Allow setting of dimensions from python\n\n This is for constructing headers for tests\n "; +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_set_dims(PyObject *__pyx_v_self, PyObject *__pyx_v_dims) { + PyObject *__pyx_v_i; + PyObject *__pyx_v_dim; + PyObject *__pyx_r = NULL; + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __pyx_t_5numpy_int32_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + __Pyx_RefNannySetupContext("set_dims"); + __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_dim = Py_None; __Pyx_INCREF(Py_None); + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":135 + * This is for constructing headers for tests + * """ + * self.dims = dims # <<<<<<<<<<<<<< + * self.n_dims = len(dims) + * for i, dim in enumerate(dims): + */ + __Pyx_INCREF(__pyx_v_dims); + __Pyx_GIVEREF(__pyx_v_dims); + __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->dims); + __Pyx_DECREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->dims); + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->dims = __pyx_v_dims; + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":136 + * """ + * self.dims = dims + * self.n_dims = len(dims) # <<<<<<<<<<<<<< + * for i, dim in enumerate(dims): + * self.dims_ptr[i] = int(dim) + */ + __pyx_t_1 = PyObject_Length(__pyx_v_dims); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->n_dims = __pyx_t_1; + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":137 + * self.dims = dims + * self.n_dims = len(dims) + * for i, dim in enumerate(dims): # <<<<<<<<<<<<<< + * self.dims_ptr[i] = int(dim) + * + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_2 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_dims) || PyTuple_CheckExact(__pyx_v_dims)) { + __pyx_t_1 = 0; __pyx_t_3 = __pyx_v_dims; __Pyx_INCREF(__pyx_t_3); + } else { + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + } + for (;;) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; + } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; + } else { + __pyx_t_4 = PyIter_Next(__pyx_t_3); + if (!__pyx_t_4) { + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_v_dim); + __pyx_v_dim = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_v_i); + __pyx_v_i = __pyx_t_2; + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":138 + * self.n_dims = len(dims) + * for i, dim in enumerate(dims): + * self.dims_ptr[i] = int(dim) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_dim); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_dim); + __Pyx_GIVEREF(__pyx_v_dim); + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->dims_ptr[__pyx_t_7]) = __pyx_t_6; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarHeader5.set_dims"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(__pyx_v_i); + __Pyx_DECREF(__pyx_v_dim); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":142 + * * cdef class VarReader5: * cdef public int is_swapped, little_endian # <<<<<<<<<<<<<< * cdef int struct_as_record @@ -1634,7 +1790,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__"); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1657,7 +1813,7 @@ int __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped = __pyx_t_1; __pyx_r = 0; @@ -1676,7 +1832,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__"); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1699,7 +1855,7 @@ int __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian = __pyx_t_1; __pyx_r = 0; @@ -1712,30 +1868,32 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":149 - * int chars_as_strings - * +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":172 + * * squeeze_me (bool) + * """ * def __new__(self, preader): # <<<<<<<<<<<<<< - * self.is_swapped = preader.byte_order == swapped_code - * if self.is_swapped: + * byte_order = preader.byte_order + * self.is_swapped = byte_order == swapped_code */ static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_preader = 0; + PyObject *__pyx_v_byte_order; + PyObject *__pyx_v_uint16_codec; PyObject *__pyx_v_key; PyObject *__pyx_v_dt; PyObject *__pyx_v_bool_dtype; int __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + int __pyx_t_3; int __pyx_t_4; - int __pyx_t_5; + PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; - Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_9 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__preader,0}; __Pyx_RefNannySetupContext("__cinit__"); if (unlikely(__pyx_kwds)) { @@ -1753,7 +1911,7 @@ else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_preader = values[0]; } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { @@ -1763,270 +1921,367 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__new__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__new__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.__cinit__"); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; + __pyx_v_byte_order = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_uint16_codec = Py_None; __Pyx_INCREF(Py_None); __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dt = Py_None; __Pyx_INCREF(Py_None); __pyx_v_bool_dtype = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":150 - * + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":173 + * """ * def __new__(self, preader): - * self.is_swapped = preader.byte_order == swapped_code # <<<<<<<<<<<<<< + * byte_order = preader.byte_order # <<<<<<<<<<<<<< + * self.is_swapped = byte_order == swapped_code * if self.is_swapped: + */ + __pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__byte_order); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_v_byte_order); + __pyx_v_byte_order = __pyx_t_1; + __pyx_t_1 = 0; + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":174 + * def __new__(self, preader): + * byte_order = preader.byte_order + * self.is_swapped = byte_order == swapped_code # <<<<<<<<<<<<<< + * if self.is_swapped: * self.little_endian = not sys_is_le */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__byte_order); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__swapped_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__swapped_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_v_byte_order, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped = __pyx_t_4; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped = __pyx_t_3; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":151 - * def __new__(self, preader): - * self.is_swapped = preader.byte_order == swapped_code + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":175 + * byte_order = preader.byte_order + * self.is_swapped = byte_order == swapped_code * if self.is_swapped: # <<<<<<<<<<<<<< * self.little_endian = not sys_is_le * else: */ if (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":152 - * self.is_swapped = preader.byte_order == swapped_code + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":176 + * self.is_swapped = byte_order == swapped_code * if self.is_swapped: * self.little_endian = not sys_is_le # <<<<<<<<<<<<<< * else: * self.little_endian = sys_is_le */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian = (!__pyx_t_5); + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian = (!__pyx_t_4); goto __pyx_L6; } /*else*/ { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":154 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":178 * self.little_endian = not sys_is_le * else: * self.little_endian = sys_is_le # <<<<<<<<<<<<<< * # option affecting reading of matlab struct arrays * self.struct_as_record = preader.struct_as_record */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian = __pyx_t_4; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian = __pyx_t_3; } __pyx_L6:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":156 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":180 * self.little_endian = sys_is_le * # option affecting reading of matlab struct arrays * self.struct_as_record = preader.struct_as_record # <<<<<<<<<<<<<< * # store codecs for text matrix reading - * self.codecs = preader.codecs + * self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy() */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__struct_as_record); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->struct_as_record = __pyx_t_4; + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__struct_as_record); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->struct_as_record = __pyx_t_3; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":158 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":182 * self.struct_as_record = preader.struct_as_record * # store codecs for text matrix reading - * self.codecs = preader.codecs # <<<<<<<<<<<<<< + * self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy() # <<<<<<<<<<<<<< * self.uint16_codec = preader.uint16_codec - * # set c-optimized stream object from python file-like object + * uint16_codec = self.uint16_codec */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__codecs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MDTYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_byte_order); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__codecs)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->codecs); __Pyx_DECREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->codecs); - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->codecs = __pyx_t_3; - __pyx_t_3 = 0; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->codecs = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":159 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":183 * # store codecs for text matrix reading - * self.codecs = preader.codecs + * self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy() * self.uint16_codec = preader.uint16_codec # <<<<<<<<<<<<<< - * # set c-optimized stream object from python file-like object - * self.set_stream(preader.mat_stream) + * uint16_codec = self.uint16_codec + * # Set length of miUINT16 char encoding */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__uint16_codec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__uint16_codec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->uint16_codec); __Pyx_DECREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->uint16_codec); - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->uint16_codec = __pyx_t_3; - __pyx_t_3 = 0; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->uint16_codec = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":161 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":184 + * self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy() * self.uint16_codec = preader.uint16_codec + * uint16_codec = self.uint16_codec # <<<<<<<<<<<<<< + * # Set length of miUINT16 char encoding + * self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ + */ + __Pyx_INCREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->uint16_codec); + __Pyx_DECREF(__pyx_v_uint16_codec); + __pyx_v_uint16_codec = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->uint16_codec; + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":186 + * uint16_codec = self.uint16_codec + * # Set length of miUINT16 char encoding + * self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ # <<<<<<<<<<<<<< + * - len(" ".encode(uint16_codec)) + * self.codecs['uint16_codec'] = uint16_codec + */ + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_uint16_codec); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_uint16_codec); + __Pyx_GIVEREF(__pyx_v_uint16_codec); + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":187 + * # Set length of miUINT16 char encoding + * self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ + * - len(" ".encode(uint16_codec)) # <<<<<<<<<<<<<< + * self.codecs['uint16_codec'] = uint16_codec * # set c-optimized stream object from python file-like object + */ + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_uint16_codec); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_uint16_codec); + __Pyx_GIVEREF(__pyx_v_uint16_codec); + __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - __pyx_t_7)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":186 + * uint16_codec = self.uint16_codec + * # Set length of miUINT16 char encoding + * self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ # <<<<<<<<<<<<<< + * - len(" ".encode(uint16_codec)) + * self.codecs['uint16_codec'] = uint16_codec + */ + if (PyObject_SetItem(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->codecs, ((PyObject *)__pyx_n_s__uint16_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":188 + * self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ + * - len(" ".encode(uint16_codec)) + * self.codecs['uint16_codec'] = uint16_codec # <<<<<<<<<<<<<< + * # set c-optimized stream object from python file-like object + * self.set_stream(preader.mat_stream) + */ + if (PyObject_SetItem(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->codecs, ((PyObject *)__pyx_n_s__uint16_codec), __pyx_v_uint16_codec) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":190 + * self.codecs['uint16_codec'] = uint16_codec + * # set c-optimized stream object from python file-like object * self.set_stream(preader.mat_stream) # <<<<<<<<<<<<<< * # options for element processing * self.mat_dtype = preader.mat_dtype */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__set_stream); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_stream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__set_stream); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_stream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":163 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":192 * self.set_stream(preader.mat_stream) * # options for element processing * self.mat_dtype = preader.mat_dtype # <<<<<<<<<<<<<< * self.chars_as_strings = preader.chars_as_strings * self.squeeze_me = preader.squeeze_me */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->mat_dtype = __pyx_t_4; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->mat_dtype = __pyx_t_3; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":164 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":193 * # options for element processing * self.mat_dtype = preader.mat_dtype * self.chars_as_strings = preader.chars_as_strings # <<<<<<<<<<<<<< * self.squeeze_me = preader.squeeze_me - * # copy refs to dtypes into object pointer array. Store preader + * # copy refs to dtypes into object pointer array. We only need the */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__chars_as_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__chars_as_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->chars_as_strings = __pyx_t_4; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->chars_as_strings = __pyx_t_3; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":165 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":194 * self.mat_dtype = preader.mat_dtype * self.chars_as_strings = preader.chars_as_strings * self.squeeze_me = preader.squeeze_me # <<<<<<<<<<<<<< - * # copy refs to dtypes into object pointer array. Store preader - * # to keep preader.dtypes, class_dtypes alive. We only need the + * # copy refs to dtypes into object pointer array. We only need the + * # integer-keyed dtypes */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__squeeze_me); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__squeeze_me); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->squeeze_me = __pyx_t_4; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->squeeze_me = __pyx_t_3; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":169 - * # to keep preader.dtypes, class_dtypes alive. We only need the + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":197 + * # copy refs to dtypes into object pointer array. We only need the * # integer-keyed dtypes - * self.preader = preader # <<<<<<<<<<<<<< - * for key, dt in preader.dtypes.items(): + * for key, dt in mio5p.MDTYPES[byte_order]['dtypes'].items(): # <<<<<<<<<<<<<< * if isinstance(key, str): - */ - __Pyx_INCREF(__pyx_v_preader); - __Pyx_GIVEREF(__pyx_v_preader); - __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->preader); - __Pyx_DECREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->preader); - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->preader = __pyx_v_preader; - - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":170 - * # integer-keyed dtypes - * self.preader = preader - * for key, dt in preader.dtypes.items(): # <<<<<<<<<<<<<< - * if isinstance(key, str): * continue */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__dtypes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MDTYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_t_5, __pyx_v_byte_order); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_6 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtypes)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { + __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; - } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; + } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; } else { - __pyx_t_2 = PyIter_Next(__pyx_t_1); - if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyIter_Next(__pyx_t_2); + if (!__pyx_t_5) { + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); } - if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) { - PyObject* tuple = __pyx_t_2; - __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) { + PyObject* tuple = __pyx_t_5; + __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_key = __pyx_t_1; + __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_dt); - __pyx_v_dt = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_dt = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_9, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_UnpackItem(__pyx_t_9, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_EndUnpack(__pyx_t_8, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_EndUnpack(__pyx_t_9, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_key = __pyx_t_1; + __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_dt); - __pyx_v_dt = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_dt = __pyx_t_8; + __pyx_t_8 = 0; } - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":171 - * self.preader = preader - * for key, dt in preader.dtypes.items(): + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":198 + * # integer-keyed dtypes + * for key, dt in mio5p.MDTYPES[byte_order]['dtypes'].items(): * if isinstance(key, str): # <<<<<<<<<<<<<< * continue * self.dtypes[key] = dt */ - __pyx_t_5 = PyString_Check(__pyx_v_key); - if (__pyx_t_5) { + __pyx_t_4 = PyString_Check(__pyx_v_key); + if (__pyx_t_4) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":172 - * for key, dt in preader.dtypes.items(): + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":199 + * for key, dt in mio5p.MDTYPES[byte_order]['dtypes'].items(): * if isinstance(key, str): * continue # <<<<<<<<<<<<<< * self.dtypes[key] = dt @@ -2037,97 +2292,106 @@ } __pyx_L9:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":173 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":200 * if isinstance(key, str): * continue * self.dtypes[key] = dt # <<<<<<<<<<<<<< * # copy refs to class_dtypes into object pointer array - * for key, dt in preader.class_dtypes.items(): + * for key, dt in mio5p.MDTYPES[byte_order]['classes'].items(): */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->dtypes[__pyx_t_9]) = ((PyObject *)__pyx_v_dt); + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->dtypes[__pyx_t_6]) = ((PyObject *)__pyx_v_dt); __pyx_L7_continue:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":175 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":202 * self.dtypes[key] = dt * # copy refs to class_dtypes into object pointer array - * for key, dt in preader.class_dtypes.items(): # <<<<<<<<<<<<<< + * for key, dt in mio5p.MDTYPES[byte_order]['classes'].items(): # <<<<<<<<<<<<<< * if isinstance(key, str): * continue */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__class_dtypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MDTYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = PyObject_GetItem(__pyx_t_5, __pyx_v_byte_order); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__classes)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { + __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; } else { - __pyx_t_1 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_1) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyIter_Next(__pyx_t_2); + if (!__pyx_t_5) { + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); } - if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) { - PyObject* tuple = __pyx_t_1; - __pyx_t_7 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_7); - __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) { + PyObject* tuple = __pyx_t_5; + __pyx_t_8 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_8); + __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_key = __pyx_t_8; + __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_dt); - __pyx_v_dt = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_dt = __pyx_t_1; + __pyx_t_1 = 0; } else { - __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_UnpackItem(__pyx_t_9, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_EndUnpack(__pyx_t_8, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_9, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_EndUnpack(__pyx_t_9, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_key = __pyx_t_8; + __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_dt); - __pyx_v_dt = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_dt = __pyx_t_1; + __pyx_t_1 = 0; } - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":176 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":203 * # copy refs to class_dtypes into object pointer array - * for key, dt in preader.class_dtypes.items(): + * for key, dt in mio5p.MDTYPES[byte_order]['classes'].items(): * if isinstance(key, str): # <<<<<<<<<<<<<< * continue * self.class_dtypes[key] = dt */ - __pyx_t_5 = PyString_Check(__pyx_v_key); - if (__pyx_t_5) { + __pyx_t_4 = PyString_Check(__pyx_v_key); + if (__pyx_t_4) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":177 - * for key, dt in preader.class_dtypes.items(): + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":204 + * for key, dt in mio5p.MDTYPES[byte_order]['classes'].items(): * if isinstance(key, str): * continue # <<<<<<<<<<<<<< * self.class_dtypes[key] = dt @@ -2138,20 +2402,20 @@ } __pyx_L12:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":178 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":205 * if isinstance(key, str): * continue * self.class_dtypes[key] = dt # <<<<<<<<<<<<<< * # cache correctly byte ordered dtypes * if self.little_endian: */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->class_dtypes[__pyx_t_9]) = ((PyObject *)__pyx_v_dt); + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->class_dtypes[__pyx_t_6]) = ((PyObject *)__pyx_v_dt); __pyx_L10_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":180 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":207 * self.class_dtypes[key] = dt * # cache correctly byte ordered dtypes * if self.little_endian: # <<<<<<<<<<<<<< @@ -2160,88 +2424,88 @@ */ if (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":181 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":208 * # cache correctly byte ordered dtypes * if self.little_endian: * self.U1_dtype = np.dtype('U1') */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); + __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GIVEREF(__pyx_t_3); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype); __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype)); - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype = ((PyArray_Descr *)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L13; } /*else*/ { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":183 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":210 * self.U1_dtype = np.dtype('U1') # <<<<<<<<<<<<<< * bool_dtype = np.dtype('bool') * */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype); __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype)); - ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype = ((PyArray_Descr *)__pyx_t_1); - __pyx_t_1 = 0; + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype = ((PyArray_Descr *)__pyx_t_5); + __pyx_t_5 = 0; } __pyx_L13:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":184 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":211 * else: * self.U1_dtype = np.dtype('>U1') * bool_dtype = np.dtype('bool') # <<<<<<<<<<<<<< * * def set_stream(self, fobj): */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_n_s__bool)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__bool)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__bool)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bool)); - __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_bool_dtype); __pyx_v_bool_dtype = __pyx_t_2; __pyx_t_2 = 0; @@ -2251,12 +2515,14 @@ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.__cinit__"); __pyx_r = -1; __pyx_L0:; + __Pyx_DECREF(__pyx_v_byte_order); + __Pyx_DECREF(__pyx_v_uint16_codec); __Pyx_DECREF(__pyx_v_key); __Pyx_DECREF(__pyx_v_dt); __Pyx_DECREF(__pyx_v_bool_dtype); @@ -2264,7 +2530,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":186 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":213 * bool_dtype = np.dtype('bool') * * def set_stream(self, fobj): # <<<<<<<<<<<<<< @@ -2279,14 +2545,14 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("set_stream"); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":191 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":218 * Called from Python when initiating a variable read * ''' * self.cstream = streams.make_stream(fobj) # <<<<<<<<<<<<<< * * def read_tag(self): */ - __pyx_t_1 = ((PyObject *)__pyx_f_5scipy_2io_6matlab_7streams_make_stream(__pyx_v_fobj, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_5scipy_2io_6matlab_7streams_make_stream(__pyx_v_fobj, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->cstream); @@ -2306,7 +2572,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":193 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":220 * self.cstream = streams.make_stream(fobj) * * def read_tag(self): # <<<<<<<<<<<<<< @@ -2330,7 +2596,7 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("read_tag"); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":214 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":241 * cdef char tag_ptr[4] * cdef int tag_res * cdef object tag_data = None # <<<<<<<<<<<<<< @@ -2340,17 +2606,17 @@ __Pyx_INCREF(Py_None); __pyx_v_tag_data = Py_None; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":215 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":242 * cdef int tag_res * cdef object tag_data = None * tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr) # <<<<<<<<<<<<<< * if tag_res == 2: # sde format * tag_data = tag_ptr[:byte_count] */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->cread_tag(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), (&__pyx_v_mdtype), (&__pyx_v_byte_count), __pyx_v_tag_ptr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->cread_tag(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), (&__pyx_v_mdtype), (&__pyx_v_byte_count), __pyx_v_tag_ptr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tag_res = __pyx_t_1; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":216 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":243 * cdef object tag_data = None * tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr) * if tag_res == 2: # sde format # <<<<<<<<<<<<<< @@ -2360,14 +2626,14 @@ __pyx_t_2 = (__pyx_v_tag_res == 2); if (__pyx_t_2) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":217 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":244 * tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr) * if tag_res == 2: # sde format * tag_data = tag_ptr[:byte_count] # <<<<<<<<<<<<<< * return (mdtype, byte_count, tag_data) * */ - __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_tag_ptr + 0, __pyx_v_byte_count - 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_tag_ptr + 0, __pyx_v_byte_count - 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(__pyx_v_tag_data); __pyx_v_tag_data = ((PyObject *)__pyx_t_3); @@ -2376,7 +2642,7 @@ } __pyx_L5:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":218 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":245 * if tag_res == 2: # sde format * tag_data = tag_ptr[:byte_count] * return (mdtype, byte_count, tag_data) # <<<<<<<<<<<<<< @@ -2384,11 +2650,11 @@ * cdef int cread_tag(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_byte_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_byte_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -2418,7 +2684,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":220 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":247 * return (mdtype, byte_count, tag_data) * * cdef int cread_tag(self, # <<<<<<<<<<<<<< @@ -2439,7 +2705,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("cread_tag"); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":235 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":262 * cdef cnp.uint16_t mdtype_sde, byte_count_sde * cdef cnp.uint32_t mdtype * cdef cnp.uint32_t* u4_ptr = data_ptr # <<<<<<<<<<<<<< @@ -2448,16 +2714,16 @@ */ __pyx_v_u4_ptr = ((__pyx_t_5numpy_uint32_t *)__pyx_v_data_ptr); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":263 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":290 * # first four bytes are two little-endian uint16 values, first * # mdtype and second byte_count. * self.cstream.read_into(u4s, 8) # <<<<<<<<<<<<<< * if self.is_swapped: * mdtype = byteswap_u4(u4s[0]) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":264 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":291 * # mdtype and second byte_count`. * self.cstream.read_into(u4s, 8) * if self.is_swapped: # <<<<<<<<<<<<<< @@ -2466,7 +2732,7 @@ */ if (__pyx_v_self->is_swapped) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":265 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":292 * self.cstream.read_into(u4s, 8) * if self.is_swapped: * mdtype = byteswap_u4(u4s[0]) # <<<<<<<<<<<<<< @@ -2478,7 +2744,7 @@ } /*else*/ { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":267 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":294 * mdtype = byteswap_u4(u4s[0]) * else: * mdtype = u4s[0] # <<<<<<<<<<<<<< @@ -2489,7 +2755,7 @@ } __pyx_L3:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":270 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":297 * # The most significant two bytes of a U4 *mdtype* will always be * # 0, if they are not, this must be SDE format * byte_count_sde = mdtype >> 16 # <<<<<<<<<<<<<< @@ -2498,7 +2764,7 @@ */ __pyx_v_byte_count_sde = (__pyx_v_mdtype >> 16); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":271 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":298 * # 0, if they are not, this must be SDE format * byte_count_sde = mdtype >> 16 * if byte_count_sde: # small data element format # <<<<<<<<<<<<<< @@ -2507,7 +2773,7 @@ */ if (__pyx_v_byte_count_sde) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":272 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":299 * byte_count_sde = mdtype >> 16 * if byte_count_sde: # small data element format * mdtype_sde = mdtype & 0xffff # <<<<<<<<<<<<<< @@ -2516,7 +2782,7 @@ */ __pyx_v_mdtype_sde = (__pyx_v_mdtype & 0xffff); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":273 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":300 * if byte_count_sde: # small data element format * mdtype_sde = mdtype & 0xffff * if byte_count_sde > 4: # <<<<<<<<<<<<<< @@ -2526,26 +2792,26 @@ __pyx_t_2 = (__pyx_v_byte_count_sde > 4); if (__pyx_t_2) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":274 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":301 * mdtype_sde = mdtype & 0xffff * if byte_count_sde > 4: * raise ValueError('Error in SDE format data') # <<<<<<<<<<<<<< * return -1 * u4_ptr[0] = u4s[1] */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":275 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":302 * if byte_count_sde > 4: * raise ValueError('Error in SDE format data') * return -1 # <<<<<<<<<<<<<< @@ -2558,7 +2824,7 @@ } __pyx_L5:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":276 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":303 * raise ValueError('Error in SDE format data') * return -1 * u4_ptr[0] = u4s[1] # <<<<<<<<<<<<<< @@ -2567,7 +2833,7 @@ */ (__pyx_v_u4_ptr[0]) = (__pyx_v_u4s[1]); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":277 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":304 * return -1 * u4_ptr[0] = u4s[1] * mdtype_ptr[0] = mdtype_sde # <<<<<<<<<<<<<< @@ -2576,7 +2842,7 @@ */ (__pyx_v_mdtype_ptr[0]) = __pyx_v_mdtype_sde; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":278 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":305 * u4_ptr[0] = u4s[1] * mdtype_ptr[0] = mdtype_sde * byte_count_ptr[0] = byte_count_sde # <<<<<<<<<<<<<< @@ -2585,7 +2851,7 @@ */ (__pyx_v_byte_count_ptr[0]) = __pyx_v_byte_count_sde; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":279 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":306 * mdtype_ptr[0] = mdtype_sde * byte_count_ptr[0] = byte_count_sde * return 2 # <<<<<<<<<<<<<< @@ -2598,7 +2864,7 @@ } __pyx_L4:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":281 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":308 * return 2 * # regular element * if self.is_swapped: # <<<<<<<<<<<<<< @@ -2607,7 +2873,7 @@ */ if (__pyx_v_self->is_swapped) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":282 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":309 * # regular element * if self.is_swapped: * byte_count_ptr[0] = byteswap_u4(u4s[1]) # <<<<<<<<<<<<<< @@ -2619,7 +2885,7 @@ } /*else*/ { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":284 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":311 * byte_count_ptr[0] = byteswap_u4(u4s[1]) * else: * byte_count_ptr[0] = u4s[1] # <<<<<<<<<<<<<< @@ -2630,7 +2896,7 @@ } __pyx_L6:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":285 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":312 * else: * byte_count_ptr[0] = u4s[1] * mdtype_ptr[0] = mdtype # <<<<<<<<<<<<<< @@ -2639,7 +2905,7 @@ */ (__pyx_v_mdtype_ptr[0]) = __pyx_v_mdtype; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":286 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":313 * byte_count_ptr[0] = u4s[1] * mdtype_ptr[0] = mdtype * u4_ptr[0] = 0 # <<<<<<<<<<<<<< @@ -2648,7 +2914,7 @@ */ (__pyx_v_u4_ptr[0]) = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":287 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":314 * mdtype_ptr[0] = mdtype * u4_ptr[0] = 0 * return 1 # <<<<<<<<<<<<<< @@ -2670,7 +2936,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":289 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":316 * return 1 * * cdef object read_element(self, # <<<<<<<<<<<<<< @@ -2680,7 +2946,7 @@ static PyObject *__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype_ptr, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count_ptr, void **__pyx_v_pp, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element *__pyx_optional_args) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":293 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":320 * cnp.uint32_t *byte_count_ptr, * void **pp, * int copy=True): # <<<<<<<<<<<<<< @@ -2709,17 +2975,17 @@ } __pyx_v_data = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":329 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":356 * cdef int tag_res = self.cread_tag(mdtype_ptr, * byte_count_ptr, * tag_data) # <<<<<<<<<<<<<< * mdtype = mdtype_ptr[0] * byte_count = byte_count_ptr[0] */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, __pyx_v_tag_data); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, __pyx_v_tag_data); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tag_res = __pyx_t_1; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":330 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":357 * byte_count_ptr, * tag_data) * mdtype = mdtype_ptr[0] # <<<<<<<<<<<<<< @@ -2728,7 +2994,7 @@ */ __pyx_v_mdtype = (__pyx_v_mdtype_ptr[0]); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":331 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":358 * tag_data) * mdtype = mdtype_ptr[0] * byte_count = byte_count_ptr[0] # <<<<<<<<<<<<<< @@ -2737,7 +3003,7 @@ */ __pyx_v_byte_count = (__pyx_v_byte_count_ptr[0]); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":332 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":359 * mdtype = mdtype_ptr[0] * byte_count = byte_count_ptr[0] * if tag_res == 1: # full format # <<<<<<<<<<<<<< @@ -2747,7 +3013,7 @@ __pyx_t_2 = (__pyx_v_tag_res == 1); if (__pyx_t_2) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":336 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":363 * byte_count, * pp, * copy) # <<<<<<<<<<<<<< @@ -2756,13 +3022,13 @@ */ __pyx_t_4.__pyx_n = 1; __pyx_t_4.copy = __pyx_v_copy; - __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_string(__pyx_v_self->cstream, __pyx_v_byte_count, __pyx_v_pp, &__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_string(__pyx_v_self->cstream, __pyx_v_byte_count, __pyx_v_pp, &__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_data); __pyx_v_data = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":338 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":365 * copy) * # Seek to next 64-bit boundary * mod8 = byte_count % 8 # <<<<<<<<<<<<<< @@ -2771,7 +3037,7 @@ */ __pyx_v_mod8 = __Pyx_mod_long(__pyx_v_byte_count, 8); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":339 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":366 * # Seek to next 64-bit boundary * mod8 = byte_count % 8 * if mod8: # <<<<<<<<<<<<<< @@ -2780,7 +3046,7 @@ */ if (__pyx_v_mod8) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":340 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":367 * mod8 = byte_count % 8 * if mod8: * self.cstream.seek(8 - mod8, 1) # <<<<<<<<<<<<<< @@ -2789,7 +3055,7 @@ */ __pyx_t_5.__pyx_n = 1; __pyx_t_5.whence = 1; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; @@ -2797,32 +3063,32 @@ } /*else*/ { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":342 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":369 * self.cstream.seek(8 - mod8, 1) * else: # SDE format, make safer home for data * data = PyBytes_FromStringAndSize(tag_data, byte_count) # <<<<<<<<<<<<<< * pp[0] = data * return data */ - __pyx_t_3 = ((PyObject *)PyBytes_FromStringAndSize(__pyx_v_tag_data, __pyx_v_byte_count)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)PyBytes_FromStringAndSize(__pyx_v_tag_data, __pyx_v_byte_count)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_data); __pyx_v_data = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":343 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":370 * else: # SDE format, make safer home for data * data = PyBytes_FromStringAndSize(tag_data, byte_count) * pp[0] = data # <<<<<<<<<<<<<< * return data * */ - __pyx_t_6 = PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_pp[0]) = __pyx_t_6; } __pyx_L3:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":344 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":371 * data = PyBytes_FromStringAndSize(tag_data, byte_count) * pp[0] = data * return data # <<<<<<<<<<<<<< @@ -2847,7 +3113,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":346 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":373 * return data * * cdef int read_element_into(self, # <<<<<<<<<<<<<< @@ -2865,17 +3131,17 @@ struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_seek __pyx_t_3; __Pyx_RefNannySetupContext("read_element_into"); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":375 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":402 * mdtype_ptr, * byte_count_ptr, * ptr) # <<<<<<<<<<<<<< * cdef cnp.uint32_t byte_count = byte_count_ptr[0] * if res == 1: # full format */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, ((char *)__pyx_v_ptr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, ((char *)__pyx_v_ptr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_res = __pyx_t_1; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":376 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":403 * byte_count_ptr, * ptr) * cdef cnp.uint32_t byte_count = byte_count_ptr[0] # <<<<<<<<<<<<<< @@ -2884,7 +3150,7 @@ */ __pyx_v_byte_count = (__pyx_v_byte_count_ptr[0]); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":377 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":404 * ptr) * cdef cnp.uint32_t byte_count = byte_count_ptr[0] * if res == 1: # full format # <<<<<<<<<<<<<< @@ -2894,17 +3160,17 @@ __pyx_t_2 = (__pyx_v_res == 1); if (__pyx_t_2) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":378 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":405 * cdef cnp.uint32_t byte_count = byte_count_ptr[0] * if res == 1: # full format * res = self.cstream.read_into(ptr, byte_count) # <<<<<<<<<<<<<< * # Seek to next 64-bit boundary * mod8 = byte_count % 8 */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, __pyx_v_ptr, __pyx_v_byte_count); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, __pyx_v_ptr, __pyx_v_byte_count); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_res = __pyx_t_1; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":380 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":407 * res = self.cstream.read_into(ptr, byte_count) * # Seek to next 64-bit boundary * mod8 = byte_count % 8 # <<<<<<<<<<<<<< @@ -2913,7 +3179,7 @@ */ __pyx_v_mod8 = __Pyx_mod_long(__pyx_v_byte_count, 8); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":381 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":408 * # Seek to next 64-bit boundary * mod8 = byte_count % 8 * if mod8: # <<<<<<<<<<<<<< @@ -2922,7 +3188,7 @@ */ if (__pyx_v_mod8) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":382 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":409 * mod8 = byte_count % 8 * if mod8: * self.cstream.seek(8 - mod8, 1) # <<<<<<<<<<<<<< @@ -2931,7 +3197,7 @@ */ __pyx_t_3.__pyx_n = 1; __pyx_t_3.whence = 1; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; @@ -2939,7 +3205,7 @@ } __pyx_L3:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":383 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":410 * if mod8: * self.cstream.seek(8 - mod8, 1) * return 0 # <<<<<<<<<<<<<< @@ -2959,7 +3225,7 @@ return __pyx_r; } -/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":385 +/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":412 * return 0 * * cpdef inline cnp.ndarray read_numeric(self, int copy=True): # <<<<<<<<<<<<<< @@ -2995,21 +3261,21 @@ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_numeric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_numeric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyInt_FromLong(__pyx_v_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3018,7 +3284,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":398 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":425 * cdef cnp.ndarray el * cdef object data = self.read_element( * &mdtype, &byte_count, &data_ptr, copy) # <<<<<<<<<<<<<< @@ -3027,12 +3293,12 @@ */ __pyx_t_4.__pyx_n = 1; __pyx_t_4.copy = __pyx_v_copy; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), ((void **)(&__pyx_v_data_ptr)), &__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), ((void **)(&__pyx_v_data_ptr)), &__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":399 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":426 * cdef object data = self.read_element( * &mdtype, &byte_count, &data_ptr, copy) * cdef cnp.dtype dt = self.dtypes[mdtype] # <<<<<<<<<<<<<< @@ -3043,7 +3309,7 @@ __Pyx_INCREF(((PyObject *)((PyArray_Descr *)__pyx_t_5))); __pyx_v_dt = ((PyArray_Descr *)__pyx_t_5); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":400 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":427 * &mdtype, &byte_count, &data_ptr, copy) * cdef cnp.dtype dt = self.dtypes[mdtype] * el_count = byte_count // dt.itemsize # <<<<<<<<<<<<<< @@ -3052,11 +3318,11 @@ */ if (unlikely(__pyx_v_dt->elsize == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_el_count = (__pyx_v_byte_count / __pyx_v_dt->elsize); - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":401 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":428 * cdef cnp.dtype dt = self.dtypes[mdtype] * el_count = byte_count // dt.itemsize * cdef int flags = 0 # <<<<<<<<<<<<<< @@ -3065,7 +3331,7 @@ */ __pyx_v_flags = 0; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":402 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":429 * el_count = byte_count // dt.itemsize * cdef int flags = 0 * if copy: # <<<<<<<<<<<<<< @@ -3074,7 +3340,7 @@ */ if (__pyx_v_copy) { - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":403 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":430 * cdef int flags = 0 * if copy: * flags = cnp.NPY_WRITEABLE # <<<<<<<<<<<<<< @@ -3086,7 +3352,7 @@ } __pyx_L3:; - /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":404 + /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio5_utils.pyx":431 * if copy: * flags = cnp.NPY_WRITEABLE * Py_INCREF(