Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
ran reindent
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman committed Feb 8, 2008
1 parent 0b7800b commit c66da19
Show file tree
Hide file tree
Showing 24 changed files with 170 additions and 182 deletions.
1 change: 0 additions & 1 deletion benchmarks/simpleindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@
print "Numarray: ", numarray_timer.repeat(3,100)
print "Python: ", python_timer.repeat(3,100)
print "Optimized: ", numpy_timer3.repeat(3,100)

4 changes: 2 additions & 2 deletions numpy/_import_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ def __call__(self,*packages, **options):
Parameters
----------
*packges : arg-tuple
*packges : arg-tuple
the names (one or more strings) of all the modules one
wishes to load into the top-level namespace.
verbose= : integer
verbose= : integer
verbosity level [default: -1].
verbose=-1 will suspend also warnings.
force= : bool
Expand Down
10 changes: 5 additions & 5 deletions numpy/add_newdocs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is only meant to add docs to
# objects defined in C-extension modules.
# The purpose is to allow easier editing of the
# docstrings without requiring a re-compile.
# docstrings without requiring a re-compile.
from lib import add_newdoc

add_newdoc('numpy.core','dtype',
Expand Down Expand Up @@ -238,7 +238,7 @@
open file object or string containing file name.
dtype : data-type
data type of the returned array
count : int
count : int
number of items to read (-1 mean 'all')
sep : string
separater between items if file is a text file (default "")
Expand Down Expand Up @@ -1107,8 +1107,8 @@
is done if the array is not of float type and 'decimals' is >= 0.
The keyword 'out' may be used to specify a different array to hold the
result rather than the default new array. If the type of the array
specified by 'out' differs from that of 'a', the result is cast to the
result rather than the default new array. If the type of the array
specified by 'out' differs from that of 'a', the result is cast to the
new type, otherwise the original type is kept. Floats round to floats
by default.
Expand Down Expand Up @@ -1209,7 +1209,7 @@
|'heapsort' | 3 | O(n*log(n)) | 0 | no |
|------------------------------------------------------|
All the sort algorithms make temporary copies of the data when the sort is
All the sort algorithms make temporary copies of the data when the sort is
not along the last axis. Consequently, sorts along the last axis are faster
and use less space than sorts along other axis.
"""))
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/code_generators/generate_ufunc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

def generate_api(output_dir, force=False):
basename = 'ufunc_api'

h_file = os.path.join(output_dir, '__%s.h' % basename)
c_file = os.path.join(output_dir, '__%s.c' % basename)
d_file = os.path.join(output_dir, '%s.txt' % basename)
Expand Down
16 changes: 8 additions & 8 deletions numpy/core/defmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ def asmatrix(data, dtype=None):
class matrix(N.ndarray):
"""mat = matrix(data, dtype=None, copy=True)
Returns a matrix from an array-like object, or a string of
Returns a matrix from an array-like object, or a string of
data. A matrix is a specialized 2-d array that retains
it's 2-d nature through operations and where '*' means matrix
multiplication and '**' means matrix power.
multiplication and '**' means matrix power.
Parameters
----------
data : array-like or string
If data is a string, then interpret the string as a matrix
with commas or spaces separating columns and semicolons
If data is a string, then interpret the string as a matrix
with commas or spaces separating columns and semicolons
separating rows.
If data is array-like than convert the array to a matrix.
dtype : data-type
Expand Down Expand Up @@ -273,7 +273,7 @@ def mean(self, axis=None, out=None):
the flattened array by default, otherwise over the specified axis.
Parameters
----------
----------
axis : integer
Axis along which the means are computed. The default is
to compute the standard deviation of the flattened array.
Expand All @@ -289,7 +289,7 @@ def mean(self, axis=None, out=None):
cast if necessary.
Returns
-------
-------
mean : The return type varies, see above.
A new array holding the result is returned unless out is
specified, in which case a reference to out is returned.
Expand Down Expand Up @@ -342,7 +342,7 @@ def std(self, axis=None, dtype=None, out=None):
mean : average
Notes
-----
-----
The standard deviation is the square root of the
average of the squared deviations from the mean, i.e. var =
sqrt(mean((x - x.mean())**2)). The computed standard
Expand All @@ -362,7 +362,7 @@ def var(self, axis=None, dtype=None, out=None):
----------
axis : integer
Axis along which the variance is computed. The default is to
compute the variance of the flattened array.
compute the variance of the flattened array.
dtype : data-type
Type to use in computing the variance. For arrays of integer
type the default is float32, for arrays of float types it is
Expand Down
8 changes: 4 additions & 4 deletions numpy/core/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def asfortranarray(a, dtype=None):

def require(a, dtype=None, requirements=None):
"""Return an ndarray of the provided type that satisfies requirements.
This function is useful to be sure that an array with the correct flags
is returned for passing to compiled code (perhaps through ctypes).
Expand All @@ -160,7 +160,7 @@ def require(a, dtype=None, requirements=None):
dtype : data-type
The required data-type (None is the default data-type -- float64)
requirements : list of strings
The requirements list can be any of the
The requirements list can be any of the
'ENSUREARRAY' ('E') - ensure that a base-class ndarray
'F_CONTIGUOUS' ('F') - ensure a Fortran-contiguous array
'C_CONTIGUOUS' ('C') - ensure a C-contiguous array
Expand All @@ -169,7 +169,7 @@ def require(a, dtype=None, requirements=None):
'OWNDATA' ('O') - ensure an array that owns its own data
The returned array will be guaranteed to have the listed requirements
by making a copy if needed.
by making a copy if needed.
"""
if requirements is None:
requirements = []
Expand Down Expand Up @@ -276,7 +276,7 @@ def vdot(a, b):
try:
# importing this changes the dot function for basic 4 types
# to blas-optimized versions.
from _dotblas import dot, vdot, inner, alterdot, restoredot
from _dotblas import dot, vdot, inner, alterdot, restoredot
except ImportError:
def alterdot():
"Does Nothing"
Expand Down
18 changes: 9 additions & 9 deletions numpy/core/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def find_duplicate(list):
class format_parser:
"""Class to convert formats, names, titles description to a dtype
After constructing the format_parser object, the dtype attribute is
After constructing the format_parser object, the dtype attribute is
the converted data-type.
dtype = format_parser(formats, names, titles).dtype
Parameters
Expand All @@ -59,18 +59,18 @@ class format_parser:
comma-separated field names --- 'col1, col2, col3'
list or tuple of field names
titles : sequence
sequence of title strings or unicode
sequence of title strings or unicode
aligned : bool
align the fields by padding as the C-compiler would
byteorder :
If specified, all the fields will be changed to the
byteorder :
If specified, all the fields will be changed to the
provided byteorder. Otherwise, the default byteorder is
used.
Returns
-------
object
A Python object whose dtype attribute is a data-type.
A Python object whose dtype attribute is a data-type.
"""
def __init__(self, formats, names, titles, aligned=False, byteorder=None):
self._parseFormats(formats, aligned)
Expand Down Expand Up @@ -227,9 +227,9 @@ class recarray(ndarray):
by the *formats*, *names*, *titles*, *aligned*, and *byteorder* keywords.
buf : [buffer] or None
If this is None, then a new array is created of the given shape and data-type
If this is an object exposing the buffer interface, then the array will
use the memory from an existing buffer. In this case, the *offset* and
*strides* keywords can also be used.
If this is an object exposing the buffer interface, then the array will
use the memory from an existing buffer. In this case, the *offset* and
*strides* keywords can also be used.
See Also
--------
Expand Down
8 changes: 4 additions & 4 deletions numpy/core/scons_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def split_ext(string):
# Ufunc and multiarray API generators
#------------------------------------
def do_generate_array_api(target, source, env):
nowrap_do_generate_array_api([str(i) for i in target],
nowrap_do_generate_array_api([str(i) for i in target],
[str(i) for i in source])
return 0

def do_generate_ufunc_api(target, source, env):
nowrap_do_generate_ufunc_api([str(i) for i in target],
nowrap_do_generate_ufunc_api([str(i) for i in target],
[str(i) for i in source])
return 0

Expand Down Expand Up @@ -74,7 +74,7 @@ def generate_from_template_emitter(target, source, env):
base, ext = split_ext(pbasename(str(source[0])))
t = pjoin(pdirname(str(target[0])), base)
return ([t], source)

#----------------
# umath generator
#----------------
Expand All @@ -92,7 +92,7 @@ def generate_umath(target, source, env):
def generate_umath_emitter(target, source, env):
t = str(target[0]) + '.c'
return ([t], source)

#-----------------------------------------
# Other functions related to configuration
#-----------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def generate_numpyconfig_h(ext, build_dir):
" python-dev|python-devel." % (python_h)

config.numpy_include_dirs
result = config_cmd.try_run(testcode,
result = config_cmd.try_run(testcode,
include_dirs = [python_include] + \
config.numpy_include_dirs,
library_dirs = default_lib_dirs)
Expand All @@ -190,7 +190,7 @@ def generate_numpyconfig_h(ext, build_dir):
target_f.close()
print 'EOF'
return target

def generate_api_func(module_name):
def generate_api(ext, build_dir):
script = join(codegen_dir, module_name + '.py')
Expand Down Expand Up @@ -405,9 +405,9 @@ def generate_numpyconfig_code(target):
#include "config.h"
int main()
{
{
FILE* f;
f = fopen("%s", "w");
if (f == NULL) {
return -1;
Expand Down
8 changes: 4 additions & 4 deletions numpy/core/setupscons.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def configuration(parent_package='',top_path=None):
join('code_generators', 'multiarray_api_order.txt'),
join('code_generators', 'ufunc_api_order.txt')]
core_src = [join('src', basename(i)) for i in glob.glob(join(local_dir,
'src',
'src',
'*.c'))]
core_src += [join('src', basename(i)) for i in glob.glob(join(local_dir,
'src',
'src',
'*.src'))]

source_files = dot_blas_src + api_definition + core_src + \
Expand All @@ -54,7 +54,7 @@ def add_numpyconfig_header():
incl_dir = os.path.dirname(target)
if incl_dir not in config.numpy_include_dirs:
config.numpy_include_dirs.append(incl_dir)
config.add_data_files((header_dir, target))
config.add_data_files((header_dir, target))

def add_array_api():
scons_build_dir = get_scons_build_dir()
Expand Down Expand Up @@ -83,7 +83,7 @@ def add_generated_files():
add_ufunc_api()
config.add_configres()

config.add_sconscript('SConstruct',
config.add_sconscript('SConstruct',
post_hook = add_generated_files,
source_files = source_files)

Expand Down
20 changes: 10 additions & 10 deletions numpy/distutils/command/scons.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

def get_scons_build_dir():
"""Return the top path where everything produced by scons will be put.
The path is relative to the top setup.py"""
from numscons import get_scons_build_dir
return get_scons_build_dir()

def get_scons_configres_dir():
"""Return the top path where everything produced by scons will be put.
The path is relative to the top setup.py"""
from numscons import get_scons_configres_dir
return get_scons_configres_dir()

def get_scons_configres_filename():
"""Return the top path where everything produced by scons will be put.
The path is relative to the top setup.py"""
from numscons import get_scons_configres_filename
return get_scons_configres_filename()
Expand Down Expand Up @@ -101,7 +101,7 @@ def dist2sconscxx(compiler):
def get_compiler_executable(compiler):
"""For any give CCompiler instance, this gives us the name of C compiler
(the actual executable).
NOTE: does NOT work with FCompiler instances."""
# Geez, why does distutils has no common way to get the compiler name...
if compiler.compiler_type == 'msvc':
Expand All @@ -112,7 +112,7 @@ def get_compiler_executable(compiler):
# hardcoded string
#compiler.initialize()
#print compiler.cc
return 'cl.exe'
return 'cl.exe'
else:
return compiler.compiler[0]

Expand All @@ -124,7 +124,7 @@ def get_f77_compiler_executable(compiler):
def get_cxxcompiler_executable(compiler):
"""For any give CCompiler instance, this gives us the name of CXX compiler
(the actual executable).
NOTE: does NOT work with FCompiler instances."""
# Geez, why does distutils has no common way to get the compiler name...
if compiler.compiler_type == 'msvc':
Expand All @@ -135,7 +135,7 @@ def get_cxxcompiler_executable(compiler):
# hardcoded string
#compiler.initialize()
#print compiler.cc
return 'cl.exe'
return 'cl.exe'
else:
return compiler.compiler_cxx[0]

Expand Down Expand Up @@ -181,7 +181,7 @@ class scons(old_build_ext):
# XXX: add an option to the scons command for configuration (auto/force/cache).
description = "Scons builder"
user_options = old_build_ext.user_options + \
[('jobs=', None,
[('jobs=', None,
"specify number of worker threads when executing scons"),
('scons-tool-path=', None, 'specify additional path '\
'(absolute) to look for scons tools'),
Expand Down Expand Up @@ -239,11 +239,11 @@ def finalize_options(self):
self.scons_compiler = dist2sconscc(distutils_compiler)
self.scons_compiler_path = protect_path(get_tool_path(distutils_compiler))
except DistutilsPlatformError, e:
if not self._bypass_distutils_cc:
if not self._bypass_distutils_cc:
raise e
else:
self.scons_compiler = compiler_type

# We do the same for the fortran compiler ...
fcompiler_type = self.fcompiler
from numpy.distutils.fcompiler import new_fcompiler
Expand Down
Loading

0 comments on commit c66da19

Please sign in to comment.