Permalink
Browse files

Added __array_priority__ to sparse matrix class.

  • Loading branch information...
1 parent a988144 commit 5ccb162c1499d25e98a7b9038f0a2dda93e69b8b @teoliphant teoliphant committed Nov 29, 2005
Showing with 12 additions and 8 deletions.
  1. +3 −2 Lib/io/mio.py
  2. +2 −0 Lib/sandbox/setup.py
  3. +5 −5 Lib/sandbox/xplt/setup.py
  4. +2 −1 Lib/sparse/sparse.py
View
@@ -554,7 +554,7 @@ def _parse_mimatrix(fid,bytes):
tupdims = tuple(dims[::-1])
if dclass in mxArrays:
result, unused =_get_element(fid)
- if type == mxCHAR_CLASS:
+ if dclass == mxCHAR_CLASS:
result = ''.join(asarray(result).astype('S1'))
else:
if cmplx:
@@ -621,7 +621,7 @@ def _parse_mimatrix(fid,bytes):
imag, unused = _get_element(fid)
try:
res = res + _unit_imag[imag.dtypechar] * imag
- except KeyError:
+ except (KeyError,AttributeError):
res = res + 1j*imag
if have_sparse:
spmat = scipy.sparse.csc_matrix(res, (rowind[:len(res)], colind),
@@ -733,6 +733,7 @@ def loadmat(name, dict=None, appendmat=1, basename='raw'):
fid = open(test_name,'rb')
fid.close()
full_name = test_name
+ break
except IOError:
pass
if full_name is None:
View
@@ -10,6 +10,8 @@ def configuration(parent_package='',top_path=None):
# ODRPACK
#config.add_subpackage('odr')
+
+ config.add_subpackage('xplt')
return config
View
@@ -5,11 +5,11 @@
import os
import sys
from distutils import dir_util
-from scipy_distutils.misc_util import get_path, default_config_dict, dot_join
-from scipy_distutils.misc_util import dict_append, get_build_temp
-from scipy_distutils.misc_util import SourceFilter
-from scipy_distutils.core import Extension
-from scipy_distutils.system_info import get_info
+from scipy.distutils.misc_util import get_path, default_config_dict, dot_join
+from scipy.distutils.misc_util import dict_append, get_build_temp
+from scipy.distutils.misc_util import SourceFilter
+from scipy.distutils.core import Extension
+from scipy.distutils.system_info import get_info
from distutils.sysconfig import get_python_lib
View
@@ -64,7 +64,8 @@ class spmatrix:
""" This class provides a base class for all sparse matrices. It
cannot be instantiated. Most of the work is provided by subclasses.
"""
-
+
+ __array_priority__ = 10.1
def __init__(self, maxprint=MAXPRINT, allocsize=ALLOCSIZE):
self.format = self.__class__.__name__[:3]
if self.format == 'spm':

0 comments on commit 5ccb162

Please sign in to comment.