[Scipy-svn] r2233 - in trunk/Lib: integrate interpolate io misc optimize signal sparse stats weave weave/examples

scipy-svn at scipy.org scipy-svn at scipy.org
Sun Sep 24 04:30:51 CDT 2006


Author: rkern
Date: 2006-09-24 04:30:41 -0500 (Sun, 24 Sep 2006)
New Revision: 2233

Modified:
   trunk/Lib/integrate/ode.py
   trunk/Lib/interpolate/fitpack2.py
   trunk/Lib/io/array_import.py
   trunk/Lib/io/dumbdbm_patched.py
   trunk/Lib/misc/ppimport.py
   trunk/Lib/optimize/anneal.py
   trunk/Lib/signal/ltisys.py
   trunk/Lib/sparse/sparse.py
   trunk/Lib/stats/distributions.py
   trunk/Lib/weave/accelerate_tools.py
   trunk/Lib/weave/base_info.py
   trunk/Lib/weave/base_spec.py
   trunk/Lib/weave/bytecodecompiler.py
   trunk/Lib/weave/catalog.py
   trunk/Lib/weave/dumbdbm_patched.py
   trunk/Lib/weave/examples/object.py
   trunk/Lib/weave/ext_tools.py
   trunk/Lib/weave/size_check.py
Log:
Inherit from object.

Modified: trunk/Lib/integrate/ode.py
===================================================================
--- trunk/Lib/integrate/ode.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/integrate/ode.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -94,7 +94,7 @@
 from numpy import asarray, array, zeros, sin, int32, isscalar
 import re, sys
 
-class ode:
+class ode(object):
     """\
 ode  - a generic interface class to numeric integrators. It has the
   following methods:
@@ -208,7 +208,7 @@
             return cl
     return
 
-class IntegratorBase:
+class IntegratorBase(object):
 
     runner = None            # runner is None => integrator is not available
     success = None           # success==1 if integrator was called successfully

Modified: trunk/Lib/interpolate/fitpack2.py
===================================================================
--- trunk/Lib/interpolate/fitpack2.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/interpolate/fitpack2.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -49,7 +49,7 @@
   xb<t[k+1]<t[k+2]<...<t[n-k-2]<xe"""
                     }
 
-class UnivariateSpline:
+class UnivariateSpline(object):
     """ Univariate spline s(x) of degree k on the interval
     [xb,xe] calculated from a given set of data points
     (x,y).
@@ -300,7 +300,7 @@
                     }
 
 
-class BivariateSpline:
+class BivariateSpline(object):
     """ Bivariate spline s(x,y) of degrees kx and ky on the rectangle
     [xb,xe] x [yb, ye] calculated from a given set of data points
     (x,y,z).

Modified: trunk/Lib/io/array_import.py
===================================================================
--- trunk/Lib/io/array_import.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/io/array_import.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -8,11 +8,22 @@
 """
 
 __all__ = ['read_array', 'write_array']
+
+# Standard library imports.
+import os
+import re
+import sys
+import types
+
+# Numpy imports.
 import numpy
-from numpy.oldnumeric import array, take, concatenate, Float, asarray, real, imag
-import numpy.oldnumeric as Numeric
-import types, re, sys
+from numpy import array, take, concatenate, asarray, real, imag
+# Sadly, this module is still written with typecodes in mind.
+from numpy.oldnumeric import Float
+
+# Local imports.
 import numpyio
+
 default = None
 _READ_BUFFER_SIZE = 1024*1024
 #_READ_BUFFER_SIZE = 1000
@@ -27,7 +38,6 @@
 #   with support from Agilent, Inc.
 #
 
-import os, sys
 
 def convert_separator(sep):
     newsep = ''
@@ -99,7 +109,7 @@
     return file
 
 
-class ascii_stream:
+class ascii_stream(object):
     """Text files with line iteration
 
     Ascii_stream instances can be used like normal read-only file objects
@@ -213,7 +223,6 @@
 # Regular expressions for detecting complex numbers and for dealing
 #  with spaces between the real and imaginary parts
 
