| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
BUG: Disable 32-bit msvc9 compiler optimizations for npy_rint
|
| | |
|
|\ \
| | |
| | | |
Updated typos in histogram bin estimator equations
|
| |/
| |
| | |
In all cases, it's either ...*n^(-1/3) or .../n^(1/3), not both. The actual functions are implemented correctly.
|
|\ \
| | |
| | | |
BUG: Fix thinko in assert_deprecated()
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
assert_deprecated() was recently reworked for stylistic changes (in
0aa32608 "STY: Minor style cleanups in tests and C code.") but made a
thinko - `lst` is already a list of warnings, so we don't need to put
that into [] braces when preparing assertion text. If we do the
reporting breaks:
In [1]: msg = "4 warnings found but 3 expected."
In [2]: lst = ['CategoryA', 'CategoryB', 'CategoryC']
In [3]: n.join([msg] + [lst])
TypeError Traceback (most recent call last)
----> 1 n.join([msg] + [lst])
TypeError: sequence item 1: expected string, list found
Fix it.
Cc: Charles Harris <charlesr.harris@gmail.com>
|
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| | |
The test currently uses an `<i8` type which is converted to a Python
long integer when running on a 32 bit system with Python 2. That changes
the string printed by appending `L` to the printed integer value and
results in a failed test.
|
|\ \
| |/
|/| |
MAINT: Replace assert with assert_(...) in some tests.
|
| | |
|
|/
|
|
|
| |
Discovered while cleaning up uses of the silly aliases like
'np.object'.
|
|\
| |
| | |
MAINT: Include from __future__ boilerplate in some files missing it.
|
| |
| |
| |
| |
| | |
Some newer *.py files are missing the `from __future__` boilerplate
that helps assure Python2 and Python3 compatibility.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The original had incorrect comparisons involving <=, <, and also failed
when the number of data points was 2. This fixes the use of the
comparisons and uses linear search for fewer than 5 data points.
The whole routine needs a simplified rewrite, but this takes care of the
bug.
Closes #6468.
|
|\ \
| | |
| | | |
BUG: metadata is not copied to base_dtype
|
| |/
| |
| |
| |
| |
| |
| |
| | |
The (somewhat obsolete) metadata attribute of the data_dtype should be
carried over in dtype specifications of the form
(base_dtype, data_dtype). Fixes #6771
Incidentally fixes a reference leak in `dtype(('i4,i4', 'i4,i4'))`
|
|\ \
| |/
|/| |
DEP: Deprecate changing shape of non-C-contiguous array via descr.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This deprecates assignment of a new descriptor to the dtype attribute of
a non-C-contiguous array if it result in changing the shape. This
effectively bars viewing a multidimensional Fortran array using a dtype
that changes the element size along the first axis.
The reason for the deprecation is that, when relaxed strides checking is
enabled, arrays that are both C and Fortran contiguous are always
treated as C contiguous which breaks some code that depended the two
being mutually exclusive for arrays of dimension > 1. The intent of this
deprecation is to prepare the way to always enable relaxed stride
checking.
Example
-------
```
In [1]: import warnings
In [2]: warnings.simplefilter('always')
In [3]: a = ones((2, 1), order='F').view(complex)
/home/charris/.local/bin/ipython:1: DeprecationWarning: Changing the shape
of non-C contiguous array by descriptor assignment is deprecated. To
maintain the Fortran contiguity of a multidimensional Fortran array, use
'a.T.view(...).T' instead
```
|
|\ \
| | |
| | | |
TST: only test f2py, not f2py2.7 etc, fixes #6718
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
gerritholl/structured_multidim_masked_array_mvoid_alt
BUG/TST: Fix for #6724, make numpy.ma.mvoid consistent with numpy.void
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Make indexing on numpy.ma.mvoid consistent with indexing on numpy.void.
Changes behaviour in rare cases (see below). Fixes #6724. Sometimes,
indexing ma.mvoid results in a non-scalar mask. For example, dimension
increases if indexing with a multi-dimensional field. Previously, this
led to a ValueError (truth value ambiguous). With this commit, indexing
now returns an ma.masked_array so that there is no loss of information.
Note that there is a precedence for returning from void to array. Z =
zeros((2,), dtype="(2,)i2,(2,)i2"), then Z[0] is a void, but Z[0][0]
and Z[0]["f1"] are array. This commit therefore implements behaviouk
such that numpy.ma.mvoid is consistent with numpy.void.
Also adds a related test.
The behaviour changes in cases where for a masked array `X`, X.dtype["A"]
is multidimensional but size 1, such as in the example below. Any case
where X.dtype["A"] is multidimensional but with size>1 would previously
fail.
Old behaviour:
In [15]: X = ma.masked_array(data=[([0],)], mask=[([False],)],
dtype=[("A", "(1,1)i2", (1,1))])
In [16]: X[0]["A"]
Out[16]: array([[[[0]]]], dtype=int16)
In [17]: X = ma.masked_array(data=[([0],)], mask=[([True],)],
dtype=[("A", "(1,1)i2", (1,1))])
In [18]: X[0]["A"]
Out[18]: masked
New behaviour:
In [1]: X = ma.masked_array(data=[([0],)], mask=[([False],)],
dtype=[("A", "(1,1)i2", (1,1))])
In [2]: X[0]["A"]
Out[2]:
masked_array(data =
[[[[0]]]],
mask =
[[[[False]]]],
fill_value = [[[[16959]]]])
In [3]: X = ma.masked_array(data=[([0],)], mask=[([True],)],
dtype=[("A", "(1,1)i2", (1,1))])
In [4]: X[0]["A"]
Out[4]:
masked_array(data =
[[[[--]]]],
mask =
[[[[ True]]]],
fill_value = [[[[16959]]]])
The new behaviour is more consistent with indexing the data themselves:
In [7]: X.data[0]["A"]
Out[7]: array([[[[0]]]], dtype=int16)
In theory, this change in behaviour can break code, but I would consider
it very unlikely.
|
|\ \ \
| | | |
| | | | |
BUG: link cblas library if cblas is detected
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
BUG/TST: Fix #6760 by correctly describing mask on nested subdtypes
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
Fix #6760. In ma.core._recursive_make_descr, consider the case where a
subdtype does itself have named fields. This ensures the correct mask for
an array like `ma.zeros(2, dtype([("A", "(2,2)i1,(2,2)i1", (2,2))]))`.
|
|/ /
| |
| |
| |
| |
| |
| | |
This is because the dtype was passed into the new array as a
char, and many dtypes do not have a valid char representation.
Closes gh-6740
|
|\ \
| | |
| | | |
ENH: Avoid memory peak when creating a MaskedArray with mask=True/False.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
When the `mask` parameter is set to True or False, create directly a `ndarray` of
boolean instead of going inside `np.resize` which was causing of memory peak of
~15 times the size of the mask.
|
|\ \ \
| | | |
| | | | |
ENH: Avoid memory peak and useless computations when printing a MaskedArray.
|
| | | | |
|
| | | | |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ref #3544.
When printing a `MaskedArray`, the whole array is converted to the object dtype,
whereas only a few values are printed to screen. So the approach here is to cut
the array and keep only a subset that it used for the string conversion. This
way the output should not change.
|
| |/
|/|
| |
| |
| |
| | |
Fix representation of a structured masked array with dimension zero.
The effect of representing a masked array with dimension zero is now
similar to respresenting an mvoid. This commit fixes #6729.
|
|\ \
| |/
|/|
| |
| | |
charris/fix-bugs-exposed-by-relaxed-stride-rollback
Fix bugs exposed by relaxed stride rollback
|
| |
| |
| |
| |
| |
| | |
The varibles in question lead to unused variable warnings when not
compiling with NPY_RELAXED_STRIDE_CHECKING=1 resulting in failing
travis tests.
|
|\ \
| | |
| | | |
added extra line in the tile help doc to outline a general repeat, co…
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
BUG: Readd fallback CBLAS detection on linux.
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fallback CBLAS detection was removed in gh-6183 because it led to
problems on windows when mingw was used with python compiled with msvc
but msvc was not installed. As a result of that fix, CBLAS detection
failed for some Linux installations. The solution here is to add back
the fallback detection but make it specific to non-windows platforms.
Closes #6675.
|
|/ /
| |
| |
| |
| |
| | |
numpy/random/mtrand/mtrand.pyx contains a line where cython fails to
compile, complaining “Pythonic division not allowed without gil”. By
running this code segment under cdivision(True), this problem is avoided.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Should have used PyArray_BYTES, not PyArray_DATA
Fixes #6701
|
|\ \
| | |
| | | |
Changed lines for successfull MSVC 14.0 compiling
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reallocated free functions in mem_overlap.c
Cosmetics.
Final indent.
Added tests if pointer==NULL
Fixed indent
Fixed position of goto label.
Fixed ISO C90 violation.
Made simpler checks and removed redundant lines.
|
|\ \ \
| | | |
| | | | |
TST: test np.rint bug for large integers
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Test for https://github.com/numpy/numpy/issues/6685
Add test to remind packagers that they may need to fix or workaround
this bug on some systems.
|