Permalink
Browse files

ran reindent.py to clean up whitespace

  • Loading branch information...
1 parent aa3c27c commit 0b77f0e5f0e46b2ef7c570ebda046c34bbcc0f26 @jarrodmillman jarrodmillman committed Oct 29, 2007
View
@@ -100,5 +100,4 @@ def __del__(self):
try:
self.close()
except ValueError:
- pass
-
+ pass
View
@@ -658,8 +658,8 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None,
dtype - the data-type of the resulting array. If this is a
record data-type, the the resulting array will be 1-d and each row will
be interpreted as an element of the array. The number of columns
- used must match the number of fields in the data-type in this case.
-
+ used must match the number of fields in the data-type in this case.
+
comments - the character used to indicate the start of a comment
in the file
@@ -699,21 +699,21 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None,
dtype = multiarray.dtype(dtype)
defconv = _getconv(dtype)
- converterseq = None
+ converterseq = None
if converters is None:
converters = {}
if dtype.names is not None:
converterseq = [_getconv(dtype.fields[name][0]) \
for name in dtype.names]
-
+
for i,line in enumerate(fh):
if i<skiprows: continue
line = line[:line.find(comments)].strip()
if not len(line): continue
vals = line.split(delimiter)
if converterseq is None:
- converterseq = [converters.get(j,defconv) \
- for j in xrange(len(vals))]
+ converterseq = [converters.get(j,defconv) \
+ for j in xrange(len(vals))]
if usecols is not None:
row = [converterseq[j](vals[j]) for j in usecols]
else:
@@ -730,7 +730,7 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None,
else: return X
-# adjust so that fmt can change across columns if desired.
+# adjust so that fmt can change across columns if desired.
def savetxt(fname, X, fmt='%.18e',delimiter=' '):
"""
@@ -776,7 +776,7 @@ def savetxt(fname, X, fmt='%.18e',delimiter=' '):
X.shape = origShape
-
+
@@ -894,10 +894,10 @@ def seterr(all=None, divide=None, over=None, under=None, invalid=None):
>>> seterr(over='raise') # doctest: +SKIP
{'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'}
-
+
>>> seterr(all='warn', over='raise') # doctest: +SKIP
{'over': 'raise', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'}
-
+
>>> int16(32000) * int16(3) # doctest: +SKIP
Traceback (most recent call last):
File "<stdin>", line 1, in ?
View
@@ -375,7 +375,7 @@ def fromrecords(recList, dtype=None, shape=None, formats=None, names=None,
>>> r.col1
array([456, 2])
>>> r.col2
- chararray(['dbe', 'de'],
+ chararray(['dbe', 'de'],
dtype='|S3')
>>> import cPickle
>>> print cPickle.loads(cPickle.dumps(r))
View
@@ -345,4 +345,3 @@ def generate_testcode(target):
if __name__=='__main__':
from numpy.distutils.core import setup
setup(configuration=configuration)
-
@@ -275,13 +275,13 @@ def clip(self, a, m, M, out=None):
# use slow-clip
selector = less(a, m)+2*greater(a, M)
return selector.choose((a, m, M), out=out)
-
+
# Handy functions
def _generate_data(self, n, m):
return randn(n, m)
def _generate_data_complex(self, n, m):
- return randn(n, m) + 1.j *rand(n, m)
+ return randn(n, m) + 1.j *rand(n, m)
def _generate_flt_data(self, n, m):
return (randn(n, m)).astype(float32)
@@ -320,7 +320,7 @@ def test_simple_double(self):
def test_simple_int(self):
"""Test native int input with scalar min/max."""
a = self._generate_int_data(self.nr, self.nc)
- a = a.astype(int)
+ a = a.astype(int)
m = -2
M = 4
ac = self.fastclip(a, m, M)
@@ -484,7 +484,7 @@ def test_type_cast_01(self):
def test_type_cast_02(self):
"Test native int32 input with int32 scalar min/max."
a = self._generate_int_data(self.nr, self.nc)
- a = a.astype(int32)
+ a = a.astype(int32)
m = -2
M = 4
ac = self.fastclip(a, m, M)
@@ -507,7 +507,7 @@ def test_type_cast_04(self):
M = float32(4)
act = self.fastclip(a,m,M)
ac = self.clip(a,m,M)
- assert_array_strict_equal(ac, act)
+ assert_array_strict_equal(ac, act)
def test_type_cast_04(self):
"Test native int32 with double arrays min/max."
@@ -217,7 +217,7 @@ def CCompiler_customize(self, dist, need_cxx=0):
+ self.compiler[1:]
else:
if hasattr(self,'compiler'):
- log.warn("#### %s #######" % (self.compiler,))
+ log.warn("#### %s #######" % (self.compiler,))
log.warn('Missing compiler_cxx fix for '+self.__class__.__name__)
return
@@ -116,7 +116,7 @@ def finalize_options(self):
self.swig_cpp = build_ext.swig_cpp
for c in ['swig','swig_opt']:
o = '--'+c.replace('_','-')
- v = getattr(build_ext,c,None)
+ v = getattr(build_ext,c,None)
if v:
if getattr(self,c):
log.warn('both build_src and build_ext define %s option' % (o))
@@ -156,4 +156,3 @@ def get_output(self, body, headers=None, include_dirs=None,
self._clean()
return exitcode, output
-
View
@@ -98,23 +98,23 @@ def get_distribution(always=False):
dist = distutils.dist.Distribution()
return dist
-def _exit_interactive_session(_cache=[]):
- if _cache:
- return # been here
- _cache.append(1)
- print '-'*72
- raw_input('Press ENTER to close the interactive session..')
- print '='*72
+def _exit_interactive_session(_cache=[]):
+ if _cache:
+ return # been here
+ _cache.append(1)
+ print '-'*72
+ raw_input('Press ENTER to close the interactive session..')
+ print '='*72
def setup(**attr):
- if len(sys.argv)<=1 and not attr.get('script_args',[]):
- from interactive import interactive_sys_argv
- import atexit
- atexit.register(_exit_interactive_session)
- sys.argv[:] = interactive_sys_argv(sys.argv)
- if len(sys.argv)>1:
- return setup(**attr)
+ if len(sys.argv)<=1 and not attr.get('script_args',[]):
+ from interactive import interactive_sys_argv
+ import atexit
+ atexit.register(_exit_interactive_session)
+ sys.argv[:] = interactive_sys_argv(sys.argv)
+ if len(sys.argv)>1:
+ return setup(**attr)
cmdclass = numpy_cmdclass.copy()
@@ -207,7 +207,7 @@ class FCompiler(CCompiler):
# This will be set by new_fcompiler when called in
# command/{build_ext.py, build_clib.py, config.py} files.
c_compiler = None
-
+
def __init__(self, *args, **kw):
CCompiler.__init__(self, *args, **kw)
self.distutils_vars = self.distutils_vars.clone(self._environment_hook)
@@ -1519,7 +1519,7 @@ def get_build_architecture():
#copied from python 2.5.1 distutils/msvccompiler.py
def get_build_architecture():
"""Return the processor architecture.
-
+
Possible results are "Intel", "Itanium", or "AMD64".
"""
prefix = " bit ("
@@ -841,7 +841,7 @@ def calc_info(self):
lapack_libs = self.get_libs('lapack_libs',['mkl_lapack'])
else:
lapack_libs = self.get_libs('lapack_libs',['mkl_lapack32','mkl_lapack64'])
-
+
info = {'libraries': lapack_libs}
dict_append(info,**mkl)
self.set_info(**info)
@@ -1083,7 +1083,7 @@ def calc_info(self):
tgexc tgsen tgsja tgsna tgsy2 tgsyl tpcon tprfs tptri tptrs
trcon trevc trexc trrfs trsen trsna trsyl trti2 trtri trtrs
tzrqf tzrzf
-
+
lacn2 lahr2 stemr laqr0 laqr1 laqr2 laqr3 laqr4 laqr5
''' # [s|c|d|z]*.f
sd_lasrc = '''
View
@@ -96,4 +96,3 @@ def otherfunc() :
"""
pass
-
View
@@ -293,7 +293,7 @@
},
'strarglens':{isstring:',int #varname#_cb_len'}, # untested with multiple args
'strarglens_td':{isstring:',int'}, # untested with multiple args
- 'strarglens_nm':{isstring:',#varname#_cb_len'}, # untested with multiple args
+ 'strarglens_nm':{isstring:',#varname#_cb_len'}, # untested with multiple args
},
{ # Scalars
'decl':{l_not(isintent_c):'\t#ctype# #varname#=(*#varname#_cb_capi);'},
@@ -65,7 +65,7 @@ def components(self):
return l
return self._components
components = property(components)
-
+
def initialize(self, *components, **options):
"""
Set additional attributes, add components to instance, etc.
@@ -86,7 +86,7 @@ def __repr__(self):
def provides(self):
"""
Return a code idiom name that the current class defines.
-
+
Used in avoiding redefinitions of functions and variables.
"""
if self._provides is None:
@@ -123,7 +123,7 @@ def _get_class_names(cls):
r += Component._get_class_names(b)
return r
_get_class_names = staticmethod(_get_class_names)
-
+
def add(self, component, container_label=None):
"""
Append component and its target container label to components list.
@@ -205,7 +205,7 @@ def _generate(self):
return evaluated template strings.
"""
#self.finalize()
-
+
# clean up containers
self.containers = {}
for n in dir(self):
@@ -249,7 +249,7 @@ def _generate(self):
container = component.get_container(k)
container.add(r, component.provides)
else:
-
+
self.warning('%s: no container label specified for component providing %r'\
% (self.__class__.__name__,component.provides))
component.parent = old_parent
@@ -284,7 +284,7 @@ def update_containers(self):
def get_container(self, name):
""" Return named container.
-
+
Rules for returning containers:
(1) return local container if exists
(2) return parent container if exists
@@ -295,7 +295,7 @@ def get_container(self, name):
return self.containers[name]
except KeyError:
pass
-
+
# parent container
parent = self.parent
while parent is not None:
@@ -380,7 +380,7 @@ def numpy_version(self):
import numpy
return numpy.__version__
numpy_version = property(numpy_version)
-
+
class Container(object):
"""
Container of a list of named strings.
@@ -401,7 +401,7 @@ class Container(object):
>>> c += c2
>>> print c
"hey, hoo, bar"
-
+
"""
__metaclass__ = ComponentMetaClass
@@ -435,7 +435,7 @@ def __init__(self,
self.replace_map = replace_map
self.ignore_empty_content = ignore_empty_content
self.skip_prefix_suffix_when_single = skip_prefix_suffix_when_single
-
+
def __nonzero__(self):
return bool(self.list)
@@ -452,7 +452,7 @@ def __add__(self, other):
for i,l in lst:
self.add(other.list[i], l)
else:
- self.add(other)
+ self.add(other)
return self
__iadd__ = __add__
@@ -532,12 +532,12 @@ def copy(self, mapping=None, **extra_options):
lst = [(i,l) for (l,i) in self.label_map.items()]
lst.sort()
for i,l in lst:
- cpy.add(mapping(other.list[i]), l)
+ cpy.add(mapping(other.list[i]), l)
return cpy
def _test():
import doctest
doctest.testmod()
-
+
if __name__ == "__main__":
_test()
@@ -177,7 +177,7 @@ class CFunction(Component):
%(CDeclaration)s
%(CBody)s
}'''
-
+
container_options = dict(
CArgument = dict(separator=', ', default='void'),
CDeclaration = dict(default='<KILLLINE>', use_indent=True, ignore_empty_content=True,
@@ -215,7 +215,7 @@ class CHeader(CLine):
>>> h = CHeader('noddy.h')
>>> print h.generate()
#include "noddy.h"
-
+
"""
template = '#include "%(line)s"'
@@ -288,6 +288,6 @@ class CSource(FileSource):
def _test():
import doctest
doctest.testmod()
-
+
if __name__ == "__main__":
_test()
Oops, something went wrong.

0 comments on commit 0b77f0e

Please sign in to comment.