summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #460 from endolith/regex_formattingCharles Harris2013-04-0331-93/+89
|\ | | | | DOC: Formatting fixes using regex
| * DOC: regex-assisted fixes of definition list formattingendolith2013-03-198-10/+12
| |
| * DOC: Used regex to find colons missing spaces which render wrong online, ↵endolith2013-03-1924-83/+77
| | | | | | | | also other spacing or formatting mistakes
* | Merge pull request #3162 from seberg/unsafe-stridesnjsmith2013-04-0311-27/+176
|\ \ | | | | | | Revert changes to contiguous flags definition while creating NPY_TEST_UNSAFE_STRIDES
| * | API: Implement new flags API with NPY_RELAXED_STRIDES_CHECKINGSebastian Berg2013-04-018-27/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | ENH: Relax aligned flag for shape[i] <= 1Sebastian Berg2013-04-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | BLD: Add NPY_RELAXED_STRIDES_CHECKING flagSebastian Berg2013-04-012-0/+16
| |/ | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #3178 from charris/2to3-apply-import-fixernjsmith2013-04-02341-624/+621
|\ \ | | | | | | 2to3 apply import fixer
| * | 2to3: Add `from __future__ import ...` to some files that were missed.Charles Harris2013-03-281-0/+2
| | | | | | | | | | | | | | | | | | | | | 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.
| * | 2to3: Use absolute imports.Charles Harris2013-03-28340-624/+619
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge pull request #3185 from charris/fix-pull-475njsmith2013-04-021-8/+9
|\ \ \ | | | | | | | | BUG: Raise immediate error in ctypes.load_library when library is bad.
| * | | BUG: Raise immediate error in ctypes.load_library when library is bad.Charles Harris2013-04-011-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #349 from ericfode/float16powCharles Harris2013-04-012-7/+28
|\ \ \ \ | |/ / / |/| | | First attempt at BF for 2165 and added better tests for scalarmath pow function
| * | | Update scalarmathmodule.c.srcEric Fode2013-04-011-1/+1
| | | | | | | | | | | | Got rid of some white space in scalarmathmodule.c.src
| * | | fixed some style problemsEric Fode2012-07-132-14/+17
| | | |
| * | | First attempt at BF for 2028 and added better tests for scalarmath pow functionEric Fode2012-07-122-8/+26
| | | |
* | | | Merge pull request #273 from dlax/fix/rollCharles Harris2013-04-012-5/+31
|\ \ \ \ | | | | | | | | | | somes fixes for the roll function
| * | | | STY: drop some else clauses in rollDenis Laxalde2012-10-131-8/+6
| | | | |
| * | | | FIX: handle empty arrays in rollDenis Laxalde2012-05-081-6/+9
| | | | |
| * | | | FIX: roll raises a ValueError is axis > ndimDenis Laxalde2012-05-081-1/+4
| | | | |
| * | | | TST: add tests for roll functionDenis Laxalde2012-05-081-0/+22
| | | | |
* | | | | Allow threads for FFT calculationsMartin Teichmann2013-04-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds lines to release the Global Interpreter Lock while calculating an FFT with fftpack.
* | | | | Merge pull request #3153 from seberg/issue-3142Charles Harris2013-04-012-4/+87
|\ \ \ \ \ | | | | | | | | | | | | BUG: Do not reuse nditer buffers when not filled enough.
| * | | | | TST: test no reuse of non-existing buffers in nditerSebastian Berg2013-03-181-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This slightly changes the test to cover more cases including the one where buffers are sometimes used and sometimes not.
| * | | | | BUG: no buffer reuse in nditer, if there was no buffer previouslySebastian Berg2013-03-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the buffer is used or not can possible change during iteration. In this case, the buffer cannot be reused if it never existed...
| * | | | | TST: Add (slow) nditer reduce buffer reuse testSebastian Berg2013-03-181-0/+50
| | | | | |
| * | | | | BUG: Do not reuse nditer buffers when not filled enough.Sebastian Berg2013-03-181-4/+26
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #3104 from seberg/nditer-allow-0dCharles Harris2013-04-0110-134/+173
|\ \ \ \ \ | | | | | | | | | | | | Make AdvancedNew iter more 0-d aware
| * | | | | MAINT: Remove 0-d iterator special case from ufunc_object.cSebastian Berg2013-03-031-12/+0
| | | | | |
| * | | | | MAINT: Remove np.ndindex 0-d hack.Sebastian Berg2013-03-031-24/+1
| | | | | |
| * | | | | TST: Add test that einsum multiplies scalars fineSebastian Berg2013-03-031-0/+1
| | | | | |
| * | | | | TST: Add basic tests for 0-d np.nditer/np.nested_iter supportSebastian Berg2013-03-031-0/+54
| | | | | |
| * | | | | ENH: Allow np.nditer to support scalar op_axesSebastian Berg2013-03-031-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | API: Make nditer support ndim == 0 for 0-d iterations.Sebastian Berg2013-03-036-83/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | MAINT: Fix python3 ResourceWarning when running test_exec_command.pyCharles Harris2013-03-281-0/+4
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #3122 from charris/2to3-apply-xrange-fixerCharles Harris2013-03-2849-134/+134
|\ \ \ \ \ | | | | | | | | | | | | 2to3: Replace xrange by range and use list(range(...)) where needed
| * | | | | 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-2749-134/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Merge pull request #3168 from juliantaylor/numarray-fixesnjsmith2013-03-281-5/+18
|\ \ \ \ \ \ | | | | | | | | | | | | | | fix undefined function and add integer divisions
| * | | | | | fix undefined function and add integer divisionsJulian Taylor2013-03-261-5/+18
| |/ / / / /
* | | | | | Merge pull request #3141 from ewmoore/test_fast_powerCharles Harris2013-03-271-3/+3
|\ \ \ \ \ \ | |/ / / / / |/| | | | | TST: test_umath: fix wrong indent in test_fast_power
| * | | | | TST: test_umath: fix wrong indent in test_fast_powerEric Moore2013-03-121-3/+3
| | |/ / / | |/| | | | | | | | | | | | | Also, use assert_ instead of assert
* | | | | TST: open the TemporaryFile in ASCII modeOndrej Certik2013-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should fix gh-3165. Conflicts: numpy/distutils/tests/test_exec_command.py
* | | | | TST: skip general test on non-posix platformsOndrej Certik2013-03-101-10/+15
| | | | | | | | | | | | | | | | | | | | Add a comment explaining the issue.
* | | | | TST: Redirect the other stream to temp. fileOndrej Certik2013-03-101-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now things behave the same if executed with either of: nosetests nosetests -s
* | | | | Implement separate checking for stdout and stderrOndrej Certik2013-03-092-15/+14
| | | | | | | | | | | | | | | | | | | | And enable a test for this that was failing before.
* | | | | TST: add robust tests for exec_command()Ondrej Certik2013-03-091-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | PEP8: don't use \Ondrej Certik2013-03-071-2/+2
| | | | |
* | | | | FIX: add _supports_fileno() for testing fileno()Ondrej Certik2013-03-071-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | BUG: fix issue with distutils.exec_command introduced in 1.7.0.Ralf Gommers2013-03-062-16/+55
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | | DOC: Fix typo in fft docs (the indexing variable is 'm', not 'n').Maximilian Albert2013-03-061-1/+1
| | | |