summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Bump cython from 0.29.15 to 0.29.16dependabot/pip/cython-0.29.16dependabot-preview[bot]2020-03-301-1/+1
| | | | | | | | Bumps [cython](https://github.com/cython/cython) from 0.29.15 to 0.29.16. - [Release notes](https://github.com/cython/cython/releases) - [Changelog](https://github.com/cython/cython/blob/master/CHANGES.rst) - [Commits](https://github.com/cython/cython/compare/0.29.15...0.29.16) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
* DOC, TST: enable refguide_check in circleci (#15848)Pierre de Buyl2020-03-293-3/+15
| | | | * DOC: fix traceback message to pass refguide_check * DOC, TST: add refguide_check to circleci
* Merge pull request #15854 from rossbar/hist-docstringMatti Picus2020-03-281-5/+5
|\ | | | | DOC: Fix docstring for _hist_bin_auto.
| * DOC: Fix docstring for _hist_bin_auto.Ross Barnowski2020-03-271-5/+5
|/ | | | | * "bandwidth" -> "bin width" * Minor grammatical fixes
* Merge pull request #15843 from melissawm/new-docs-indexCharles Harris2020-03-2710-58/+144
|\ | | | | DOC: First steps towards docs restructuring (NEP 44)
| * DOC: First steps towards docs restructuring (NEP 44)Melissa Weber Mendonca2020-03-2610-58/+144
| |
* | Merge pull request #15850 from gerlero/fix-typoEric Wieser2020-03-271-1/+1
|\ \ | | | | | | DOC: fix typo in C-API reference
| * | DOC: fix typo in C-API referenceGabriel Gerlero2020-03-271-1/+1
|/ /
* | Merge pull request #15836 from sgasse/axis_np_meanMatti Picus2020-03-272-1/+13
|\ \ | | | | | | BUG: Fix IndexError for illegal axis in np.mean
| * | BUG: Fix IndexError for illegal axis in np.meansgasse2020-03-262-1/+13
| |/ | | | | | | | | Catch IndexError in _count_reduce_items used in np.mean and np.var for illegal axis and reraise as AxisError, see gh-15817.
* | DOC: fix remaining doc files for refguide_check (#15720)Pierre de Buyl2020-03-265-160/+173
| | | | | | | | | | * DOC: skip f2py fortran and arrays.nditer cython tests for refguide_check * DOC: fix formatting of doc tests and improper use of nditer
* | MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-2632-112/+42
| | | | | | | | | | types (#15816) Cleanup from the dropping of python 2
* | Merge pull request #15781 from dcaliste/publicMatti Picus2020-03-262-4/+59
|\ \ | | | | | | BUG: don't add 'public' or 'private' if the other one exists
| * | BUG: don't add 'public' or 'private' if the other one existsDamien Caliste2020-03-262-4/+59
| | | | | | | | | | | | | | | | | | Currently, setting 'public' or 'private' attribute is adding one even if the other one already exists because of the else: part that is always appending.
* | | ENH: improved error message `IndexError: too many indices for array` (#15832)Yilin LI2020-03-262-3/+18
| |/ |/| | | | | | | * ENH: improved error message when the dimension of index is larger than the dimension of array, fixed issue #15321 Author: Yilin Li <yilin.lasia@gmail.com> Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
* | ENH: Use TypeError in `np.array` for python consistency (#15784)Maxwell Bileschi2020-03-252-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when writing something like ``` pd.DataFrame({'arr': np.array(1., 2., 3.)}) ``` ``` ValueError Traceback (most recent call last) <ipython-input-1-ffdb00ae9b74> in <module>() 1 import numpy as np 2 import pandas as pd ----> 3 pd.DataFrame({'arr': np.array(1., 2., 3.)}) ValueError: only 2 non-keyword arguments accepted ``` This stack trace that doesn't include a frame for the np constructor, because the constructor is generated python code. This may lead users to look elsewhere for the issuer of the ValueError, which may create red-herrings in that folks may look elsewhere. This changes makes it more obvious where the error is coming from. * reflects eric-wieser's suggestion about common error messages * Documents required non-keyword args for np.array * Update numpy/core/src/multiarray/multiarraymodule.c Co-Authored-By: Eric Wieser <wieser.eric@gmail.com> * Update numpy/core/src/multiarray/multiarraymodule.c Co-Authored-By: Eric Wieser <wieser.eric@gmail.com> * Update numpy/core/src/multiarray/multiarraymodule.c Co-Authored-By: Eric Wieser <wieser.eric@gmail.com> * Update multiarraymodule.c Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | DEP: Do not cast boolean indices to integers in np.delete (#15815)Eric Wieser2020-03-253-30/+41
| | | | | | | | | | | | | | | | This expires a deprecation from 1.8. The corresponding deprecation in `np.insert` has less clear semantics, so has been left to a future patch. Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
* | Merge pull request #15797 from sgasse/add_einsum_testSebastian Berg2020-03-241-0/+4
|\ \ | | | | | | TST: Add unit test for out=None of np.einsum
| * | TST: Add unit test for kwarg of np.einsumsgasse2020-03-221-0/+4
| | | | | | | | | | | | | | | Ensure that explicitly stating out=None does not raise an error in np.einsum, see #15776 and #15256.
* | | BUG: Break on all errors when performing strided casts. (gh-15827)Brandt Bucher2020-03-242-3/+11
| | | | | | | | | | | | Errors raised when casting some strided arrays are not caught. See gh-15790.
* | | Merge pull request #15830 from rth/import-fixes-mypyEric Wieser2020-03-243-18/+3
|\ \ \ | | | | | | | | MAINT: pathlib and hashlib are in stdlib in Python 3.5+
| * | | md5 module is deprecated since python 2.5Roman Yurchak2020-03-242-8/+2
| | | |
| * | | pathlib is in the standard libraryRoman Yurchak2020-03-241-10/+1
| | | |
* | | | BUG: Add basic __format__ for masked element to fix incorrect print (#15794)Warren Weckesser2020-03-242-0/+30
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix and test conversion of masked element to string in fstring / string interpolation. See PEP 498 for string interpolation (aka fstrings) in Python 3.6 and above. Fixes #15409. Original PR gh-15410 by: Stefan Codrescu <ssmmcc1@gmail.com> Co-authored-by: Stefan Codrescu <ssmmcc1@gmail.com> Co-authored-by: Stefan <5tefan@users.noreply.github.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* | | Merge pull request #15800 from brandtbucher/unsafe-castEric Wieser2020-03-242-53/+28
|\ \ \ | | | | | | | | BUG: Add error-checking versions of strided casts.
| * | | BUG: Break on errors when performing strided casts.Brandt Bucher2020-03-231-2/+12
| | | | | | | | | | | | | | | | Closed gh-15790.
| * | | TST: Add failing regression test for unsafe casts.Brandt Bucher2020-03-231-1/+5
| | | | | | | | | | | | | | | | | | | | Errors raised when casting some strided arrays are not caught. See gh-15790.
| * | | MAINT: Break out duplicated logic for strided casts.Brandt Bucher2020-03-231-52/+13
| | |/ | |/|
* | | Merge pull request #15802 from eric-wieser/simplify-insertEric Wieser2020-03-243-29/+17
|\ \ \ | | | | | | | | DEP: Make `np.insert` and `np.delete` on 0d arrays with an axis an error
| * | | DEP: Make `np.insert` and `np.delete` on 0d arrays with an axis an errorEric Wieser2020-03-223-29/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, the following code worked: ``` >>> some_0d = np.array(1) >>> np.insert(some_0d, "some nonsense", 10, axis=0) array(10) >>> np.insert(some_0d, "some nonsense", 42, axis="some nonsense") array(42) ``` Now these raise AxisError and TypeError, respectively. `delete` is exactly the same.
* | | | Merge pull request #15812 from eric-wieser/expire-delete-out-of-boundsSebastian Berg2020-03-231-1/+5
|\ \ \ \ | | | | | | | | | | TST: Remove code that is not supposed to warn out of warning assertion
| * | | | TST: Remove code that is not supposed to warn out of warning assertionEric Wieser2020-03-231-1/+5
| | | | |
* | | | | Merge pull request #15804 from eric-wieser/expire-delete-out-of-boundsSebastian Berg2020-03-233-22/+12
|\ \ \ \ \ | |/ / / / | | | | | DEP: Make np.delete on out-of-bounds indices an error
| * | | | DEP: Make np.delete on out-of-bounds indices an errorEric Wieser2020-03-223-22/+12
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that this only affects lists of indices. ```python >>> a = np.arange(3) ```` Before: ```python >>> np.delete(a, 100) IndexError >>> np.delete(a, [100]) DeprecationWarning array([0, 1, 2]) >>> np.delete(a, -1) array([0, 1]) >>> np.delete(a, [-1]) FutureWarning array([0, 1, 2]) ``` After: ```python >>> np.delete(a, 100) IndexError >>> np.delete(a, [100]) IndexError >>> np.delete(a, -1) array([0, 1]) >>> np.delete(a, [-1]) array([0, 1]) ```
* | | | Merge pull request #15805 from eric-wieser/expired-insert-delete-TypeErrorSebastian Berg2020-03-233-15/+18
|\ \ \ \ | | | | | | | | | | DEP: Forbid passing non-integral index arrays to `insert` and `delete`
| * | | | DEP: Forbid passing non-integral index arrays to `insert` and `delete`Eric Wieser2020-03-223-15/+18
| |/ / / | | | | | | | | | | | | This expires a deprecation warning from back in 1.9.
* | | | TST: switch PyPy job with CPython [skip travis] (#15809)Matti Picus2020-03-231-5/+21
| | | |
* | | | Merge pull request #15803 from person142/ufunc-extobjWarren Weckesser2020-03-221-5/+5
|\ \ \ \ | | | | | | | | | | DOC: correct possible list lengths for `extobj` in ufunc calls
| * | | | DOC: correct possible list lengths for `extobj` in ufunc callsJosh Wilson2020-03-221-5/+5
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the docs, the list can be of lengths 1, 2, or 3, but only length 3 appears to work: ``` >>> import numpy as np >>> np.sin(1, extobj=[16, 1, lambda: None]) 0.8414709848078965 >>> np.sin(1, extobj=[16, 1]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: UFUNC_PYVALS must be a length 3 list. >>> np.sin(1, extobj=[16]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: UFUNC_PYVALS must be a length 3 list. ```
* | | | Merge pull request #15799 from eric-wieser/simplify-insertSebastian Berg2020-03-221-7/+11
|\ \ \ \ | |/ / / | | | / | |_|/ |/| | MAINT: Cleanups to np.insert and np.delete
| * | MAINT: Make the axis logic for delete match insert.Eric Wieser2020-03-221-5/+4
| | | | | | | | | | | | No behavior change here unless someone implements a subclass where `arr.ravel().ndim == 0`, which no sane person would do anyway.
| * | MAINT: Add missing deprecation dates and versionsEric Wieser2020-03-221-1/+4
| | |
| * | MAINT: Remove some weird syntax for kwargsEric Wieser2020-03-221-1/+1
| | |
| * | MAINT: Add an explanatory comment for some weird codeEric Wieser2020-03-221-0/+2
| | |
* | | DEP: Make issubdtype consistent for types and dtypes (#15773)Sebastian Berg2020-03-223-28/+39
| |/ |/| | | | | | | | | | | | | | | | | This finishes the deprecation started in gh-9505 removing behaviour that allowed strings/types representing specific dtypes to behave like their more generic supertypes (e.g. the python float would map to floating instead of float64 which it typically maps to). Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
* | BLD: Add requirements.txt file for building docs (#15778)Ross Barnowski2020-03-193-11/+34
| | | | | | * BLD: Added doc_requirements.txt and improve documentation around building docs
* | BUG, TST: fix f2py for PyPy, skip one test for PyPy (#15750)Matti Picus2020-03-1810-43/+45
| | | | | | * BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
* | BUG: Guarantee array is in valid state after memory error occurs in getset.c ↵Mibu2872020-03-181-7/+13
|/ | | | | | | | | | | (#15736) Currently, in function array_shape_set, ndarray's pointers to dimensions and strides are freed before new array is allocated (Line 71). In case memory error occur, the array is left with dangling pointers. Therefore, we can not recover from such error. * To guarantee array in valid state when memory error occur * Fix: Free cache when nd == 0 to avoid memory leak * Update numpy/core/src/multiarray/getset.c Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
* Merge pull request #15774 from eric-wieser/remove-f2py-globalSebastian Berg2020-03-186-9/+2
|\ | | | | MAINT: remove useless `global` statements
| * MAINT: remove useless `global` statementsEric Wieser2020-03-186-9/+2
| | | | | | | | | | | | | | `global` is only needed if a variable appears on the left of an assignment. These variables do not. Most suffer from the misconception that `var[x] = y` requires `var` to be global, but it does not.