bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def matrix_getter_factory(self): ''' Returns reader for next matrix at top level ''' tag = self.read_dtype(self.dtypes['tag_full']) mdtype = tag['mdtype'] byte_count = tag['byte_count'] next_pos = self.mat_stream.tell() + byte_count if mdtype == miCOMPRESSED: getter = Mat5ZArrayReader(self, byte_count).matrix_getter_fa...
def matrix_getter_factory(self): ''' Returns reader for next matrix at top level ''' tag = self.read_dtype(self.dtypes['tag_full']) mdtype = tag['mdtype'] byte_count = tag['byte_count'] next_pos = self.mat_stream.tell() + byte_count if mdtype == miCOMPRESSED: getter = Mat5ZArrayReader(self, byte_count).matrix_getter_fa...
900
def matrix_getter_factory(self): ''' Returns reader for next matrix at top level ''' tag = self.read_dtype(self.dtypes['tag_full']) mdtype = tag['mdtype'] byte_count = tag['byte_count'] next_pos = self.mat_stream.tell() + byte_count if mdtype == miCOMPRESSED: getter = Mat5ZArrayReader(self, byte_count).matrix_getter_fa...
def matrix_getter_factory(self): ''' Returns reader for next matrix at top level ''' tag = self.read_dtype(self.dtypes['tag_full']) mdtype = tag['mdtype'] byte_count = tag['byte_count'] next_pos = self.mat_stream.tell() + byte_count if mdtype == miCOMPRESSED: getter = Mat5ZArrayReader(self, byte_count).matrix_getter_fa...
901
def current_getter(self): ''' Return matrix getter for current stream position
def current_getter(self, byte_count): ''' Return matrix getter for current stream position
902
def phiprime(alpha): global gc gc += 1 return Num.dot(fprime(xk+alpha*pk,*args),pk)
def phiprime(alpha): global gc gc += 1 return Num.dot(fprime(xk+alpha*pk,*args),pk)
903
def fmin_bfgs(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=1.49e-8, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno (...
def fmin_bfgs(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=1.49e-8, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno (...
904
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) #config.add_subpackage('cluster') #config.add_subpackage('fftpack') #config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpac...
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) #config.add_subpackage('cluster') #config.add_subpackage('fftpack') #config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpac...
905
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) #config.add_subpackage('cluster') #config.add_subpackage('fftpack') #config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpac...
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) #config.add_subpackage('cluster') #config.add_subpackage('fftpack') #config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpac...
906
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) #config.add_subpackage('cluster') #config.add_subpackage('fftpack') #config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpac...
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) #config.add_subpackage('cluster') #config.add_subpackage('fftpack') #config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpac...
907
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) #config.add_subpackage('cluster') #config.add_subpackage('fftpack') #config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpac...
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) #config.add_subpackage('cluster') #config.add_subpackage('fftpack') #config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpac...
908
def makeExpressions(context): """Make private copy of the expressions module with a custom get_context(). An attempt was made to make this threadsafe, but I can't guarantee it's bulletproof. """ import sys, imp modname = __name__[__name__.rfind('.')-1:] + '.expressions' # get our own, private copy of expressions imp.a...
def makeExpressions(context): """Make private copy of the expressions module with a custom get_context(). An attempt was made to make this threadsafe, but I can't guarantee it's bulletproof. """ import sys, imp modname = __name__[:__name__.rfind('.')] + '.expressions' # get our own, private copy of expressions imp.acq...
909
def register(wx_class): """ Create a gui_thread compatible version of wx_class Test whether a proxy is necessary. If so, generate and return the proxy class. if not, just return the wx_class unaltered. """ if running_in_second_thread: #print 'proxy generated' return proxify(wx_class) else: wx_class.init2 = wx_class....
def register(wx_class): """ Create a gui_thread compatible version of wx_class Test whether a proxy is necessary. If so, generate and return the proxy class. if not, just return the wx_class unaltered. """ if running_in_second_thread: #print 'proxy generated' return proxify(wx_class) else: if not hasattr(wx_class, '...
910
body = """def %(method)s(self,*args,**kw): \"\"\"%(documentation)s\"\"\" %(pre_test)s from gui_thread_guts import proxy_event, print_exception, smart_return %(import_statement)s #import statement finished = threading.Event() # remove proxies if present args = dereference_arglist(args) %(arguments)s #arguments evt = pro...
body = """def %(method)s(self,*args,**kw): \"\"\"%(documentation)s\"\"\" %(pre_test)s from gui_thread_guts import proxy_event, smart_return %(import_statement)s #import statement finished = threading.Event() # remove proxies if present args = dereference_arglist(args) %(arguments)s #arguments evt = proxy_event(%(call_m...
911
body = """def %(method)s(self,*args,**kw): \"\"\"%(documentation)s\"\"\" %(pre_test)s from gui_thread_guts import proxy_event, print_exception, smart_return %(import_statement)s #import statement finished = threading.Event() # remove proxies if present args = dereference_arglist(args) %(arguments)s #arguments evt = pro...
body = """def %(method)s(self,*args,**kw): \"\"\"%(documentation)s\"\"\" %(pre_test)s from gui_thread_guts import proxy_event, print_exception, smart_return %(import_statement)s #import statement finished = threading.Event() # remove proxies if present args = dereference_arglist(args) %(arguments)s #arguments evt = pro...
912
def Numeric_random(size): import random from Numeric import zeros, Float64 results = zeros(size,Float64) f = results.flat for i in range(len(f)): f[i] = random.random() return results
913
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
def fmin_bfgs(f, x0, fprime=None, args=(), gtol=1e-4, norm=Inf, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and ...
914
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
915
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
916
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
917
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
def fmin_bfgs(f, x0, fprime=None, args=(), maxgtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function using the BFGS algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno ...
918
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
def fmin_cg(f, x0, fprime=None, args=(), gtol=1e-4, norm=Inf, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm ...
919
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
920
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
921
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
922
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Pola...
923
def copy(self): csc = self.tocsc() return csc.copy()
def copy(self): csc = self.tocsc() return csc.copy()
924
def copy(self): csc = self.tocsc() return csc.copy()
def copy(self): csc = self.tocsc() return csc.copy()
925
def copy(self): csc = self.tocsc() return csc.copy()
def copy(self): csc = self.tocsc() return csc.copy()
926
def __init__(self, arg1, dims=(None,None), nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isdense(arg1): # Convert the dense matrix arg1 to CSC format if rank(arg1) == 2: s = asarray(arg1) if s.dtypechar not in 'fdFD': # Use a double array as the source (but leave it alone) s = s*1.0 if (rank(s) == 2): M...
def __init__(self, arg1, dims=(None,None), nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isdense(arg1): # Convert the dense matrix arg1 to CSC format if rank(arg1) == 2: s = asarray(arg1) if s.dtypechar not in 'fdFD': # Use a double array as the source (but leave it alone) s = s*1.0 if (rank(s) == 2): M...
927
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
928
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
929
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
930
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
931
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
def copy(self): new = csc_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtypechar) new.data = self.data.copy() new.rowind = self.rowind.copy() new.indptr = self.indptr.copy() new._check() return new
932
def __init__(self, arg1, arg2=None, arg3=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isspmatrix(arg1): s = arg1 if isinstance(s, csr_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.colind = s.colind.copy() self.indptr = s.indptr.copy() else...
def __init__(self, arg1, arg2=None, arg3=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isdense(arg1): if rank(arg1) == 2: s = asarray(arg1) ocsc = csc_matrix(transpose(s)) self.colind = ocsc.rowind self.indptr = ocsc.indptr self.data = ocsc.data self.shape = (ocsc.shape[1], ocsc.shape[0]) elif i...
933
def __init__(self, arg1, arg2=None, arg3=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isspmatrix(arg1): s = arg1 if isinstance(s, csr_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.colind = s.colind.copy() self.indptr = s.indptr.copy() else...
def __init__(self, arg1, arg2=None, arg3=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isspmatrix(arg1): s = arg1 if isinstance(s, csr_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.colind = s.colind.copy() self.indptr = s.indptr.copy() else...
934
def __init__(self, arg1, arg2=None, arg3=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isspmatrix(arg1): s = arg1 if isinstance(s, csr_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.colind = s.colind.copy() self.indptr = s.indptr.copy() else...
def __init__(self, arg1, arg2=None, arg3=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isspmatrix(arg1): s = arg1 if isinstance(s, csr_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.colind = s.colind.copy() self.indptr = s.indptr.copy() else...
935
def __init__(self, arg1, arg2=None, arg3=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isspmatrix(arg1): s = arg1 if isinstance(s, csr_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.colind = s.colind.copy() self.indptr = s.indptr.copy() else...
def __init__(self, arg1, arg2=None, arg3=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isspmatrix(arg1): s = arg1 if isinstance(s, csr_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.colind = s.colind.copy() self.indptr = s.indptr.copy() else...
936
def __add__(self, other): # First check if argument is a scalar if isscalar(other) or (isdense(other) and rank(other)==0): # Now we would add this scalar to every element. raise NotImplementedError, 'adding a scalar to a sparse matrix ' \ 'is not yet supported' elif isspmatrix(other): ocs = other.tocsr() if (ocs.shape ...
def __add__(self, other): # First check if argument is a scalar if isscalar(other) or (isdense(other) and rank(other)==0): # Now we would add this scalar to every element. raise NotImplementedError, 'adding a scalar to a sparse matrix ' \ 'is not yet supported' elif isspmatrix(other): ocs = other.tocsr() if (ocs.shape ...
937
def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other) or (isdense(other) and rank(other)==0): new = self.copy() new.data = new.data ** other new.dtypechar = new.data.dtypechar new.ftype = _transtabl[new.dtypechar] return new elif...
def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other) or (isdense(other) and rank(other)==0): new = self.copy() new.data = new.data ** other new.dtypechar = new.data.dtypechar new.ftype = _transtabl[new.dtypechar] return new elif...
938
def matmat(self, other): if isspmatrix(other): M, K1 = self.shape K2, N = other.shape a, rowa, ptra = self.data, self.colind, self.indptr if (K1 != K2): raise ValueError, "shape mismatch error" if isinstance(other, csc_matrix): other._check() dtypechar = _coerce_rules[(self.dtypechar, other.dtypechar)] ftype = _transta...
def matmat(self, other): if isspmatrix(other): M, K1 = self.shape K2, N = other.shape a, rowa, ptra = self.data, self.colind, self.indptr if (K1 != K2): raise ValueError, "shape mismatch error" if isinstance(other, csc_matrix): other._check() dtypechar = _coerce_rules[(self.dtypechar, other.dtypechar)] ftype = _transta...
939
def tocsr(self, nzmax=None): """ Return Compressed Sparse Row format arrays for this matrix """ keys = self.keys() keys.sort() nnz = self.nnz assert nnz == len(keys) nzmax = max(nnz, nzmax) data = [0]*nzmax colind = [0]*nzmax row_ptr = [0]*(self.shape[0]+1) current_row = 0 k = 0 for key in keys: ikey0 = int(key[0]) ike...
def tocsr(self, nzmax=None): """ Return Compressed Sparse Row format arrays for this matrix """ keys = self.keys() keys.sort() nnz = self.nnz assert nnz == len(keys) nzmax = max(nnz, nzmax) data = [0]*nzmax colind = [0]*nzmax row_ptr = [0]*(self.shape[0]+1) current_row = 0 k = 0 for key in keys: ikey0 = int(key[0]) ike...
940
def tocsc(self, nzmax=None): """ Return Compressed Sparse Column format arrays for this matrix """ keys = self.keys() # Sort based on columns keys.sort(csc_cmp) nnz = self.nnz assert nnz == len(keys) nzmax = max(nnz, nzmax) data = [0]*nzmax rowind = [0]*nzmax col_ptr = [0]*(self.shape[1]+1) current_col = 0 k = 0 for k...
def tocsc(self, nzmax=None): """ Return Compressed Sparse Column format arrays for this matrix """ keys = self.keys() # Sort based on columns keys.sort(csc_cmp) nnz = self.nnz assert nnz == len(keys) nzmax = max(nnz, nzmax) data = [0]*nzmax rowind = [0]*nzmax col_ptr = [0]*(self.shape[1]+1) current_col = 0 k = 0 for k...
941
def tocsr(self): func = getattr(sparsetools, self.ftype+"cootocsc") data, row, col = self._normalize(rowfirst=True) a, cola, ptra, ierr = func(self.shape[0], data, col, row) if ierr: raise RuntimeError, "error in conversion" return csr_matrix(a, (cola, ptra), self.shape)
def tocsr(self): func = getattr(sparsetools, self.ftype+"cootocsc") data, row, col = self._normalize(rowfirst=True) a, cola, ptra, ierr = func(self.shape[0], data, col, row) if ierr: raise RuntimeError, "error in conversion" return csr_matrix(a, (cola, ptra), self.shape)
942
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) config.add_subpackage('cluster') config.add_subpackage('fftpack') config.add_subpackage('integrate') config.add_subpackage('interpolate') config.add_subpackage(...
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) config.add_subpackage('fftpack') config.add_subpackage('integrate') config.add_subpackage('interpolate') config.add_subpackage('io') config.add_subpackage('lib...
943
def getCSR(self): # Return Compressed Sparse Row format arrays for this matrix keys = self.keys() keys.sort() nnz = len(keys) data = [None]*nnz colind = [None]*nnz row_ptr = [None]*(self.shape[0]+1) current_row = -1 k = 0 for key in keys: ikey0 = int(key[0]) ikey1 = int(key[1]) if ikey0 != current_row: current_row = ik...
def getCSR(self): # Return Compressed Sparse Row format arrays for this matrix keys = self.keys() keys.sort() nnz = len(keys) data = [None]*nnz colind = [None]*nnz row_ptr = [None]*(self.shape[0]+1) current_row = -1 k = 0 for key in keys: ikey0 = int(key[0]) ikey1 = int(key[1]) if ikey0 != current_row: current_row = ik...
944
def getCSC(self): # Return Compressed Sparse Column format arrays for this matrix keys = self.keys() keys.sort(csc_cmp) nnz = len(keys) data = [None]*nnz rowind = [None]*nnz col_ptr = [None]*(self.shape[1]+1) current_col = -1 k = 0 for key in keys: ikey0 = int(key[0]) ikey1 = int(key[1]) if ikey1 != current_col: curren...
def getCSC(self): # Return Compressed Sparse Column format arrays for this matrix keys = self.keys() keys.sort(csc_cmp) nnz = len(keys) data = [None]*nnz rowind = [None]*nnz col_ptr = [None]*(self.shape[1]+1) current_col = -1 k = 0 for key in keys: ikey0 = int(key[0]) ikey1 = int(key[1]) if ikey1 != current_col: curren...
945
def sparse_linear_solve(A,b): if not hasattr(A, 'getCSR') and not hasattr(A, 'getCSC'): raise ValueError, "Sparse matrix must be able to return CSC format--"\ "A.getCSC()--or CSR format--A.getCSR()" if not hasattr(A,'shape'): raise ValueError, "Sparse matrix must be able to return shape (rows,cols) = A.shape" if hasatt...
def sparse_linear_solve(A,b,permc_spec=0): if not hasattr(A, 'getCSR') and not hasattr(A, 'getCSC'): raise ValueError, "Sparse matrix must be able to return CSC format--"\ "A.getCSC()--or CSR format--A.getCSR()" if not hasattr(A,'shape'): raise ValueError, "Sparse matrix must be able to return shape (rows,cols) = A.sha...
946
def sparse_linear_solve(A,b): if not hasattr(A, 'getCSR') and not hasattr(A, 'getCSC'): raise ValueError, "Sparse matrix must be able to return CSC format--"\ "A.getCSC()--or CSR format--A.getCSR()" if not hasattr(A,'shape'): raise ValueError, "Sparse matrix must be able to return shape (rows,cols) = A.shape" if hasatt...
def sparse_linear_solve(A,b): if not hasattr(A, 'getCSR') and not hasattr(A, 'getCSC'): raise ValueError, "Sparse matrix must be able to return CSC format--"\ "A.getCSC()--or CSR format--A.getCSR()" if not hasattr(A,'shape'): raise ValueError, "Sparse matrix must be able to return shape (rows,cols) = A.shape" if hasatt...
947
def str_array(arr, precision=5,col_sep=' ',row_sep="\n"): thestr = [] arr = asarray(arr) N,M = arr.shape thistype = arr.typecode() nofloat = (thistype in '1silbwu') or (thistype in 'Oc') cmplx = thistype in 'FD' fmtstr = "%%.%de" % precision for n in xrange(N): theline = [] for m in xrange(M): val = arr[n,m] if nofloat...
def str_array(arr, precision=5,col_sep=' ',row_sep="\n",ss=0): thestr = [] arr = asarray(arr) N,M = arr.shape thistype = arr.typecode() nofloat = (thistype in '1silbwu') or (thistype in 'Oc') cmplx = thistype in 'FD' fmtstr = "%%.%de" % precision for n in xrange(N): theline = [] for m in xrange(M): val = arr[n,m] if no...
948
def str_array(arr, precision=5,col_sep=' ',row_sep="\n"): thestr = [] arr = asarray(arr) N,M = arr.shape thistype = arr.typecode() nofloat = (thistype in '1silbwu') or (thistype in 'Oc') cmplx = thistype in 'FD' fmtstr = "%%.%de" % precision for n in xrange(N): theline = [] for m in xrange(M): val = arr[n,m] if nofloat...
def str_array(arr, precision=5,col_sep=' ',row_sep="\n"): thestr = [] arr = asarray(arr) N,M = arr.shape thistype = arr.typecode() nofloat = (thistype in '1silbwu') or (thistype in 'Oc') cmplx = thistype in 'FD' fmtstr = "%%.%de" % precision for n in xrange(N): theline = [] for m in xrange(M): val = arr[n,m] if ss and ...
949
def str_array(arr, precision=5,col_sep=' ',row_sep="\n"): thestr = [] arr = asarray(arr) N,M = arr.shape thistype = arr.typecode() nofloat = (thistype in '1silbwu') or (thistype in 'Oc') cmplx = thistype in 'FD' fmtstr = "%%.%de" % precision for n in xrange(N): theline = [] for m in xrange(M): val = arr[n,m] if nofloat...
def str_array(arr, precision=5,col_sep=' ',row_sep="\n"): thestr = [] arr = asarray(arr) N,M = arr.shape thistype = arr.typecode() nofloat = (thistype in '1silbwu') or (thistype in 'Oc') cmplx = thistype in 'FD' fmtstr = "%%.%de" % precision for n in xrange(N): theline = [] for m in xrange(M): val = arr[n,m] if nofloat...
950
def write_array(fileobject, arr, separator=" ", linesep='\n', precision=5, keep_open=0): """Write a rank-2 or less array to file represented by fileobject. Inputs: fileobject -- An open file object or a string to a valid filename. arr -- The array to write. separator -- separator to write between elements of the arra...
def write_array(fileobject, arr, separator=" ", linesep='\n', precision=5, suppress_small=0, keep_open=0): """Write a rank-2 or less array to file represented by fileobject. Inputs: fileobject -- An open file object or a string to a valid filename. arr -- The array to write. separator -- separator to write between el...
951
def write_array(fileobject, arr, separator=" ", linesep='\n', precision=5, keep_open=0): """Write a rank-2 or less array to file represented by fileobject. Inputs: fileobject -- An open file object or a string to a valid filename. arr -- The array to write. separator -- separator to write between elements of the arra...
defwrite_array(fileobject,arr,separator="",linesep='\n',precision=5,keep_open=0):"""Writearank-2orlessarraytofilerepresentedbyfileobject.Inputs:fileobject--Anopenfileobjectorastringtoavalidfilename.arr--Thearraytowrite.separator--separatortowritebetweenelementsofthearray.linesep--separatortowritebetweenrowsofarraypreci...
952
def write_array(fileobject, arr, separator=" ", linesep='\n', precision=5, keep_open=0): """Write a rank-2 or less array to file represented by fileobject. Inputs: fileobject -- An open file object or a string to a valid filename. arr -- The array to write. separator -- separator to write between elements of the arra...
defwrite_array(fileobject,arr,separator="",linesep='\n',precision=5,keep_open=0):"""Writearank-2orlessarraytofilerepresentedbyfileobject.Inputs:fileobject--Anopenfileobjectorastringtoavalidfilename.arr--Thearraytowrite.separator--separatortowritebetweenelementsofthearray.linesep--separatortowritebetweenrowsofarraypreci...
953
def write_array(fileobject, arr, separator=" ", linesep='\n', precision=5, keep_open=0): """Write a rank-2 or less array to file represented by fileobject. Inputs: fileobject -- An open file object or a string to a valid filename. arr -- The array to write. separator -- separator to write between elements of the arra...
def write_array(fileobject, arr, separator=" ", linesep='\n', precision=5, keep_open=0): """Write a rank-2 or less array to file represented by fileobject. Inputs: fileobject -- An open file object or a string to a valid filename. arr -- The array to write. separator -- separator to write between elements of the arra...
954
def check_basic(self): ba = [1,2,10,11,6,5,4] ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]] for ctype in ['1','b','s','i','l','f','d','F','D']: a = array(ba,ctype) a2 = array(ba2,ctype) if ctype in ['1', 'b']: self.failUnlessRaises(ArithmeticError, cumprod, a) self.failUnlessRaises(ArithmeticError, cumprod, a2, 1) self.failUn...
def class test_trapz(unittest.TestCase): def check_basic(self): pass class test_diff(unittest.TestCase): pass class test_corrcoef(unittest.TestCase): pass class test_cov(unittest.TestCase): pass class test_squeeze(unittest.TestCase): pass class test_sinc(unittest.TestCase): pass class test_angle(unittest.TestCa...
955
def getsize_type(mtype): if mtype in ['B','uchar','byte','unsigned char','integer*1', 'int8']: mtype = 'B' elif mtype in ['h','schar', 'signed char']: mtype = 'B' elif mtype in ['h','short','int16','integer*2']: mtype = 'h' elif mtype in ['H','ushort','uint16','unsigned short']: mtype = 'H' elif mtype in ['i','int']: m...
def getsize_type(mtype): if mtype in ['B','uchar','byte','unsigned char','integer*1', 'int8']: mtype = 'B' elif mtype in ['h','schar', 'signed char']: mtype = 'B' elif mtype in ['h','short','int16','integer*2']: mtype = 'h' elif mtype in ['H','ushort','uint16','unsigned short']: mtype = 'H' elif mtype in ['i','int']: m...
956
def weibullppf(q, shape, left=0, loc=0.0, scale=1.0): a, b, loc, q, left = map(arr,(shape, scale, loc, q, left)) cond1 = (a>0) & (b>0) & (0<=q) & (q<=1) q = arr(where(left*(q==q), 1-q, q)) vals = pow(arr(log(1.0/arr(1-q))),1.0/a) return select([1-cond1,left==0], [scipy.nan, b*vals+loc], -b*vals+loc)
def weibullppf(q, shape, left=0, loc=0.0, scale=1.0): a, b, loc, q, left = map(arr,(shape, scale, loc, q, left)) cond1 = (a>0) & (b>0) & (0<=q) & (q<=1) q = arr(where(left+q-q, 1-q, q)) vals = pow(arr(log(1.0/arr(1-q))),1.0/a) return select([1-cond1,left==0], [scipy.nan, b*vals+loc], -b*vals+loc)
957
def dct(x,axis=-1): n = len(x.shape) N = x.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." xtilde = 0.0*x slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) slices[0][axis] = slice(None,N/2) slices[1][axis] = slice(None,None,2) slices[2][...
def dct(x,axis=-1): n = len(x.shape) N = x.shape[axis] even = (N%2 == 0) slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) slices[0][axis] = slice(None,N/2) slices[1][axis] = slice(None,None,2) slices[2][axis] = slice(N/2,None) slices[3][axis] = slice(N,None,-2) for k ...
958
def dct(x,axis=-1): n = len(x.shape) N = x.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." xtilde = 0.0*x slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) slices[0][axis] = slice(None,N/2) slices[1][axis] = slice(None,None,2) slices[2][...
def dct(x,axis=-1): n = len(x.shape) N = x.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." xtilde = 0.0*x slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) if even: xtilde = 0.0*x slices[0][axis] = slice(None,N/2) slices[1][axis] = slice...
959
def dct(x,axis=-1): n = len(x.shape) N = x.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." xtilde = 0.0*x slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) slices[0][axis] = slice(None,N/2) slices[1][axis] = slice(None,None,2) slices[2][...
def dct(x,axis=-1): n = len(x.shape) N = x.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." xtilde = 0.0*x slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) slices[0][axis] = slice(None,N/2) slices[1][axis] = slice(None,None,2) slices[2][...
960
def dct(x,axis=-1): n = len(x.shape) N = x.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." xtilde = 0.0*x slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) slices[0][axis] = slice(None,N/2) slices[1][axis] = slice(None,None,2) slices[2][...
def dct(x,axis=-1): n = len(x.shape) N = x.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." xtilde = 0.0*x slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) slices[0][axis] = slice(None,N/2) slices[1][axis] = slice(None,None,2) slices[2][...
961
def idct(v,axis=-1): n = len(v.shape) N = v.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." k = arange(N) ak = sb.r_[1.0,[2]*(N-1)]*exp(1j*pi*k/(2*N)) newshape = ones(n) newshape[axis] = N ak.shape = newshape xhat = real(scipy.ifft(v*ak,axis=axis)) x = 0.0*v slices = [None]*4 for k in ra...
def idct(v,axis=-1): n = len(v.shape) N = v.shape[axis] even = (N%2 == 0) slices = [None]*4 for k in range(4): slices[k] = [] for j in range(n): slices[k].append(slice(None)) slices[0][axis] = slice(None,None,2) slices[1][axis] = slice(None,N/2) slices[2][axis] = slice(N,None,-2) slices[3][axis] = slice(N/2,None) for k...
962
def idct(v,axis=-1): n = len(v.shape) N = v.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." k = arange(N) ak = sb.r_[1.0,[2]*(N-1)]*exp(1j*pi*k/(2*N)) newshape = ones(n) newshape[axis] = N ak.shape = newshape xhat = real(scipy.ifft(v*ak,axis=axis)) x = 0.0*v slices = [None]*4 for k in ra...
def idct(v,axis=-1): n = len(v.shape) N = v.shape[axis] if (N%2 != 0): raise ValueError, "Length of sequence must be even." k = arange(N) ak = sb.r_[1.0,[2]*(N-1)]*exp(1j*pi*k/(2*N)) newshape = ones(n) newshape[axis] = N ak.shape = newshape xhat = real(scipy.ifft(v*ak,axis=axis)) x = 0.0*v slices = [None]*4 for k in ra...
963
def yield(): if not threaded(): # forces the event handlers to finish their work. # this also forces deletion of windows. wxYield() else: time.sleep(0.05) # sync threads
def Yield(): if not threaded(): # forces the event handlers to finish their work. # this also forces deletion of windows. wxYield() else: time.sleep(0.05) # sync threads
964
def check_wx_class(self): "Checking a wxFrame proxied class" for i in range(5): f = gui_thread.register(TestFrame) a = f(None) p = weakref.ref(a) a.Close(1) del a yield() # this checks for memory leaks self.assertEqual(is_alive(p), 0)
def check_wx_class(self): "Checking a wxFrame proxied class" for i in range(5): f = gui_thread.register(TestFrame) a = f(None) p = weakref.ref(a) a.Close(1) del a Yield() # this checks for memory leaks self.assertEqual(is_alive(p), 0)
965
def check_exception(self): "Checking exception handling" f = gui_thread.register(TestFrame) a = f(None) p = weakref.ref(a) self.assertRaises(TypeError, a.Close, 1, 2, 3) a.Close() del a yield() # this checks for memory leaks self.assertEqual(is_alive(p), 0)
def check_exception(self): "Checking exception handling" f = gui_thread.register(TestFrame) a = f(None) p = weakref.ref(a) self.assertRaises(TypeError, a.Close, 1, 2, 3) a.Close() del a Yield() # this checks for memory leaks self.assertEqual(is_alive(p), 0)
966
def plot(x,*args,**keywds): """Plot curves. Description: Plot one or more curves on the same graph. Inputs: There can be a variable number of inputs which consist of pairs or triples. The second variable is plotted against the first using the linetype specified by the optional third variable in the triple. If onl...
def plot(x,*args,**keywds): """Plot curves. Description: Plot one or more curves on the same graph. Inputs: There can be a variable number of inputs which consist of pairs or triples. The second variable is plotted against the first using the linetype specified by the optional third variable in the triple. If onl...
967
def _rvs(self, c): z = norm(size=self._size) U = random(size=self._size) fac = 2 + c*c*z*z det = sqrt(fac*fac - 4) t1 = fac + det t2 = fac - det return t1*(U>0.5) + t2*(U<0.5)
def _rvs(self, c): z = norm.rvs(size=self._size) U = random(size=self._size) fac = 2 + c*c*z*z det = sqrt(fac*fac - 4) t1 = fac + det t2 = fac - det return t1*(U>0.5) + t2*(U<0.5)
968
def _rvs(self, c): return abs(norm(mu=c,size=self._size))
def _rvs(self, c): return abs(norm(mu=c,size=self._size))
969
def _rvs(self): return abs(norm(size=self._size))
def _rvs(self): return abs(norm(size=self._size))
970
def _rvs(self, s): return exp(s * norm(size=self._size))
def _rvs(self, s): return exp(s * norm(size=self._size))
971
def _bvalfromboundary(boundary): try: val = _boundarydict[boundary] << 2 except KeyError: if val not in [0,1,2]: raise ValueError, "Acceptable boundary flags are 'fill', 'wrap' (or 'circular'), \n and 'symm' (or 'symmetric')." val = boundary << 2 return val
def _bvalfromboundary(boundary): try: val = _boundarydict[boundary] << 2 except KeyError: if val not in [0,1,2] : raise ValueError, "Acceptable boundary flags are 'fill', 'wrap' (or 'circular'), \n and 'symm' (or 'symmetric')." val = boundary << 2 return val
972
def loadmat(name, dict=None, appendmat=1, basename='raw'): """Load the MATLAB(tm) mat file. If name is a full path name load it in. Otherwise search for the file on the sys.path list and load the first one found (the current directory is searched first). Both v4 (Level 1.0) and v6 matfiles are supported. Version 7....
def loadmat(name, dict=None, appendmat=1, basename='raw'): """Load the MATLAB(tm) mat file. If name is a full path name load it in. Otherwise search for the file on the sys.path list and load the first one found (the current directory is searched first). Both v4 (Level 1.0) and v6 matfiles are supported. Version 7....
973
def collapse (a,keepcols,collapsecols,stderr=0,ns=0,cfcn=None): """Averages data in collapsecol, keeping all unique items in keepcols (using unique, which keeps unique LISTS of column numbers), retaining the unique sets of values in keepcols, the mean for each. If the sterr or N of the mean are desired, set either or ...
def collapse (a,keepcols,collapsecols,stderr=0,ns=0,cfcn=None): """Averages data in collapsecol, keeping all unique items in keepcols (using unique, which keeps unique LISTS of column numbers), retaining the unique sets of values in keepcols, the mean for each. If the sterr or N of the mean are desired, set either or ...
974
def figure(n=None, style='/tmp/currstyle.gs', color=-2, frame=0, labelsize=14, labelfont='helvetica',aspect=1.618,dpi=75): if (aspect < 0.1) or (aspect > 10): aspect = 1.618 if isinstance(color, types.StringType): color = _colornum[color] fid = open(style,'w') syst = write_style.getsys(color=color,frame=frame, labelsiz...
def setdpi(num): """ Set the dpi for new windows """ if num in [75,100]: _dpi = num gist.set_default_dpi(_dpi) else: raise ValueError, "DPI must be 75 or 100" def figure(n=None,style='/tmp/currstyle.gs', color=-2, frame=0, labelsize=14, labelfont='helvetica',aspect=1.618): global _figures if (aspect < 0.1) or (aspect ...
975
def figure(n=None, style='/tmp/currstyle.gs', color=-2, frame=0, labelsize=14, labelfont='helvetica',aspect=1.618,dpi=75): if (aspect < 0.1) or (aspect > 10): aspect = 1.618 if isinstance(color, types.StringType): color = _colornum[color] fid = open(style,'w') syst = write_style.getsys(color=color,frame=frame, labelsiz...
def figure(n=None, style='/tmp/currstyle.gs', color=-2, frame=0, labelsize=14, labelfont='helvetica',aspect=1.618,dpi=75): if (aspect < 0.1) or (aspect > 10): aspect = 1.618 if isinstance(color, types.StringType): color = _colornum[color] fid = open(style,'w') syst = write_style.getsys(color=color,frame=frame, labelsiz...
976
def full_page(win,dpi=75): gist.window(win,style=_current_style,width=int(dpi*8.5),height=dpi*11,dpi=dpi)
def full_page(win): gist.window(win,style=_current_style,width=int(_dpi*8.5),height=_dpi*11)
977
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window at # cen...
978
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
979
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
980
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
981
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
982
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
983
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
def subplot(Numy,Numx,win=0,pw=None,ph=None,hsep=100,vsep=100,color='black',frame=0,fontsize=8,font=None,dpi=100,ticks=1): # Use gist.plsys to change coordinate systems # all inputs (except fontsize) given as pixels, gist wants # things in normalized device # coordinate. Window is brought up with center of window a...
984
def row_split(self,name,sequence): """experimental""" q=scipy.split(a,len(self.workers)) herd.cluster.loop_code(name+'=_q_','_q_',inputs={'_q_':q},returns=(),global_vars=(name,))
def row_split(self,name,sequence): """experimental""" q=scipy.split(a,len(self.workers)) herd.cluster.loop_code(name+'=_q_','_q_',inputs={'_q_':q},returns=(),global_vars=(name,))
985
def row_rather(self,name): """experimental""" concatenate(herd.cluster.[name])
def row_rather(self,name): """experimental""" from Numeric import concatenate return concatenate(self[name])
986
def daub(p): """The coefficients for the FIR low-pass filter producing Daubechies wavelets. p>=1 gives the order of the zero at f=1/2. There are 2p filter coefficients. """ sqrt = sb.sqrt assert(p>=1) if p==1: c = 1/sqrt(2) return sb.array([c,c]) elif p==2: f = sqrt(2)/8 c = sqrt(3) return f*sb.array([1+c,3+c,3-c,1-c...
def daub(p): """The coefficients for the FIR low-pass filter producing Daubechies wavelets. p>=1 gives the order of the zero at f=1/2. There are 2p filter coefficients. """ sqrt = sb.sqrt assert(p>=1) if p==1: c = 1/sqrt(2) return sb.array([c,c]) elif p==2: f = sqrt(2)/8 c = sqrt(3) return f*sb.array([1+c,3+c,3-c,1-c...
987
def daub(p): """The coefficients for the FIR low-pass filter producing Daubechies wavelets. p>=1 gives the order of the zero at f=1/2. There are 2p filter coefficients. """ sqrt = sb.sqrt assert(p>=1) if p==1: c = 1/sqrt(2) return sb.array([c,c]) elif p==2: f = sqrt(2)/8 c = sqrt(3) return f*sb.array([1+c,3+c,3-c,1-c...
def daub(p): """The coefficients for the FIR low-pass filter producing Daubechies wavelets. p>=1 gives the order of the zero at f=1/2. There are 2p filter coefficients. """ sqrt = sb.sqrt assert(p>=1) if p==1: c = 1/sqrt(2) return sb.array([c,c]) elif p==2: f = sqrt(2)/8 c = sqrt(3) return f*sb.array([1+c,3+c,3-c,1-c...
988
def configuration(parent_package=''): from scipy_distutils.core import Extension from scipy_distutils.misc_util import fortran_library_item, dot_join,\ SourceGenerator, get_path, default_config_dict, get_build_temp from scipy_distutils.system_info import get_info,dict_append,\ AtlasNotFoundError,LapackNotFoundError,Bla...
def configuration(parent_package=''): from scipy_distutils.core import Extension from scipy_distutils.misc_util import fortran_library_item, dot_join,\ SourceGenerator, get_path, default_config_dict, get_build_temp from scipy_distutils.system_info import get_info,dict_append,\ AtlasNotFoundError,LapackNotFoundError,Bla...
989
def configuration(parent_package=''): from scipy_distutils.core import Extension from scipy_distutils.misc_util import fortran_library_item, dot_join,\ SourceGenerator, get_path, default_config_dict, get_build_temp from scipy_distutils.system_info import get_info,dict_append,\ AtlasNotFoundError,LapackNotFoundError,Bla...
def configuration(parent_package=''): from scipy_distutils.core import Extension from scipy_distutils.misc_util import fortran_library_item, dot_join,\ SourceGenerator, get_path, default_config_dict, get_build_temp from scipy_distutils.system_info import get_info,dict_append,\ AtlasNotFoundError,LapackNotFoundError,Bla...
990
f.write('\ndef get_info(name): return globals().get(name,{})\n')
f.write('\ndef get_info(name): return globals().get(name,{})\n')
991
def __init__(self, parent, obj, **kw): self.parent = parent self.obj = scipy.ppresolve(obj) self.name = kw.pop('name',None) if self.name is None: self.name = self.obj.__name__ self.canedit = kw.pop('canedit',1) rend.Page.__init__(self, **kw)
def __init__(self, parent, obj, **kw): self.parent = parent self.obj = obj self.name = kw.pop('name',None) if self.name is None: self.name = self.obj.__name__ self.canedit = kw.pop('canedit',1) rend.Page.__init__(self, **kw)
992
def childFactory(self, context, name): if name not in self.all: print "Err 1: ", name, self.all return None child = getattr(self.obj,name,None)
def childFactory(self, context, name): if name not in self.all and not hasattr(self.obj,name): print "Err 1: ", name, self.all return None child = getattr(self.obj,name,None)
993
def bench_random(self,level=5): import numpy.linalg as linalg basic_inv = linalg.inverse print print ' Finding matrix inverse' print ' ==================================' print ' | contiguous | non-contiguous ' print '----------------------------------------------' print ' size | scipy | ...
def bench_random(self,level=5): import numpy.linalg as linalg basic_inv = linalg.inv print print ' Finding matrix inverse' print ' ==================================' print ' | contiguous | non-contiguous ' print '----------------------------------------------' print ' size | scipy | basi...
994
def config_x11(self): print print " ============= begin play/x11 configuration ==============" print from string import replace self.fatality=0
def config_x11(self): print print " ============= begin play/x11 configuration ==============" print from string import replace self.fatality=0
995
def getallparams(gistpath,local): if windows: extra_compile_args = ['-DGISTPATH="\\"' + gistpath + '\\""' ] else: extra_compile_args = ['-DGISTPATH="' + gistpath + '"' ] extra_link_args = [] if windows or cygwin: extra_compile_args.append("-DWINDOWS") extra_compile_args.append("-mwindows") extra_link_args.append("-mwi...
def getallparams(gistpath,local): if windows: extra_compile_args = ['-DGISTPATH="\\"' + gistpath + '\\""' ] else: extra_compile_args = ['-DGISTPATH="' + gistpath + '"' ] extra_link_args = [] if windows or cygwin: extra_compile_args.append("-DWINDOWS") extra_compile_args.append("-mwindows") extra_link_args.append("-mwi...
996
def get_package_config(name): sys.path.insert(0,os.path.join('scipy_core',name)) try: mod = __import__('setup_'+name) config = mod.configuration() finally: del sys.path[0] return config
def get_package_config(name): sys.path.insert(0,os.path.join('scipy_core',name)) try: mod = __import__('setup_'+name) config = mod.configuration() finally: del sys.path[0] return config
997
def ramp(x, y): return x
def xramp(x, y): return x
998
def ramp(x, y): return x
def ramp(x, y): return x
999