summaryrefslogtreecommitdiff
path: root/numpy/tests
Commit message (Collapse)AuthorAgeFilesLines
* TST: Add `numpy.typing.mypy_plugin` to the list of public modulesBas van Beek2020-12-221-0/+1
|
* DOC: Doc for deprecate_with_doc (#17852)kumudlakara2020-12-171-1/+1
| | | | | | * Add doc for deprecate_with_doc Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com> Co-authored-by: Matti Picus <matti.picus@gmail.com>
* DOC: Warn when reloading numpy or using numpy in sub-interpreterSebastian Berg2020-12-151-5/+9
| | | | | | | | This adds a warning when the main NumPy module is reloaded with the assumption that in this case objects such as `np.matrix`, `np._NoValue` or exceptions may be cached internally. It also gives a warning when NumPy is imported in a sub-interpreter.
* ENH: Use versioneer to manage numpy versions.Charles Harris2020-12-081-1/+1
| | | | | | | | | | | | The new tags look like '1.21.0.dev0+98.gaa0453721f', where '98' is the number of commits since the 1.21.0 branch was started and 'aa0453721f'. The chosen form may be specified in the 'setup.cfg' file. This PR adds two new files 'numpy/_version.py' and 'numpy/version.py'. The latter is kept because it is part of the public API and is actually used by some downstream projects, but it is no longer dynamically created. See https://github.com/python-versioneer/python-versioneer/ for more information.
* ENH: add support for fujitsu compiler to numpy. (#17792)Tomoki, Karatsu2020-12-031-0/+1
|
* Merge pull request #17122 from charris/cleanup-f2py-versioningRalf Gommers2020-11-281-2/+2
|\ | | | | MAINT: Use numpy version for f2py version.
| * MAINT: Use numpy version for f2py version.Charles Harris2020-08-221-2/+2
| | | | | | | | | | | | Because f2py is released as part of numpy, the old svn versioning no longer makes sense and it was decided to use the numpy version instead.
* | Change string to f-stringJakob2020-10-231-1/+1
| |
* | Merge pull request #17344 from danbeibei/masterCharles Harris2020-10-091-0/+1
|\ \ | | | | | | ENH: Support for the NVIDIA HPC SDK nvfortran compiler
| * | ENH: Add support for the NVIDIA HPC SDK fortran compilerDaniel Vanzo2020-09-221-0/+1
| | |
* | | MAINT: Move typing testsCharles Harris2020-09-0739-1954/+0
| | | | | | | | | | | | Move them into a new `numpy/typing/tests directory`
* | | Merge branch 'master' into ndarray-methodsCharles Harris2020-09-078-7/+107
|\ \ \
| * \ \ Merge pull request #17144 from BvB93/function-base-coreCharles Harris2020-09-073-0/+41
| |\ \ \ | | | | | | | | | | ENH: Add annotations to 3 functions in `np.core.function_base`
| | * | | ENH: Change the `axis` type to `SupportsIndex`Bas van Beek2020-08-231-1/+5
| | | | |
| | * | | MAINT: The returned step size can be complexBas van Beek2020-08-232-1/+2
| | | | | | | | | | | | | | | | | | | | Co-Authored-By: Eric Wieser <eric-wieser@users.noreply.github.com>
| | * | | TST: Add tests for the `np.core.function_base` stubsBas van Beek2020-08-233-0/+36
| | | |/ | | |/|
| * | | Merge pull request #17214 from BvB93/genericCharles Harris2020-09-073-7/+43
| |\ \ \ | | | | | | | | | | MAINT: Fix various issues with the `np.generic` annotations
| | * | | TST: Don't run typing tests on lines that are commented outBas van Beek2020-09-012-3/+3
| | | | | | | | | | | | | | | | | | | | Addresses https://github.com/numpy/numpy/pull/17214#discussion_r481239468
| | * | | MAINT: Only allow `SupportsIndex` for python >= 3.8Bas van Beek2020-09-011-3/+7
| | | | | | | | | | | | | | | | | | | | See https://bugs.python.org/issue20092
| | * | | ENH: Add an alias for `Union[str, bytes]`; updated two `np.generic` constructorsBas van Beek2020-09-011-0/+2
| | | | |
| | * | | TST: Add tests for the new `generic` constructorsBas van Beek2020-09-011-3/+28
| | | | |
| | * | | MAINT: Make `datetime64` a `generic` subclass (again)Bas van Beek2020-09-011-3/+8
| | | | |
| * | | | Merge pull request #17104 from BvB93/sub-modulesCharles Harris2020-09-072-0/+23
| |\ \ \ \ | | | | | | | | | | | | ENH: Add placeholder stubs for all sub-modules
| | * | | | TST: Remove `compat` and `core` from the testsBas van Beek2020-08-201-2/+0
| | | | | |
| | * | | | ENH: Replace module-level `__getattr__` with explicitly defined objectsBas van Beek2020-08-192-2/+5
| | | | | |
| | * | | | REV: Removed one last builtin moduleBas van Beek2020-08-191-1/+0
| | | | | |
| | * | | | REV: Removed two more (accidently included) builtin modulesBas van Beek2020-08-191-2/+0
| | | | | |
| | * | | | REV: Removed the (accidently included) builtin `sys` moduleBas van Beek2020-08-191-1/+0
| | | | | |
| | * | | | ENH: Add placeholder stubs for all sub-modulesBas van Beek2020-08-191-0/+26
| | | |/ / | | |/| |
* | | | | TST: Fixed a testBas van Beek2020-09-071-1/+1
|/ / / /
* | | | Merge pull request #17223 from mattip/setuptools1Charles Harris2020-09-041-12/+0
|\ \ \ \ | | | | | | | | | | MAINT: use sysconfig not distutils.sysconfig where possible
| * | | | MAINT: use sysconfig not distutils.sysconfig where possiblemattip2020-09-021-12/+0
| | |/ / | |/| |
* | | | BUG: Avoid using ``np.random`` in typing tests.Charles Harris2020-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Using `np.random` can cause mysterious test failures in mypy `api.run` with a report that 'error: Module has no attribute "rand"'. The fix here is to use `np.empty` instead of `np.random.rand`. Why this works is unknown at present.
* | | | MAINT, DOC: move informational files from numpy.doc.*.py to their *.rst ↵Matti Picus2020-09-021-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | counterparts (#17222) * DOC: redistribute docstring-only content from numpy/doc * DOC: post-transition clean-up * DOC, MAINT: reskip doctests, fix a few easy ones
* | | | ENH: Added missing methods to `np.flatiter` (#17180)Bas van Beek2020-09-023-0/+53
|/ / / | | | | | | | | | | | | | | | | | | | | | * MAINT: Added missing methods to `np.flatiter` * DOC: Added a comment about weird `flatiter.__getitem__` behavior Contrary to `ndarray.__getitem__` its counterpart in `flatiter` does not accept objects with the `__array__` or `__index__` protocols; boolean indexing is just plain broken (gh-17175)
* | | ENH: typing: Make `np.complexfloating` generic w.r.t. `np.floating` (#17172)Bas van Beek2020-09-011-0/+3
| | |
* | | TST: Add more `Literal`-related testsBas van Beek2020-08-291-0/+43
| | |
* | | ENH: Add annotations to the last 8 functions in numpy.core.fromnumeric (#16729)Bas van Beek2020-08-243-0/+176
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added annotations for 8 new functions The 8 respective functions, all located in `np.core.fromnumeric`, consist of: * `prod` * `cumprod` * `ndim` * `size` * `around` * `mean` * `std` * `var` Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | DEP: lib: Remove the deprecated financial functions. (#17067)Warren Weckesser2020-08-121-1/+0
| | | | | | | | | | | | | | | | | | As explained in NEP 32, the financial functions are to be removed from version 1.20. They are now replaced with module level `__getattr__` to give a useful error message for those surprised by the `AttributeError`. This only works for Python 3.7+, but it is expected that by the 1.20 release Python 3.6 will not be supported.
* | MAINT: Implemented two dtype-related TODO's (#16622)Bas van Beek2020-07-303-2/+47
| | | | | | | | | | This pull requests addresses and implement two previous TODO's in `np.typing._DTypeLike`: * Added a protocol, `_SupportsDtype`, for objects with the `dtype` attribute. * Replaced an old dictionary, representing array field parameter, with a `TypedDict`.
* | MAINT: Added the `order` parameter to `np.array()` (#16966)Bas van Beek2020-07-292-0/+10
|/ | | | | | | * MAINT: Added the `order` argument to `np.array()` * MAINT: Made a number of `np.array()` arguments keyword-only * TST: Added a `np.array` test with >2 positional arguments
* Allow `None` to be passed to certain `generic` subclassesBas van Beek2020-06-251-0/+6
| | | | | | | Affected generic subclasses: * `floating` * `complexfloating` * `datetime64`
* Fixed language styleErfan Nariman | Veneficus2020-06-231-3/+3
|
* ENH: Added annotations to 8 functions from np.core.fromnumeric (#16647)Bas van Beek2020-06-223-0/+174
| | | | | | | | | | | | Newly annotated functions: * `clip` * `sum` * `all` * `any` * `cumsum` * `ptp` * `amax` * `amin`
* ENH: add annotation for abs (#16618)Yuya Unno2020-06-212-0/+4
| | | `numpy.abs` is alias of `numpy.absolute`. I added its type annotation.
* TST: add a static typing test for memoryviews as ArrayLikesLevi Stovall2020-06-201-1/+2
| | | | See #16612
* Merge pull request #13516 from seiko2plus/core_improve_infa_buildMatti Picus2020-06-171-0/+1
|\ | | | | ENH: enable multi-platform SIMD compiler optimizations
| * ENH: [1/7] enable multi-platform SIMD compiler optimizationsSayed Adel2020-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement new distutils class `CCompilerOpt`, used for handling the CPU/hardware optimization, starting from parsing the command arguments, to managing the relationship between the CPU baseline and dispatch-able features, also generating the required C headers and ending with compiling the sources with proper compiler's flags. `CCompilerOpt` mainly used as a helper class for `CCompiler`, and doesn't provide any runtime detection for the CPU features, instead only focuses on the compiler side, but it generates abstract C headers that can be used later for the final runtime dispatching process.
* | Merge pull request #16558 from person142/typing-runtimeMatti Picus2020-06-173-16/+5
|\ \ | | | | | | ENH: make typing module available at runtime
| * | MAINT: make typing module available at runtimeJosh Wilson2020-06-093-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes https://github.com/numpy/numpy/issues/16550. This makes `np.typing.ArrayLike` and `np.typing.DtypeLike` available at runtime in addition to typing time. Some things to consider: - `ArrayLike` uses protocols, which are only in the standard library in 3.8+, but are backported in `typing_extensions`. This conditionally imports `Protocol` and sets `_SupportsArray` to `Any` at runtime if the module is not available to prevent NumPy from having a hard dependency on `typing_extensions`. Since e.g. mypy already includes `typing_extensions` as a dependency, anybody actually doing type checking will have it set correctly. - We are starting to hit the edges of "the fiction of the stubs". In particular, they could just cram everything into `__init__.pyi` and ignore the real structure of NumPy. But now that typing is available a runtime, we have to e.g. carefully import `ndarray` from `numpy` in the typing module and not from `..core.multiarray`, because otherwise mypy will think you are talking about a different ndarray. We will probably need to do some shuffling the stubs into more fitting locations to mitigate weirdness like this.