| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
Fix resource warnings
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
This one in numpy/distutils/system_info.py. Just keep an explicit
reference to a file, then close it.
|
|\ \
| |/
|/| |
BUG: fix random.choice scalar object result and disallow 0-d arrays
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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...
|
| | |
|
|\ \
| | |
| | | |
generalized ufunc signature problem fix
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
BUG: Choose a more unique PY_ARRAY_UNIQUE_SYMBOL in f2py.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
2to3: Put `from __future__ import division` in every python file.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The copyright and short summary were moved to the top of the
docstring with the usage description below.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In this case, the initialization used the number of dimensions instead
of setting it to NULL for each operand, leading to possible segmentation
faults.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
2to3: Apply `methodattrs` fixes.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Replaces old style `f.im_func` and `f.im_class` method attributes
with `f.__func__` and `f.__class__`. Closes #3070.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
2to3: Apply `filter` fixes. Closes #3053.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Also break regular expression compiles out of the loop.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Generally, this involves using list comprehension, or explicit list
construction as `filter` is an iterator in Python 3.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Replaces the
raise Exception, msg:
form with
raise Exception(msg):
|
|\ \ \ \ \
| | | | | |
| | | | | | |
2to3: Apply `sys_exc` fixes. Closes #3086.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | | |
This uses sys.exc_info in place of sys.exc_value. The new function
goes back to at least 2002, so should be safe.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
DOC -- add another paragraph note to ndarray.view docs
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
More detail: Views are only sensitive to under-the-hood storage when
the dtype storage size has changed.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
BUG: gh-2687 make multiarray dot method accept out array and keyword args
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Use PyUnicode_FromString instead.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
and make added comments in test_multiarray.py helpful.
|
| | |_|_|_|/
| |/| | | |
| | | | | |
| | | | | | |
args.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
2to3: Fix callable.
|
| | |_|/ / /
| |/| | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
2to3: Apply `funcattrs` fixer. Closes #3058.
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This replaces the `b.func_xxxx` with newer `__xxxx__` attribute names
For example, `f.__name__` replaces `f.func_name`
|