summaryrefslogtreecommitdiff
path: root/numpy/testing
Commit message (Collapse)AuthorAgeFilesLines
* ENH: Add dtype support to `np.testing`Bas van Beek2021-06-061-17/+52
|
* ENH: Add annotations for `np.testing`Bas van Beek2021-06-062-80/+337
|
* MAINT: Remove two private functions from `__all__`Bas van Beek2021-06-064-6/+4
|
* BLD: Add support for *.pyi data-files to `np.testing._private`Bas van Beek2021-06-061-0/+1
|
* MAINT: Move the `np.testing` annotations to `np.testing._private.utils`Bas van Beek2021-06-062-102/+148
|
* MAINT: Add placeholder annotations for two missing `np.testing` objectsBas van Beek2021-05-051-0/+6
| | | | Adds placeholders for two `np.testing` objects previously missed in https://github.com/numpy/numpy/pull/18842.
* ENH: Add improved placeholder annotations for `np.testing`Bas van Beek2021-04-231-43/+104
|
* DOC: Use: from numpy.testing import ...Tim Hoffmann2021-04-131-5/+5
| | | | | | | | | | | | instead of `import numpy.testing as npt`. - all of NumPy's own tests themselves use the from-import variant - There's `import numpy.typing as npt` around in some places so we should not abbreviate another module import with `npt`. Optional further enhancement: If this is a convention we also want users to adopt, this should be mentioned in the module docstring of `numpy.testing`.
* Merge pull request #18579 from mwtoews/refactor-dictRalf Gommers2021-03-211-13/+1
|\ | | | | MAINT: OrderedDict is no longer necessary from Python 3.7
| * MAINT: OrderedDict is no longer necessary from Python 3.7Mike Taves2021-03-081-13/+1
| |
* | Merge pull request #18642 from seberg/splitup-faster-argparsing-optimize-asarrayMatti Picus2021-03-211-11/+13
|\ \ | | | | | | ENH: Use new argument parsing for array creation functions
| * | ENH: Use new argument parsing for array creation functionsSebastian Berg2021-03-181-11/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The array creation functions have the most to gain: 1. np.asarray is 4 times faster and commonly used. 2. Other functions are wrapped using __array_function__ in Python making it more difficult This commit (unfortunatly) has to do a few things: * Modify __array_function__ C-side dispatching to accomodate the fastcall argument convention. * Move asarray, etc. to C after removing all "fast paths" from np.array (simplifying the code) * Fixup imports, since asarray was imported directly in a few places * Replace some places where `np.array` was probably used for speed instead of np.asarray or similar. (or by accident in 1 or 2 places)
* | MAINT: use super() as described by PEP 3135Mike Taves2021-03-192-7/+7
|/
* BUG: Allow unmodified use of isclose, allclose, etc. with timedeltaSebastian Berg2021-02-041-0/+5
| | | | | | | | | | | | | | Disallowing timedelta64+float promotion (to timedelta64) in all cases (previously it was assymetric and "half allowed") meant that isclose, allclose, np.ma.allclose, and assert_arrays_almost_equal (which uses isclose), would stop work for timedelta64. Hardcoding that timedelta64 is passed on unmodified retains the old behaviour. It may make sense to deprecate or change this behaviour in the future, but for the 1.20 release, the behaviour should be as much unmodified as possible. Closes gh-18286
* MAINT: Add missing `__all__` annotationsBas van Beek2021-02-011-1/+3
|
* DOC: Avoid using "set of" when talking about an ordered list.Antony Lee2020-12-291-1/+1
| | | | | | | | | | | | ... or when the input isn't/cannot be a set. I left a few usages, e.g. in random sampling, where "set" is reasonable as informal description of an array as the order doesn't matter; however, for e.g. np.gradient the order of the returned list is clearly important, so "set" is wrong. Also some other minor doc edits noticed during the grepping: using `shape` instead of `form` in `cov` is consistent with most other places; the wording in `Polynomial.trim` now matches other methods on the same class.
* Merge pull request #18051 from rpolley/deprecate-np-testing-dec-2Matti Picus2020-12-292-210/+47
|\ | | | | DEP: deprecate np.testing.dec
| * TST: move np.testing.dec tests to test_deprecations.pyRyan Polley2020-12-201-210/+0
| |
| * DEC: update deprecation version to 1.21 and add date commentsRyan Polley2020-12-201-12/+18
| |
| * DEC: deprecate the decorators in np.testing.decRyan Polley2020-12-201-0/+41
| | | | | | | | | | | | Since the decorators in np.testing.dec are intended for nose test framework support, deprecate them by updating the docstring and adding a warning when they are used on functions
* | DOC: Fix a couple of reference to verbatim and vice versaMatthias Bussonnier2020-12-181-1/+1
|/ | | | | | | | | | | | | | | | This update a coupe of references (single backticks) that actually are not to verbatim/code (double backticks); and a couple of verbatim to reference when they do actually exists and can be resolved in context. I probably missed other; and stayed simple but spoted a few other inconsistencies that I did not fix: - some ``...`` could actually be :math:`...` but not always clear if it would be better. - some intervals are [``...``], other are ``[...]`` I guess they could be discussed individually; it was mostly the failing references that bothered me.
* Fix AttributeError: 'bool' object has no attribute 'ndim'Christoph Gohlke2020-12-031-1/+1
|
* MAINT: Rewrite can-cast logic in terms of NEP 42Sebastian Berg2020-11-241-1/+109
|
* BUG: Fixed an issue where `.pyi` weren't picked up by numpy sub-packagesBas van Beek2020-11-031-0/+1
|
* minor typographic changeJakob2020-10-241-1/+1
|
* more fixesJakob2020-10-231-4/+4
|
* fix quotation marksJakob2020-10-231-1/+1
|
* fix typoJakob2020-10-231-1/+1
|
* mostly string conversionsJakob2020-10-235-57/+53
|
* Merge pull request #17104 from BvB93/sub-modulesCharles Harris2020-09-071-0/+44
|\ | | | | ENH: Add placeholder stubs for all sub-modules
| * ENH: Replace module-level `__getattr__` with explicitly defined objectsBas van Beek2020-08-191-2/+42
| |
| * ENH: Add placeholder stubs for all sub-modulesBas van Beek2020-08-191-0/+4
| |
* | MAINT: Remove old sys.version_info codeHugo2020-09-031-1/+1
|/
* TST: fix tests for windows + PyPymattip2020-07-301-1/+2
|
* TST: Add new tests for array coercion (#16571)Sebastian Berg2020-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: Add traceback-skip to `assert_array_compare` * TST: Add tests for arraycoercion These tests have many xfails (some technically maybe not correct), which describe in detail what will change when merging the array-coercion changes; since all of those xfails are going to be removed. * TST: Add test for empty sequences * TST: Add tests for bad self-mutating sequence inputs to np.array These should never happen and rightly should lead to undefined behaviour (and preferably errors), but they excercise some more tricky code branches and should probably not crash. * Simplify the "all scalars" logic (hardcode) and fix complex cases * MAINT: Some cleanup, and xfail pypy PyPy seems to have issues with int(numpy_complex), maybe because it gives a warning during conversion (python does not define it). So simply mark it as xfail, it should work in my branch. Also some smaller cleanups. * TST: Add some further test, re-add missing rational * MAINT: Make rationals optional, because they fail some tests currently The failures will go away, since this must again be related to implemetning int() and float(). * Update numpy/conftest.py * MAINT: Fix strings and use pytest.param to clean things up * TST: Add tests for 0-D array-like input to np.array() corner-cases * TST: Improve parameterization IDs to get better printing at -vv
* MAINT: Move and improve test_ignore_nan_ulperror.Charles Harris2020-06-141-0/+33
| | | | | | | Move test_ignore_nan_ulperror to `numpy/testing/tests/test_utils.py and extend to all floating types. Closes 16600.
* DOC: Fixes for 18 broken links (#16472)bjnath2020-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * DOC: Fixes for 18 broken links This, with PR #16465, should fix nearly all the remaining broken links on the site. 4 or 5 others should be easy to fix and just need attention from someone more knowledgeable -- will open an issue. For release notes with dead links, I could usually find links on archive.org for roughly contemporary versions. * DOC: Update to "Fixes for 18 broken links #16472" * Obsolete links, previously commented out, now deleted: https://github.com/numpy/numpy/pull/16472#discussion_r433928958 * Semantic markup for reference to Python class: https://github.com/numpy/numpy/pull/16472#discussion_r433553928 * Missing :ref: in internal link: https://github.com/numpy/numpy/pull/16472#discussion_r433554484 Not included: Resolution on using external/internal doc link in .py: https://github.com/numpy/numpy/pull/16472#discussion_r433554824 * DOC: Add internal link for 'Fixes for 18 broken links' PR #16472 Making reference [1] an internal link in function_base.py => numpy.vectorize.html * DOC: Redirect 2 link fixes in PR #16472 * governance.rst link reverted * ununcs.rst `overridden` link goes where it was meant to per https://github.com/numpy/numpy/pull/16472#pullrequestreview-424666070
* DOC: Improve assert_warns docstring with exampleSeth Troisi2020-06-011-3/+16
|
* DOC: Update assert_warns parameter listSeth Troisi2020-05-281-5/+3
|
* Mark tests as a subpackage rather than data.Hameer Abbasi2020-05-061-1/+1
|
* DOC: Add missing bracket (gh-16051)Chunlin2020-04-252-3/+3
| | | Add missing closing brackets, script to generate the list in the PR gh-16051.
* convert shebang from python to python3 (#15687)Changqing Li2020-03-042-2/+2
| | | | Signed-off-by: Changqing Li <changqing.li@windriver.com>
* BUG: fix doctest exception messagesmattip2020-02-281-5/+12
|
* DOC: Reword docstring for assert_equal (gh-15614)Harshal Prakash Patankar2020-02-191-1/+1
|
* BUG: Ignore differences in NAN representation for computing ULP differencesRaghuveer Devulapalli2020-02-181-2/+17
|
* MAINT: cleanup unused imports; avoid redefinition of importsMike Taves2020-02-062-2/+0
| | | | | | | * Cleanup unused imports (F401) of mostly standard Python modules, or some internal but unlikely referenced modules * Where internal imports are potentially used, mark with noqa * Avoid redefinition of imports (F811)
* STY,MAINT: avoid 'multiple imports on one line' (flake8 E401)Mike Taves2020-01-281-1/+3
| | | | | | * PEP 8: "Imports should usually be on separate lines" * Where modified, sort imported modules alphabetically * Clean-up unused imports from these expanded lines
* STY: use 'yield from <expr>' for simple cases (#15444)Mike Taves2020-01-272-10/+5
| | | | | | | | | This PR uses simple cases of PEP 380 to rewrite: for v in g: yield v into: yield from <expr>
* MAINT: Remove Python2 workaroundsSeth Troisi2020-01-231-3/+0
|
* MAINT: Replace basestring with str.Charles Harris2020-01-231-3/+2
| | | | | | | This replaces basestring with str except in - tools/npy_tempita/ - numpy/compat/py3k.py