summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Merge pull request #15118 from mattip/cleanup-array-callSebastian Berg2020-01-165-75/+29
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | API: remove undocumented use of __array__(dtype, context)
| * | | | | MAINT: remove undocumented use of context in __array__(dtype, context)mattip2020-01-165-75/+29
| | | | | |
* | | | | | MAINT: Remove duplicate deprecation of fastclipSebastian Berg2020-01-151-8/+9
| | | | | |
* | | | | | DEP: Deprecate `->f->fastclip` at registration timeSebastian Berg2020-01-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the additional deprecation of fastclip if it is set at registration time instead of only testing that it is never used.
* | | | | | Merge pull request #14942 from seberg/clean-fasttakeMatti Picus2020-01-165-299/+279
|\ \ \ \ \ \ | | | | | | | | | | | | | | MAINT,API: ignore and NULL fasttake/fastputmask ArrFuncs slots
| * | | | | | DEP: Actually deprecate fasttake and fastclipmaskSebastian Berg2020-01-151-0/+31
| | | | | | |
| * | | | | | MAINT,API: Do not use fastputmask dtype slot and always NULL itSebastian Berg2020-01-073-73/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the use of the fastputmask ArrFuncs slot from within NumPy and always leaves it NULL.
| * | | | | | MAINT,API: Do not use fasttake slot of ArrFuncs and null itSebastian Berg2020-01-073-226/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always NULL the fasttake slot, and instead move the optimized versions by doing itemsize specialization in the Take function itself.
* | | | | | | Merge pull request #15305 from sethtroisi/sys_version_testsMatti Picus2020-01-1631-553/+246
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | MAINT: Remove sys.version checks in tests
| * | | | | | | MAINT: Remove sys.version checks in testsSeth Troisi2020-01-1531-553/+246
| | | | | | | |
* | | | | | | | Merge pull request #15286 from haojin2/patch-1Matti Picus2020-01-161-1/+5
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | DOC: Update ``np.full`` docstring.
| * | | | | | | Update doc for np.fullHao Jin2020-01-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Previous document was not properly documenting the case when `fill_value` is an array_like object.
* | | | | | | | Merge pull request #15307 from sethtroisi/sys_version_preMatti Picus2020-01-169-187/+88
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | MAINT: cleanup sys.version dependant code
| * | | | | | | | MAINT: cleanup sys.version dependant codeSeth Troisi2020-01-129-187/+88
| | | | | | | | |
* | | | | | | | | MAINT: Ragged cleanup (#15085)Matti Picus2020-01-153-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TST: refactor sorter tests, use proper ragged array creation syntax * MAINT: code never hit the exception, but would error when iterating * MAINT: pytest.mark.parametrize did not add much, removing (from review) * MAINT: use asanyarray and generalize (from review) Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | | | | | | | | Merge pull request #15333 from eric-wieser/use-PyDict_GetItemWithErrorMatti Picus2020-01-166-40/+166
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | BUG: Add some missing C error handling
| * | | | | | | | | BUG: Add some missing C error handlingEric Wieser2020-01-156-40/+166
| | | | | | | | | |
* | | | | | | | | | Merge pull request #15319 from Kai-Striega/correct_array_nameEric Wieser2020-01-151-3/+5
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | BUG: fix NameError in clip nan propagation tests
| * | | | | | | | | | TST: fix NameError in clip nan propogation testskai-striega2020-01-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test expects parameters `arr`, `amin` and `amax`. However it then uses `a`, `amin` and `amax` resulting in a `NameError`. This error was not caught as the test was marked with xfail. This commit changes `a` -> `arr` removing the NameError. Further it adds precautions against similar errors requiring the error to be an AssertionError and making the test strict.
* | | | | | | | | | | TST: move _no_tracing to testing._privatemattip2020-01-153-22/+24
| | | | | | | | | | |
* | | | | | | | | | | Merge pull request #15262 from eric-wieser/use-PyDict_GetItemWithErrorMatti Picus2020-01-1515-90/+307
|\ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / | |/| | | | | | | | | BUG: Use PyDict_GetItemWithError() instead of PyDict_GetItem()
| * | | | | | | | | | BUG: Use PyDict_GetItemWithError() instead of PyDict_GetItem()Eric Wieser2020-01-1415-90/+307
| | |_|_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means we no longer interpret `MemoryError` or `KeyboardInterrupt` as `keyword arg not provided`, for instance. This function is python 3 only, hence this was difficult to do in older versions of numpy. Inspired by https://bugs.python.org/issue35459
* | | | | | | | | | DOC: fix typosBrian Wignall2020-01-1419-21/+21
|/ / / / / / / / /
* | | | | | | | | Merge pull request #15124 from Bharat123rox/clipMatti Picus2020-01-141-1/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | DOC: Update documentation of np.clip
| * | | | | | | | | Doc changes per reviewBharat Raghunathan2019-12-181-1/+1
| | | | | | | | | |
| * | | | | | | | | DOC: Update documentation of np.clipBharat Raghunathan2019-12-181-1/+2
| | | | | | | | | |
* | | | | | | | | | Merge pull request #15144 from mhvk/ufunc-reduction-output-dimension-checkMatti Picus2020-01-142-2/+38
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | BUG: ensure reduction output matches input along non-reduction axes.
| * | | | | | | | | | BUG: ensure reduction output matches input along non-reduction axes.Marten van Kerkwijk2019-12-202-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, things like `np.add.reduce(np.ones((3, 3)), axis=0, out=np.empty(1))` worked, even though the output should have shape (3,).
* | | | | | | | | | | Merge pull request #15249 from eric-wieser/remove-evalMatti Picus2020-01-143-7/+9
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / / / |/| | | | | | | | | | MAINT: Eliminate some calls to `eval`
| * | | | | | | | | | Update numpy/f2py/crackfortran.pyEric Wieser2020-01-121-1/+1
| | | | | | | | | | |
| * | | | | | | | | | MAINT: Eliminate some calls to `eval`Eric Wieser2020-01-113-7/+9
| | |_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The instance in `_internal` is parsing tuples and integers, so `ast.literal_eval` is just fine * The instance in `crack_fortran` is just trying to lookup a function name dynamically * The instance in `f90mod_rules` is looking at the result of `capi_maps.getarrdims(...)['rank']`, which is always a string representation of an integer The f2py code is still littered with `eval`, but the remaining cases were harder to reason about.
* | | | | | | | | | Merge pull request #15315 from rossbar/doc/ma_readme_gh_formattingCharles Harris2020-01-111-0/+0
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | DOC: Changed file extension of ma README.
| * | | | | | | | | Changed file extension of ma README.Ross Barnowski2020-01-101-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get github to render the rST correctly.
* | | | | | | | | | Merge pull request #15261 from eric-wieser/unicode-commastringMatti Picus2020-01-122-38/+36
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | MAINT: Work with unicode strings in `dtype('i8,i8')`
| * | | | | | | | | | MAINT: Work with unicode strings in `dtype('i8,i8')`Eric Wieser2020-01-112-38/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, we convert `str` objects to `bytes`, and then work with those. Since this is a human convenience API, the input really ought to be a string. A future patch will suggest deprecating `dtype(b'i8,i8')`, but for now it will continue to work.
* | | | | | | | | | | Merge pull request #15310 from eric-wieser/tidy-dtype-ctors-fix-errors-wipMatti Picus2020-01-111-48/+35
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / | | / / / / / / / / / | |/ / / / / / / / / |/| | | | | | | | | MAINT: Ensure `_convert_from_*` functions set errors
| * | | | | | | | | MAINT: Ensure `_convert_from_*` functions set errorsEric Wieser2020-01-101-48/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously some of these would return null without setting an error, meaning the caller had to clean up after them. Removes all direct callers of `PyArray_DescrConverter` in this file, since `_convert_from_any` has less indirection and a simpler calling convention.
* | | | | | | | | | ENH: Avoid escaping unicode in error messages (#15312)Eric Wieser2020-01-101-30/+4
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to do formatting with `%s` this any more, we can use the `%S` formatting characters to embed the unicode directly. Also simplifies similar cases using `%R`.
* | | | | | | | | Merge pull request #15300 from eric-wieser/tidy-dtype-ctors-try_convertSebastian Berg2020-01-103-67/+76
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | MAINT: Refactor dtype conversion functions to be more similar
| * | | | | | | | | FIXUP: fix misnamingEric Wieser2020-01-102-2/+2
| | | | | | | | | |
| * | | | | | | | | FIXUP: Clean up the external caller to use the new API tooEric Wieser2020-01-093-21/+12
| | | | | | | | | |
| * | | | | | | | | FIXUP: use Py_NotImplemented insteadEric Wieser2020-01-091-22/+21
| | | | | | | | | |
| * | | | | | | | | MAINT: Refactor dtype conversion functions to be more similarEric Wieser2020-01-091-54/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before there were three signatures: * `PyArray_Descr*(...)` * `PyArray_Descr*(..., int* err_flag)` * `int(..., PyArray_Descr** ret)` This unifies them all into `PyArray_Descr*(...)`, and introduces a special singeton to distinguish "error" from "gave up" cases. Also changes function names for consistency.
* | | | | | | | | | Merge pull request #15291 from eric-wieser/cleanup-descriptor-error-handlingMatti Picus2020-01-101-17/+45
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | BUG: Add missing error handling to _convert_from_list
| * | | | | | | | | | BUG: Add missing error handling to _convert_from_listEric Wieser2020-01-081-17/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously this function would return null without setting an exception. Additionally, there were many places it could segfault if an exception occurred.
* | | | | | | | | | | Merge pull request #15304 from sethtroisi/remove_NPY_PY3KMatti Picus2020-01-102-17/+0
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | | MAINT: Remove NPY_PY3K constant
| * | | | | | | | | | MAINT: Remove NPY_PY3KSeth Troisi2020-01-082-17/+0
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this PR NPY_PY3K should only appear in 'npy_3kcompat.h' and 'doc/Py3K.rst.txt'
* | | | | | | | | | Merge pull request #15287 from eric-wieser/simplify-PyArray_DescrAlignConverterSebastian Berg2020-01-081-62/+33
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | MAINT: Express PyArray_DescrAlignConverter in terms of _convert_from_any
| * | | | | | | | | | MAINT: Express PyArray_DescrAlignConverter in terms of _convert_from_anyEric Wieser2020-01-081-62/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also fixes an inconsequential bug, meaning the following (scary) code no longer asserts ``` np.typeDict['mypoint`] = [('a', 'i1'), ('b', 'i2')] assert np.dtype('mypoint', align=True).isalignedstruct ``` I'm not going to legitimize this sort of thing with a test though.
* | | | | | | | | | | MAINT: C code simplificationSeth Troisi2020-01-086-84/+19
| |/ / / / / / / / / |/| | | | | | | | |