| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
This allows pytest to run with duplicate test file names. Note that
`python <path-to-test-file>` no longer works with this change, nor will
a simple `pytest numpy`, because numpy is imported from the numpy
repository. However, `python runtests.py` and `>>> numpy.test()` are
still available.
|
|
|
|
|
|
| |
I don't know what that argument was used for, but it showis up in old
tests and is not explicitly used within the tests. I assume it was part
of an old testing framework and is now longer needed.
|
|
|
|
|
|
|
| |
This is the case for x in {int, bool, str, float, complex, object}.
Using the np.{x} version is deceptive as it suggests that there is a
difference. This change doesn't affect any external behaviour. The
`long` type is missing in python 3, so np.long is still useful
|
| |
|
|\
| |
| | |
MAINT: Use new-style classes on 2.7
|
| |
| |
| |
| | |
Deliberately avoids tests, to prevent introducing a failure on old-style classes later.
|
|/ |
|
|\
| |
| | |
ENH: Rearrange testing module to isolate nose dependency.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The aim here is to separate out the nose dependent files prior to adding
pytest support. This could be done by adding new files to the general
numpy/testing directory, but I felt that it was to have the relevant
files separated out as it makes it easier to completely remove nose
dependencies when needed.
Many places were accessing submodules in numpy/testing directly, and in
some cases incorrectly. That presented a backwards compatibility
problem. The solution adapted here is to have "dummy" files whose
contents will depend on whether of not pytest is active. That way the
module looks the same as before from the outside.
In the case of numpy itself, direct accesses have been fixed. Having
proper `__all__` lists in the submodules helped in that.
|
|/ |
|
|\
| |
| | |
BUG: np.ma.astype fails on structured types
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These now:
* Return void scalars instead of tuples for structured dtypes
* Actually accept non-trivial dtype arguments
* Work for nested structured and subarray dtypes
* Uniformly convert scalar types into dtypes
Also fixes #9315
|
| | |
|
| |
| |
| |
| | |
Tests for gh-8069
|
| | |
|
| |
| |
| |
| | |
Fill values were not correctly calculated for subdtypes, instead returning `None`
|
|/ |
|
|\
| |
| | |
BUG, DEP: Fix masked arrays to properly edit views. ( #5558 )
|
| | |
|
| | |
|
| |
| |
| |
| | |
Bare except is very rarely the right thing
|
| |
| |
| |
| |
| |
| |
| |
| | |
isinstance(obj, ndarray) will return False if (obj is None) in any case,
so no need to check whether (obj is not None) before it. All tests
pass on my build (the most recent one at the time making this PR).
However, this might have been done for backward compatibility. Will see
how the CI tests do.
|
| | |
|
|\ \
| | |
| | | |
ENH: Add isnat function and make comparison tests NAT specific
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This may show warnings in downstream projects, which should likely
not be there. We could also drop in the normal assert_equal there,
which would support NaT, and NaN, but checks for scalarness, which
this currently does not (which also could create problems).
Works around the only test with this problem, by using the normal
assert_equal there.
|
| | |
| | |
| | |
| | | |
Also, remove unecessary subclasses
|
| | |
| | |
| | |
| | | |
Introduced by me in #8918
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This does not match np.maximum, which is confusing because the masked
version has no documentation at all. This uses a similar deprecation approach
to gh-8918, noting that the warning is only needed for arrays of more than one
dimension.
The same remarks apply to `np.ma.minimum`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This shorthand is just inconsistent with `np.maximum`, and just makes the
distinction between `np.ma.max` and `np.ma.maximum` even more confusing.
Also adds names to these objects, since 1) they're there in core, and 2) they
make the warning message more helpful.
|
|/ /
| |
| |
| |
| |
| | |
This was untested, and the documentation did not mention how it differed from `min` anyway.
Fixes #8764
|
|\ \
| | |
| | | |
DEP: deprecate calling ma.argsort without an axis
|
| | |
| | |
| | |
| | |
| | |
| | | |
Only deprecated when this would be ambiguous.
Approaches #8701
|
| | | |
|
|/ /
| |
| |
| |
| | |
Also adds a test for the disabled-by-design behaviour - this would return
raw matrices, not masked arrays
|
| |
| |
| |
| |
| |
| | |
This fixes gh-8331
Also update the docs for arraysetops to remove the outdated "1D" from the
description, which was already incorrect for np.unique.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In previous versions, one could force ndarray binops to defer by
setting a high __array_priority__. With __array_ufunc__ this gets
ignored, and this commit ensures it is still possible to avoid
using the standard python language feature that setting something
to None means it is not implemented. In consequence, inside a
ufunc, if __array_ufunc__ is None, it will be treated as if it
had returned NotImplemented (leading to a TypeError if no other
object had a functioning __array_ufunc__ override).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As per the discussion at gh-5844, and in particular
https://github.com/numpy/numpy/issues/5844#issuecomment-112014014
this commit switches binop dispatch to mostly defer to ufuncs, except
in some specific cases elaborated in a long comment in number.c.
The basic strategy is to define a single piece of C code that knows
how to handle forward binop overrides, and we put it into
private/binop_override.h so that it can be accessed by both the array
code in multiarray.so and the scalar code in umath.so.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The first commit in changing __numpy_ufunc__ by removing the index
argument and making the out argument value always a tuple. These changes
were proposed in gh-5986 and have been accepted. Renaming before further
changes avoids triggering tests in scipy and astropy while keeping the
numpy tests working.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
The correct behavior here is to return a new MaskedArray, because `MaskedConstant` is pretending to be a scalar
|
| |
| |
| |
| | |
This fixes #8684
|
| | |
|
|\ \
| | |
| | | |
Fix various bugs in np.ma.where
|
| | |
| | |
| | |
| | |
| | | |
Fixes #8600 and #8599
Also makes np.ma.masked work with structured dtypes.
|
| | | |
|
| | |
| | |
| | |
| | | |
This fixes an omission where duplicate axes would only be detected when positive
|