| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
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
|
| |
|
| |
|
| |
|
|\
| |
| | |
ENH: Hide testing helper tracebacks when using them with pytest
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
This approach is less error prone than switching from "develop" to "release"
in maintenance branches by hand. See gh-6461 for details.
|
| |
| |
| |
| |
| |
| |
| | |
In python3 np.test would raise an error if raise_warnings is a list
since dict.keys() now returns a dict_keys instance. Eg,
np.test('full', raise_warnings=[FutureWarning])
|
|\ \
| | |
| | | |
TST: Make default for all warnings "always"
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This should make it easier in some cases, since a warning
caught in some test (but not important/not causing failure),
will not shadow later tests.
In principle the best thing is probably to always check the number
of warnings raised, so that you notice when a new warning shows
up in a test, though there may be other corner cases here.
|
| | |
| | |
| | |
| | | |
function listed in __all__ for numpy/testing/utils.py.
|
| | | |
|
|/ / |
|
| |
| |
| |
| |
| |
| | |
Filed upstream as:
https://github.com/nose-devs/nose/issues/929
Not our problem.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ndarray richcompare function has special case code for handling
void dtypes (esp. structured dtypes), since there are no ufuncs for
this. Previously, we would attempt to call the relevant
ufunc (e.g. np.equal), and then when this failed (as signaled by the
ufunc returning NotImplemented), we would fall back on the special
case code. This commit moves the special case code to before the
regular code, so that it no longer requires ufuncs to return
NotImplemented.
Technically, it is possible to define ufunc loops for void dtypes
using PyUFunc_RegisterLoopForDescr, so technically I think this commit
changes behaviour: if someone had registered a ufunc loop for one of
these operations, then previously it might have been found and
pre-empted the special case fallback code; now, we use the
special-case code without even checking for any ufunc. But the only
possible use of this functionality would have been if someone wanted
to redefine what == or != meant for a particular structured dtype --
like, they decided that equality for 2-tuples of float32's should be
different from the obvious thing. This does not seem like an important
capability to preserve.
There were also several cases here where on error, an array comparison
would return a scalar instead of raising. This is supposedly
deprecated, but there were call paths that did this that had no
deprecation warning. I added those warnings.
|
|
|
|
|
|
|
| |
Add context manager for tests that, on entry, clears record of any
previous warnings from given modules, so that any warning raised in the
context block does get raised, rather than suppressed by a previous
warning causing an entry in the `__warningregistry_`` of the module.
|
|
|
|
|
| |
Fixed typos in docstrings were updated for functions where the parameter
names in the docstring didn't match the function signature.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fix addresses Issue #347.
All of the tests in this class were using random numbers generated
without a seed. This broke `test_simple` in a nondeterministic manner.
Rewrote all tests for this function. Instead of using random numbers,
well-defined arrays of widely varying amplitude were created instead.
Changed the array modification values so that the test arrays were
either just above or just below the NULP threshold.
Added tests for float64, float32, complex128, and complex64 dtypes, and
added both addition and subtraction tests. Tried to standardize the code
for all tests.
|
|\
| |
| |
| | |
DOC: Fixed incorrect assert_array_almost_equal_nulp documentation
|
| |
| |
| |
| |
| |
| | |
The `max()` function previously used does not work with two array-like.
`maximum()` does, and is what is essentially used in the code
(`ref = nulp * np.spacing(np.where(ax > ay, ax, ay))`).
|
| |
| |
| |
| | |
the beginning of nosetests
|
| |
| |
| |
| | |
In numpy/testing/__init__.py, import Tester before importing numpy core
|
| |
| |
| |
| |
| | |
minimum requirement is python2.6, this allows removing a couple 2.3 and
2.4 checks.
|
|\ \
| | |
| | | |
BUG: fix array_almost_equal for array subclasses
|
| |/
| |
| |
| | |
introduced in gh-4105/ab04e1ae0e8eca717bc7e42f3b0a60c9ff764289
|
| |
| |
| |
| |
| | |
allows passing flags like --pdb to test files
also add call to files where its missing
|
| | |
|
| | |
|
|\ \
| | |
| | | |
documentation updates
|
| |/
| |
| |
| |
| |
| |
| |
| | |
"Raise an assertion" was changed to "Raises an AssertionError" to clarify that
an exception named AssertionError will be raised.
Closes gh-4884
[ci skip]
|