| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
DOC: Formatting fixes using regex
|
| | |
|
| |
| |
| |
| | |
also other spacing or formatting mistakes
|
|\ \
| | |
| | | |
Revert changes to contiguous flags definition while creating NPY_TEST_UNSAFE_STRIDES
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This largly reverts the changes to the flags setting api making the
newer preferable unsafe flags setting available through the
NPY_RELAXED_STRIDES_CHECKING eviroment variable. This variable is meant
for testing if code will stop working when the flags definition is changed.
The old definition is modified in some details to previously to enforce
safer strides (which was not the case before). This means that ndim==1
size==1 arrays are not necessarily considered contiguous. Also empty
arrays are not considered contiguous in some cases that were contiguous
before, and the rule that an array can only be both C and F-contiguous
if it is one (or zero) dimensional is relaxed, as it is incorrect for
size <= 1 arrays.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In this case, either the dimensions stride will never be used to
access an element, so that it does not matter to the data alignment,
or the array has a size of 0 and is thus never unaligned.
Relaxed align flag is only active if NPY_RELAXED_STRIDES_CHECKING
was set during compile time.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This flag will toggle to a new definition for the contiguous flags
where only the memory layout is forced to be correct. As a particular
example this means that np.ones((3,1)) can be both C and F-Contiguous
and its stride[-1] can be arbitrary but the array still contiguous.
The flag will also make most new arrays be created with MAX_INTP as
stride so that unsafe usage of the stride will surface more commonly.
|
|\ \
| | |
| | | |
2to3 apply import fixer
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With the exception of numpy/distutils/tests/test_exec_command.py, all
of these files are script files in tools/osxbuild and tools/win32build.
The import in the script files omits `absolute_import` as they are
not part of a package.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new import `absolute_import` is added the `from __future__ import`
statement and The 2to3 `import` fixer is run to make the imports
compatible. There are several things that need to be dealt with to make
this work.
1) Files meant to be run as scripts run in a different environment than
files imported as part of a package, and so changes to those files need
to be skipped. The affected script files are:
* all setup.py files
* numpy/core/code_generators/generate_umath.py
* numpy/core/code_generators/generate_numpy_api.py
* numpy/core/code_generators/generate_ufunc_api.py
2) Some imported modules are not available as they are created during
the build process and consequently 2to3 is unable to handle them
correctly. Files that import those modules need a bit of extra work.
The affected files are:
* core/__init__.py,
* core/numeric.py,
* core/_internal.py,
* core/arrayprint.py,
* core/fromnumeric.py,
* numpy/__init__.py,
* lib/npyio.py,
* lib/function_base.py,
* fft/fftpack.py,
* random/__init__.py
Closes #3172
|
|\ \ \
| | | |
| | | | |
BUG: Raise immediate error in ctypes.load_library when library is bad.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is a fixup of PR #475 due to JeromeRoy. The problem addressed is
that when multiple errors were encountered attempting to import a
library file, only the last one was preserved. The proposed fix is to
raise an error immediately when a file of the correct name fails to
import, and raise a later error if no file is found but no errors are
raised in the search.
Closes #474, #475.
|
|\ \ \ \
| |/ / /
|/| | | |
First attempt at BF for 2165 and added better tests for scalarmath pow function
|
| | | |
| | | |
| | | | |
Got rid of some white space in scalarmathmodule.c.src
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
somes fixes for the roll function
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This patch adds lines to release the Global Interpreter Lock
while calculating an FFT with fftpack.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
BUG: Do not reuse nditer buffers when not filled enough.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This slightly changes the test to cover more cases including
the one where buffers are sometimes used and sometimes not.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If the buffer is used or not can possible change during iteration.
In this case, the buffer cannot be reused if it never existed...
|
| | | | | | |
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This checks if the previous time around, the buffers were filled
with as much data as they would be filled this time around. Since
This is difficult for the initial loop before reusing is activated
because in that case the buffer may be larger then just the
first outer reduce dimension. In that case do not allow reuse
unless the index along that dimension was 0.
When the inner reduce index is not 0, then also the reusing of
the buffer is dangerous.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Make AdvancedNew iter more 0-d aware
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Also uses oa_ndim == -1 to signal no op_axes were given. This is slightly
cleaner inside pywrap itself and is a cleaner signal for the iterator.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
There are relatively few changes necessare here. However there is a
conceptionally there are no axes for the 0-d case, and no axesdata
needs to be used. This still uses the first axisdata. Which means that
in a few places ndim == 0 is special cased or special cased to act like
ndim == 1.
It would probably be a little cleaner to to use the base pointers directly
in the 0-d case and no axes iteration at all. That would require similar
special cases though.
This also makes oa_ndim == -1 the "correct" way to signal that no op_axes
are given with oa_ndim == 0 being, for the time being, dual use. Either
meaning that nothing may be given, or if something something was given
enforcing a 0-d iteration.
The necessary changes to the ufunc machinery are also done.
Documented that the dtype transfer functions do not handle the scalar
case unless even shape is set.
|
| |_|_|_|/
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The tests in test_exec_command.py used with blocks with a context
manager that could redirect stderr and stdout to temporary files but
those files were not closed on exit from the block.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
2to3: Replace xrange by range and use list(range(...)) where needed
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In python3 range is an iterator and `xrange` has been removed. This has
two consequence for code:
1) Where a list is needed `list(range(...))` must be used.
2) `xrange` must be replaced by `range`
Both of these changes also work in python2 and this patch makes both.
There are three places fixed that do not need it, but I left them in
so that the result would be `xrange` clean.
Closes #3092
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
fix undefined function and add integer divisions
|
| |/ / / / / |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
TST: test_umath: fix wrong indent in test_fast_power
|
| | |/ / /
| |/| | |
| | | | |
| | | | | |
Also, use assert_ instead of assert
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This should fix gh-3165.
Conflicts:
numpy/distutils/tests/test_exec_command.py
|
| | | | |
| | | | |
| | | | |
| | | | | |
Add a comment explaining the issue.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Now things behave the same if executed with either of:
nosetests
nosetests -s
|
| | | | |
| | | | |
| | | | |
| | | | | |
And enable a test for this that was failing before.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
First, we test both stdout and stderr.
Second, we now test both _exec_command_posix() and _exec_command(), see
numpy/distutils/exec_command.py. This reveals a bug in the implementation which
will be fixed in the next commit. For now the failing test is commented out so
that all tests still pass.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The new _supports_fileno() function works in all versions of Python.
The problem was that in Python 2.x, the fileno() method of StringIO() is
missing, while in Python 3.x, it is present, but raises an exception.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Closes gh-2999 and gh-2915.
There are several packages (nose, scipy.weave.inline, Sage inline Fortran) that
replace stdout, in which case it doesn't have a fileno method. This method was
attempted to be used (change in gh-2766 to fix a py3k issue).
|
| | | | |
|