| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This code was only here for Python 2.5 compatibility, but numpy requires 2.7
at minimum
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
gh-8410 breaks a large number of astropy tests, because it sets up
a boolean array for values that should actually be compared (i.e.,
are not `nan` or `inf`) using `zeros_like`. The latter means that
for subclasses, the boolean test array is not a plain `ndarray` but
the subclass. But for astropy's `Quantity`, the `all` method is
undefined.
This commit ensures the test arrays from `isinf` and `isnan` are
used directly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See issue #2418
assert_array_less does now treat inf/nan
correctly, namely:
-inf < x < inf for any real number x
nans still are not compared, when they occur
at the same position
To achieve this without breaking any other
functions relying on assert_array_compare,
an additional parameter (equal_inf) was
introduced that defaults to the old behavior
(analogous to equal_nan).
|
|
|
|
|
| |
This failed to raise AssertionError in an earlier rewrite of
assert_array_compare and is thus tested explicitly now.
|
|
|
|
|
|
|
|
|
| |
Added tests for simple arrays/elements,
tests that ensure that nans are not compared when they are in the same
position in both arrays but raise AssertionError when they are not,
and tests that ensure inf logic
(-np.inf < np.inf, 1.0 < np.inf, -np.inf < 1.0)
and that all other cases fail.
|
|
|
|
|
|
|
| |
In Python 3.6 a number of escape sequences that were previously accepted
-- for instance "\(" that was translated to "\\(" -- are deprecated. To
retain the previous behavior either raw strings must be used or the
backslash must be properly escaped itself.
|
|
|
|
|
| |
Python 3.6 gets more strict about escape sequences, \. is invalid.
As it could get a syntax error the version check would not work.
|
|
|
|
|
| |
The Python 3.6 changes that resulted in the 6b49167c fix has been
fixed in Python 3.6.0rc1. So revert our fixes.
|
|
|
|
|
|
| |
When python is invoked with switch -3, it emits waring "classic int division"
for strict integer divisions. The same behavior is now implemented to numpy
with this fix
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python 3.6 has two methods for showing warnings, so we have to support
both ways (strictly speaking, on python 3.6 itself only the new would
probably be needed).
Also adds the _filters_mutated() call to replace manual registry
clearing. This is basically the fix that newer python versions have
to avoid the issue making the manual clearing unnecessary.
Closes gh-8176
|
|
|
|
|
|
|
|
|
| |
As discussed in my comments for issue #8145, this patch adds the
equal_nan argument to assert_array_compare(), and assert_allclose()
passes the value it receives for the same argument through to
assert_array_compare().
Closes #8142.
|
| |
|
|
|
|
|
| |
Formerly, I got DeprecationWarnings about callable being None when I tested
on Python 3.
|
| |
|
|\
| |
| | |
Suppressed warnings
|
| |
| |
| |
| |
| |
| | |
Making the outer context manager a suppress warnings gives good
control to print warnings only once in release mode and suppress
some specific warnings which cannot be easily avoided otherwise.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Printing of datetime arrays used to cause warning due to
comparison warnings in NaT. This is circumvented by using views
to integer values. Part of this should be simplified when
the deprecation is over.
Also fixes a bug with non-native byteorder.
|
| |
| |
| |
| |
| |
| |
| | |
This means that warnings of different origin then the one tested for
behave normally. If the normal behaviour is to igonre them this might
decrease specificity in rare cases. In most cases the specificity
will be slightly higher.
|
| |
| |
| |
| |
| | |
Also modify the corresponding test to suppress the non Deprecation
warnings created to test specificity.
|
|/
|
|
|
|
|
|
| |
Due to the lambdas used it didn't actually generate inplace cases.
Fix a few tests that now break due to assuming that the cases are always
out of place.
Also update some numbers to make it more likely to find issues like
loading from wrong array.
|
| |
|
|
|
|
|
|
| |
This context has a couple of advantages over the typical one, and can
ensure that warnings are cleanly filtered without side effect for
later tests.
|
| |
|
|\
| |
| | |
f2py.compile issues (#7683)
|
| |
| |
| |
| | |
f2py.compile (issue #7683)
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the check for scalars in assert_almost_equal so that
abs(actual - desired) < 1.5 * 10**(-decimal)
Note that the previous documentation claimed that the functions were
equivalent to
abs(actual - desired) < .5 * 10**(-decimal)
but that was not how they behaved in practice.
Due to the change in implementation, some very delicate tests may fail
that did not fail before. No extra failures were noted in scipy.
Closes #5200.
|
|
|
|
| |
The global also was ugly and not useful.
|
| |
|
|
|
|
|
| |
This was only needed for Python 2.6 as it is available from unittest in
later Python versions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
assert_equal(np.array([0, 1]), np.matrix([0, 1]))
used to print
x: array([0, 1])
y: [repr failed]
now prints
x: array([0, 1])
y: [repr failed for <matrix>: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()]
|
|\
| |
| | |
Revert "Merge pull request #7001 from shoyer/NaT-comparison"
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 7141f40b58ed1e7071cde78ab7bc8ab37e9c5983,
reversing changes made to 8fa6e3bef26a6d4a2c92f2824129aa4409be2590.
The original broke some pandas tests. The current plan to get this
in is
* reversion
* issue FutureWarning in 1.11 and 1.12
* make the change in 1.13.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
| |
Now, NaT compares like NaN:
- NaT != NaT -> True
- NaT == NaT (and all other comparisons) -> False
We discussed this on the mailing list back in October:
https://mail.scipy.org/pipermail/numpy-discussion/2015-October/073968.html
|
| |
|
| |
|
| |
|
|
|
|
| |
Addresses comment in gh-4074.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our test-runner's raise_warning mode traditionally has varied depending
on whether we have a development or release version of numpy: for
development versions we raise on warnings, and for release versions we
don't. This is all very sensible... *if* you're running numpy's test
suite. But our test-runner is also used by other packages like scipy,
and it doesn't make sense for scipy's raise_warning mode to vary
depending on whether *numpy* is a development or release version. (It
should vary depending on whether the scipy-under-test is a development
or release version.) So this commit moves the numpy-version-dependent
raise_warning logic out of the generic NoseTester class and into
numpy-specific code.
(See scipy/scipy#5609 for more discussion.)
|
|\
| |
| | |
ENH: Tempfile context manager
|
| |
| |
| |
| |
| | |
The test is in numpy/lib/tests/test_io.py. This commit is intended
as a demonstration of using temppath.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Context manager intended for use when the same temporary file needs to
be opened and closed more than once. The context manager creates the
file, closes it, and returns the path to the file. On exit from the
context block the file is removed. The file should be closed before
exiting the context as an error will be raised on windows if not.
Also fix up the `tempdir` context manager to deal with exceptions.
Tests are added for both `temppath` and `tempdir`.
|
| | |
|
|/
|
|
| |
Closes gh-6863.
|
|
|
|
|
|
|
|
| |
* use SkipTest in numpy tests instead of importing it from nose
* add a KnownFailureException as an alias for KnownFailureTest
(the former is preferred, but the latter is kept for backcompat)
* rename the KnownFailure nose plugin into KnownFailurePlugin,
and keep the old name for backcompat
|