| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
|\
| |
| | |
MAINT: Python2 Cleanups
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
| |
|
| |
|
|
|
|
|
|
|
| |
The pickle module was being imported from numpy.core.numeric. It was
defined there in order to use pickle5 when available in Python3 and
cpickle in Python2. The numpy.compat module seems a better place for
that.
|
|
|
|
|
|
|
|
| |
* ported the refguide_check module from SciPy for usage
in NumPy docstring execution/ verification; added the
refguide_check run to Azure Mac OS CI
* adjusted NumPy docstrings such that refguide_check passes
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#12448)
* Review F401,F841,F842 flake8 errors (unused variables, imports)
* Review comments
* More tests in test_installed_npymath_ini
* Review comments
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes GH-12271
Tests verify that everything in ``dir(numpy)`` either has ``__module__`` set to
``'numpy'``, or appears in an explicit whitelist of undocumented functions and
exported bulitins. These should eventually be documented or removed.
I also identified a handful of functions for which I had accidentally not setup
dispatch for with ``__array_function__`` before, because they were listed under
"ndarray methods" in ``_add_newdocs.py``. I guess that should be a lesson in
trusting code comments :).
|
|
|
|
|
|
|
|
| |
All imports of pickle from numpy modules are now done this way:
>>> from numpy.core.numeric import pickle
Also, some loops on protocol numbers are added over pickle tests that
were not caught from #12090
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
After the pytest migration, test classes no longer inherit
from unittest.TestCase and and the fail method does not
exist anymore.
In all these cases, we can use assert_raises and assert_raises_regex instead
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pytest < 3.8 ignored warnings issued during test collection, but that
changed in pytest 3.8 and the method NumPy used to suppress the
PendingDeprecationWarning for matrices no longer worked, or rather, was
exposed as not working. The fix here is to suppress the warning in
pytest.ini and pytesttester.py , which should work as long as the tests
are the only places left where NumPy uses matrices.
An alternate fix is to delay the construction of matrices in the tests
until they are actually run, which has the virtue of test localization
but is a bit more complicated.
See https://github.com/pytest-dev/pytest/issues/3945 for discussion.
|
| |
|
|
|
|
|
|
|
|
| |
unnecessary import dependencies
pytesttester is used by every single subpackage, so making it depend on np.testing just creates cyclic dependencies that can lead to circular imports
Relates to #11457
|
| |
|
| |
|
| |
|
|\
| |
| | |
Move remaining Matrix tests to matrixlib
|
| | |
|
| | |
|
| | |
|
|\ \ |
|
| |\ \
| | |/
| |/| |
MAINT: move linalg tests using matrix to matrixlib
|
| | |
| | |
| | |
| | |
| | | |
This is in preparation for deprecation and eventual removal
of the matrix class.
|
|/ /
| |
| |
| |
| | |
The docstring already assumed it was in linalg, and this ensures
linalg becomes completely independent of matrixlib.
|
|/
|
|
|
|
| |
Further progress in isolating matrix in preparation of its
deprecation. There is one place left with an explicit reference
to matrix (in MaskedArray.count), which is to be solved later.
|
|
|
|
|
| |
That function is nose specific and has not worked since `__init__` files
were added to the tests directories.
|
|
|
|
|
|
|
|
| |
Numpy can now be tested using the standard
`python -c"import numpy; numpy.test()"`
construct.
|
|
|
|
|
| |
The "bench" testing with the old bench files is no longer supported.
These days we use `runtests.py` and `asv`.
|
|
|
| |
Found via `codespell -q 3 -I ../numpy-whitelist.txt`
|
|
|
|
|
|
|
|
| |
Abstract collection classes accessed from the collections module
have been deprecated since Python 3.3. They should be
accessed through collections.abc. When run with Python
3.7, the deprecation warning cause multiple tests to
fail.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
BUG: issubdtype is inconsistent on types and dtypes
|
| |
| |
| |
| | |
Fixes gh-9506, unsigned exponentiation
|
|/
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Bare except is very rarely the right thing
|
|
|
|
| |
Based on feedback in #7768
|
|
|
|
|
|
| |
Fixes #8459
* DOC: add release note [ci skip]
|