summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* DOC: Fix typo in fft docs (the indexing variable is 'm', not 'n').Maximilian Albert2013-03-061-1/+1
|
* 2to3: Remove xreadlines and replace f.readlines() by f where valid.Charles Harris2013-03-0510-16/+13
| | | | | | | | | | An open file `f` has been an iterator since python2.3 and `f.xreadlines()` is no longer needed, so replace it with `f`. Also replace `f.readlines()` with `f` where an iterator will do. The replacement of `f.readlines()` is not critical because it is a list in both python2 and python3, but the code is a bit cleaner. Closes #3093
* 2to3:DEP: Remove interactive setup and gnu compiler configuration.Charles Harris2013-03-053-208/+2
| | | | | | | | | | | | | | | | | | | | | | These havn't been deprecated, but I think few have heard of them, much less used them. Before this change, running setup.py without any arguments would result in interactive help. This patch removes that interactive help and lets setup print its usual list of commands and options. All the script uses of the numpy/distutils/fcompiler compilers look quite broken to me, but I have tried to maintain compatibility with the earlier version of gnu.py after the removal of `raw_input`. These removals solve an incompatibility between Python3 and Python2. The current interactive setup help uses `raw_input`, which has been removed in python3 and replaced by `input`. However, python2 already has an `input` that has different semantics. Rather than deal with this, I think it simpler to keep both `raw_input` and `input` out of numpy. Closes #3063 Closes #3079
* Merge pull request #3114 from charris/fix-resource-warningsnjsmith2013-03-042-7/+21
|\ | | | | Fix resource warnings
| * TST: Get rid of a ResourceWarning.Charles Harris2013-03-031-6/+15
| | | | | | | | | | | | | | | | I'm not sure this is the right fix, but test_closing_fid need to check that garbage collection will close a file that goes through a bunch of openings followed by dropping the reference. So the fix is to ignore warnings during the test. I'd just ignore ResourceWarning, but it does not look to be a built in warning in Python 2.7.
| * MAINT: Get rid of a ResourceWarning.Charles Harris2013-03-031-1/+6
| | | | | | | | | | This one in numpy/distutils/system_info.py. Just keep an explicit reference to a file, then close it.
* | Merge pull request #2992 from seberg/choice-object-scalarseberg2013-03-043-4241/+4450
|\ \ | |/ |/| BUG: fix random.choice scalar object result and disallow 0-d arrays
| * MAINT: regenerate mtrand.cSebastian Berg2013-03-041-4223/+4405
| |
| * BUG: fix random.choice scalar object result and disallow 0-d arraysSebastian Berg2013-03-042-18/+45
| | | | | | | | | | | | | | | | | | | | | | Object arrays failed due to bad check for finding out if the result should be a scalar type and not an array when size=None. Also in this case the creation of the new array was wrong. This should be fixed with this. The second fix is to forbid 0-d arrays. Allowing 0-d arrays does not make much sense. But it is dangerous because for example floats will be interpreted as 1-d arrays, while one may expect that they are interpreted as integers. This also saves the trouble of reliably detecting all integers...
* | BUG: fix NPY_NO_DEPRECATED_API mechanism.Ralf Gommers2013-03-023-2/+6
| |
* | Merge pull request #2953 from ContinuumIO/gufunc-fixCharles Harris2013-03-012-50/+199
|\ \ | | | | | | generalized ufunc signature problem fix
| * | compile fix on linux/macovillellas2013-01-211-2/+8
| | |
| * | BUG: Fix for generalized ufunc zero-sized input caseMark Wiebe2013-01-171-2/+33
| | |
| * | TST: Test for a generalized ufunc bug, for zero-sized inputsMark Wiebe2013-01-171-0/+7
| | |
| * | BUG: Fix bug in gufunc scalar caseMark Wiebe2013-01-171-2/+13
| | |
| * | TST: Add test for gufunc scalar caseMark Wiebe2013-01-171-0/+2
| | |
| * | BUG: Make sure the nditer doesn't complain when 0 broadcast dimsMark Wiebe2013-01-171-1/+3
| | |
| * | BUG: Missed case of broadcasting onto core dimensions in gufuncMark Wiebe2013-01-171-16/+32
| | |
| * | BUG: Fix generalized ufunc so repeating labels in one input/output is okMark Wiebe2013-01-171-46/+120
| | |
* | | Merge pull request #3014 from bfroehle/f2py_unque_symbolCharles Harris2013-03-011-1/+1
|\ \ \ | | | | | | | | BUG: Choose a more unique PY_ARRAY_UNIQUE_SYMBOL in f2py.
| * | | BUG: Choose a more unique PY_ARRAY_UNIQUE_SYMBOL in f2py.Bradley M. Froehle2013-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a few exceptional cases where symbols are shared between different Python modules the use of `PyArray_API` in f2py (fortranobject.h) conflicts with the regular use of the same symbol in the multiarray module. Generally the symptom of this conflicting use is a segfault when importing a f2py'ed module. This occurs because the module init code somehow overwrites the first element of `PyArray_API` with the location of `PyArray_API`, causing a crash when `PyArray_GetNDArrayCVersion` is called. Closes gh-2521.
* | | | Merge pull request #3026 from charris/2to3-fix-printCharles Harris2013-03-01349-223/+888
|\ \ \ \ | | | | | | | | | | 2to3: Put `from __future__ import division` in every python file.
| * | | | MAINT: Make numpy/f2py/crackfortran docstring read better.Charles Harris2013-03-011-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | The copyright and short summary were moved to the top of the docstring with the usage description below.
| * | | | 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-01349-222/+888
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* | | | | BUG: initialize op_axes when only itershape is givenSebastian Berg2013-03-012-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this case, the initialization used the number of dimensions instead of setting it to NULL for each operand, leading to possible segmentation faults.
* | | | | Merge pull request #3099 from charris/2to3-methodattrsnjsmith2013-03-014-10/+7
|\ \ \ \ \ | |/ / / / |/| | | | 2to3: Apply `methodattrs` fixes.
| * | | | 2to3: Apply `methodattrs` fixes.Charles Harris2013-03-014-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Replaces old style `f.im_func` and `f.im_class` method attributes with `f.__func__` and `f.__class__`. Closes #3070.
* | | | | Merge pull request #3056 from charris/2to3-filterCharles Harris2013-03-017-24/+30
|\ \ \ \ \ | |/ / / / |/| | | | 2to3: Apply `filter` fixes. Closes #3053.
| * | | | BUG: Fix `not a in ...` to `a not in ...`.Charles Harris2013-02-281-14/+15
| | | | | | | | | | | | | | | | | | | | Also break regular expression compiles out of the loop.
| * | | | REF: Replace filters with list comprehensions.Charles Harris2013-02-285-21/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2to3 does a lot of list(filter(...)) sort of thing which can be avoided by using list comprehensions instead of filters. This also seems to clarify the code to a considerable degree.
| * | | | 2to3: Apply `filter` fixes. Closes #3053.Charles Harris2013-02-287-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Generally, this involves using list comprehension, or explicit list construction as `filter` is an iterator in Python 3.
* | | | | 2to3: Apply `raise` fixes. Closes #3077.Charles Harris2013-03-019-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces the raise Exception, msg: form with raise Exception(msg):
* | | | | Merge pull request #3097 from charris/2to3-sys_excnjsmith2013-03-012-4/+4
|\ \ \ \ \ | | | | | | | | | | | | 2to3: Apply `sys_exc` fixes. Closes #3086.
| * | | | | 2to3: Apply `sys_exc` fixes. Closes #3086.Charles Harris2013-02-282-4/+4
| |/ / / / | | | | | | | | | | | | | | | | | | | | This uses sys.exc_info in place of sys.exc_value. The new function goes back to at least 2002, so should be safe.
* | | | | Merge pull request #2967 from sbyrnes321/masterCharles Harris2013-02-282-0/+34
|\ \ \ \ \ | | | | | | | | | | | | DOC -- add another paragraph note to ndarray.view docs
| * | | | | DOC: Add example showing how a view of a slice can misbehaveSteve2013-02-051-0/+16
| | | | | |
| * | | | | DOC -- add another paragraph note to ndarray.view docs (cont'd)Steve2013-02-052-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More detail: Views are only sensitive to under-the-hood storage when the dtype storage size has changed.
| * | | | | DOC -- add another paragraph note to ndarray.view docsSteve2013-02-042-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since most numpy operations are not sensitive to underlying data structure (C-ordered arrays vs fortran-ordered arrays, versus slices or transposes of arrays, etc.), but structured-array views ARE sensitive to that, it is worth saying it explicitly in the documentation.
* | | | | | Merge pull request #2988 from ewmoore/methdot2697Charles Harris2013-02-282-5/+21
|\ \ \ \ \ \ | | | | | | | | | | | | | | BUG: gh-2687 make multiarray dot method accept out array and keyword args
| * | | | | | BUG: use the PyUString_FromString macro for Py3 compat instead.Eric Moore2013-02-151-1/+1
| | | | | | |
| * | | | | | BUG: PyString_FromString isn't py3 compatible.Eric Moore2013-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use PyUnicode_FromString instead.
| * | | | | | FIX: use PyObject_CallMethodObjArgs in array_dotEric Moore2013-02-152-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and make added comments in test_multiarray.py helpful.
| * | | | | | BUG: gh-2687 make multiarray dot method accept out array and keywordEric Moore2013-02-142-5/+16
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | args.
* | | | | | Merge pull request #3047 from charris/2to3-callablenjsmith2013-02-285-8/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | 2to3: Fix callable.
| * | | | | | 2to3: Fix callable.Charles Harris2013-02-285-8/+13
| | |_|/ / / | |/| | | |
* | | | | | Merge pull request #3059 from charris/2to3-funcattrsnjsmith2013-02-286-12/+12
|\ \ \ \ \ \ | | | | | | | | | | | | | | 2to3: Apply `funcattrs` fixer. Closes #3058.
| * | | | | | 2to3: Apply `funcattrs` fixer. Closes #3058.Charles Harris2013-02-286-12/+12
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | This replaces the `b.func_xxxx` with newer `__xxxx__` attribute names For example, `f.__name__` replaces `f.func_name`