-import re
 _obj = re.compile(r"""
       ([0-9.eE]+)            # Real part
       ([\t ]*)               # Space between real and imaginary part
@@ -276,7 +285,7 @@
     for k in range(N):
         collist[k] = build_numberlist(columns[k])
     _not_warned = 0
-    val = process_line(firstline, separator, collist, [Numeric.Float]*N, 0)
+    val = process_line(firstline, separator, collist, [Float]*N, 0)
     for k in range(N):
         colsize[k] = len(val[k])
     return colsize, collist
@@ -295,7 +304,7 @@
 
 
 def read_array(fileobject, separator=default, columns=default, comment="#",
-               lines=default, atype=Numeric.Float, linesep='\n',
+               lines=default, atype=Float, linesep='\n',
                rowsize=10000, missing=0):
     """Return an array or arrays from ascii_formatted data in |fileobject|.
 

Modified: trunk/Lib/io/dumbdbm_patched.py
===================================================================
--- trunk/Lib/io/dumbdbm_patched.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/io/dumbdbm_patched.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -30,7 +30,7 @@
 
 error = IOError             # For anydbm
 
-class _Database:
+class _Database(object):
 
     def __init__(self, file):
         self._dirfile = file + '.dir'

Modified: trunk/Lib/misc/ppimport.py
===================================================================
--- trunk/Lib/misc/ppimport.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/misc/ppimport.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -66,7 +66,7 @@
         return _AttrLoader(module, name)
     return getattr(module, name)
 
-class _AttrLoader:
+class _AttrLoader(object):
     def __init__(self, module, name):
         self.__dict__['_ppimport_attr_module'] = module
         self.__dict__['_ppimport_attr_name'] = name
@@ -231,7 +231,7 @@
     print '\n'.join(blocks)
     print '='*50
 
-class _ModuleLoader:
+class _ModuleLoader(object):
     # Don't use it directly. Use ppimport instead.
 
     def __init__(self,name,location,p_frame=None):

Modified: trunk/Lib/optimize/anneal.py
===================================================================
--- trunk/Lib/optimize/anneal.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/optimize/anneal.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -10,7 +10,7 @@
 __all__ = ['anneal']
 
 _double_max = numpy.finfo(float).max
-class base_schedule:
+class base_schedule(object):
     def __init__(self):
         self.dwell = 20
         self.learn_rate = 0.5
@@ -123,7 +123,7 @@
         self.T = self.T0 / log(self.k+1.0)
         return
 
-class _state:
+class _state(object):
     def __init__(self):
         self.x = None
         self.cost = None

Modified: trunk/Lib/signal/ltisys.py
===================================================================
--- trunk/Lib/signal/ltisys.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/signal/ltisys.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -181,7 +181,7 @@
     """
     return tf2zpk(*ss2tf(A,B,C,D,input=input))
 
-class lti:
+class lti(object):
     """Linear Time Invariant class which simplifies representation.
     """
     def __init__(self,*args,**kwords):

Modified: trunk/Lib/sparse/sparse.py
===================================================================
--- trunk/Lib/sparse/sparse.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/sparse/sparse.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -62,7 +62,7 @@
         data2 = data2.astype(newtype)
     return data1, data2
 
-class spmatrix:
+class spmatrix(object):
     """ This class provides a base class for all sparse matrices.  It
     cannot be instantiated.  Most of the work is provided by subclasses.
     """

Modified: trunk/Lib/stats/distributions.py
===================================================================
--- trunk/Lib/stats/distributions.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/stats/distributions.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -79,7 +79,7 @@
 ## Internal class to compute a ppf given a distribution.
 ##  (needs cdf function) and uses brentq from scipy.optimize
 ##  to compute ppf from cdf.
-class general_cont_ppf:
+class general_cont_ppf(object):
     def __init__(self, dist, xa=-10.0, xb=10.0, xtol=1e-14):
         self.dist = dist
         self.cdf = eval('%scdf'%dist)
@@ -96,7 +96,7 @@
 
 
 # Frozen RV class
-class rv_frozen:
+class rv_frozen(object):
     def __init__(self, dist, *args, **kwds):
         self.args = args
         self.kwds = kwds
@@ -230,7 +230,7 @@
         newargs[k] = extract(cond,newarr*expand_arr)
     return newargs
 
-class rv_continuous:
+class rv_continuous(object):
     """A Generic continuous random variable.
 
     Continuous random variables are defined from a standard form chosen

Modified: trunk/Lib/weave/accelerate_tools.py
===================================================================
--- trunk/Lib/weave/accelerate_tools.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/accelerate_tools.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -270,7 +270,7 @@
 ##################################################################
 #                        class ACCELERATE                        #
 ##################################################################
-class accelerate:
+class accelerate(object):
 
     def __init__(self, function, *args, **kw):
         assert inspect.isfunction(function)

Modified: trunk/Lib/weave/base_info.py
===================================================================
--- trunk/Lib/weave/base_info.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/base_info.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -10,7 +10,7 @@
 """
 import UserList
 
-class base_info:
+class base_info(object):
     _warnings =[]
     _headers = []
     _include_dirs = []

Modified: trunk/Lib/weave/base_spec.py
===================================================================
--- trunk/Lib/weave/base_spec.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/base_spec.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -1,4 +1,4 @@
-class base_converter:
+class base_converter(object):
     """
         Properties:
         headers --  list of strings that name the header files needed by this

Modified: trunk/Lib/weave/bytecodecompiler.py
===================================================================
--- trunk/Lib/weave/bytecodecompiler.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/bytecodecompiler.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -12,7 +12,7 @@
 ##################################################################
 #                       CLASS __DESCRIPTOR                       #
 ##################################################################
-class __Descriptor:
+class __Descriptor(object):
     prerequisites = []
     refcount = 0
     def __repr__(self):
@@ -210,7 +210,7 @@
 ##################################################################
 #                     CLASS BYTECODEMEANING                      #
 ##################################################################
-class ByteCodeMeaning:
+class ByteCodeMeaning(object):
     def fetch(self, pc,code):
         opcode = ord(code[pc])
         if opcode >= haveArgument:

Modified: trunk/Lib/weave/catalog.py
===================================================================
--- trunk/Lib/weave/catalog.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/catalog.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -282,7 +282,7 @@
             sh = shelve.open(catalog_file,mode)
     return sh
 
-class catalog:
+class catalog(object):
     """ Stores information about compiled functions both in cache and on disk.
 
         catalog stores (code, list_of_function) pairs so that all the functions

Modified: trunk/Lib/weave/dumbdbm_patched.py
===================================================================
--- trunk/Lib/weave/dumbdbm_patched.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/dumbdbm_patched.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -30,7 +30,7 @@
 
 error = IOError             # For anydbm
 
-class _Database:
+class _Database(object):
 
     def __init__(self, file):
         self._dirfile = file + '.dir'

Modified: trunk/Lib/weave/examples/object.py
===================================================================
--- trunk/Lib/weave/examples/object.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/examples/object.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -9,7 +9,7 @@
 # get/set attribute and call methods example
 #----------------------------------------------------------------------------
 
-class foo:
+class foo(object):
     def __init__(self):
         self.val = 1
     def inc(self,amount):

Modified: trunk/Lib/weave/ext_tools.py
===================================================================
--- trunk/Lib/weave/ext_tools.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/ext_tools.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -6,7 +6,7 @@
 import converters
 import base_spec
 
-class ext_function_from_specs:
+class ext_function_from_specs(object):
     def __init__(self,name,code_block,arg_specs):
         self.name = name
         self.arg_specs = base_spec.arg_spec_list(arg_specs)
@@ -179,7 +179,7 @@
 
 import base_info
 
-class ext_module:
+class ext_module(object):
     def __init__(self,name,compiler=''):
         standard_info = converters.standard_info
         self.name = name

Modified: trunk/Lib/weave/size_check.py
===================================================================
--- trunk/Lib/weave/size_check.py	2006-09-24 09:05:13 UTC (rev 2232)
+++ trunk/Lib/weave/size_check.py	2006-09-24 09:30:41 UTC (rev 2233)
@@ -101,7 +101,7 @@
             raise ValueError, "frames are not aligned"
     return res
 
-class dummy_array:
+class dummy_array(object):
     def __init__(self,ary,ary_is_shape = 0,name=None):
         self.name = name
         if ary_is_shape:



More information about the Scipy-svn mailing list