summaryrefslogtreecommitdiff
path: root/numpy/core
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #10882 from eric-wieser/_array_from_buffer_3118Charles Harris2018-04-242-43/+78
|\ | | | | BUG: have _array_from_buffer_3118 correctly handle errors
| * TST: Work around memory leak in ctypes to prevent another test failingEric Wieser2018-04-201-4/+12
| |
| * BUG: have _array_from_buffer_3118 correctly handle errorsEric Wieser2018-04-122-43/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes gh-6741 If an object claims to support the PEP3118 buffer protocol, then any mistakes in the implementation should be raised as errors, rather than falling back on other approaches. This has some behavior changes: * np.array(mem_view_33d) now gives a more useful error message than "memoryview: unsupported format <B" * np.array(ctypes_pointer) now errors rather than creating an object array containing a single pointer Also adds support for 32-dimensional buffers, where previously the max was 31-dimensional.
* | Merge pull request #10824 from mattip/fix-PyArray_DeprecateWritebackIfCopyCharles Harris2018-04-243-8/+54
|\ \ | | | | | | BUG: test, fix PyArray_DiscardWritebackIfCopy refcount issue and docu…
| * | STY: Fix long line.Charles Harris2018-04-241-1/+2
| | |
| * | fix from reviewmattip2018-04-212-15/+17
| | |
| * | BUG: test, fix PyArray_DiscardWritebackIfCopy refcount issue and documentmattip2018-04-213-2/+45
| | |
* | | Merge pull request #10946 from ahaldane/fix_style_argCharles Harris2018-04-242-0/+5
|\ \ \ | | | | | | | | BUG: 'style' arg to array2string broken in legacy mode
| * | | BUG: 'style' arg to array2string broken in legacy modeAllan Haldane2018-04-212-0/+5
| | | | | | | | | | | | | | | | Fixes #10934
* | | | fixes from reviewmattip2018-04-221-20/+16
| | | |
* | | | BUG: it.close() disallows access to iterator, fixes #10950mattip2018-04-222-17/+28
| |/ / |/| |
* | | Merge pull request #9998 from mattip/nditer-as-context-managerAllan Haldane2018-04-2114-260/+703
|\ \ \ | |/ / |/| | ENH: Nditer as context manager
| * | fixes from reviewmattip2018-04-212-10/+1
| | |
| * | ENH: add nditer.close as per reviewmattip2018-04-202-10/+47
| | |
| * | ENH: add NpyIter_Close, nditer__{enter,exit}__mattip2018-04-2014-265/+680
| | |
* | | Merge pull request #10921 from mattip/percentile-graphCharles Harris2018-04-203-83/+88
|\ \ \ | | | | | | | | DOC: clear up warnings, fix matplotlib plot
| * | | fixes from reviewmattip2018-04-182-8/+8
| | | |
| * | | DOC: clear up warnings, fix matplotlib plotmattip2018-04-173-83/+88
| |/ /
* | | Merge pull request #10775 from mdboom/return-errors-from-initEric Wieser2018-04-192-20/+25
|\ \ \ | | | | | | | | BUG: Return NULL from PyInit_* when exception is raised
| * | | Return NULL from PyInit_* when exception is raisedMichael Droettboom2018-03-302-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't think this is documented anywhere, but I'm pretty sure module init functions should return NULL in order to communicate that an exception occurred during initialization (as is the standard Python/C API convention). It's clear from the CPython code [here](https://github.com/python/cpython/blob/master/Python/importdl.c#L162) that if you don't return NULL, the exception is swallowed and replaced with the message "initialization of %s raised unreported exception". Admittedly, this is only useful for people porting Numpy to new platforms where it is helpful to know where module initialization is failing, but it can't hurt.
* | | | Fixes #663: fixed dtype alignment for array of structs in case of converting ↵Ihor Melnyk2018-04-182-4/+22
| |/ / |/| | | | | | | | from tuple descr
* | | Merge pull request #10878 from mattip/devdocsRalf Gommers2018-04-161-1/+1
|\ \ \ | | | | | | | | DOC: rework documents and silence warnings during sphinx build
| * | | formatting fixesmattip2018-04-111-1/+1
| | | |
* | | | Merge pull request #10867 from Carreau/link-fullStefan van der Walt2018-04-141-19/+15
|\ \ \ \ | | | | | | | | | | DOC: Cross-reference full/full_like in a few "See Also" sections.
| * | | | 'remove indirect relationships'Matthias Bussonnier2018-04-091-15/+0
| | | | |
| * | | | Cross Link full/full_like in a few see-also.Matthias Bussonnier2018-04-091-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While teaching numpy I was asked the best way to create an array of nan, and `np.full` seem not be cross linked from many places; In particular in the documentation of `zeros` and `ones` seam like obvious candidates to add them. Reorder all the see-also to be - empty_like - ones_like - zero_like - full_like - empty - ones - zeros - full
* | | | | Merge pull request #10665 from pv/accumulate-same-nocopyCharles Harris2018-04-121-3/+9
|\ \ \ \ \ | |_|_|_|/ |/| | | | ENH: umath: don't make temporary copies for in-place accumulation
| * | | | ENH: umath: don't make temporary copies for in-place accumulationPauli Virtanen2018-04-091-3/+9
| | | | | | | | | | | | | | | | | | | | Do the operation `ufunc.accumulate(x, out=x)` without temporary copies.
* | | | | Merge pull request #10745 from eric-wieser/comparison-object-loopMarten van Kerkwijk2018-04-115-21/+61
|\ \ \ \ \ | |_|_|/ / |/| | | | ENH: Add object loops to the comparison ufuncs
| * | | | ENH: Add object loops to the comparison ufuncsEric Wieser2018-04-085-21/+61
| | | | | | | | | | | | | | | | | | | | This helps solve RobotLocomotion/drake#8315
* | | | | Merge pull request #10860 from pv/pypyfix-npy-title-keyCharles Harris2018-04-092-2/+39
|\ \ \ \ \ | |_|/ / / |/| | | | BUG: core: fix NPY_TITLE_KEY macro on pypy
| * | | | BUG: core: fix NPY_TITLE_KEY macro on pypyPauli Virtanen2018-04-082-2/+39
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Pypy, dictionary keys do not necessarily preserve object identity. This however was assumed by the NPY_TITLE_KEY macro, which relies on descriptor.c:568 using the same 'title' object both as a dictionary key as an entry in the tuple inserted. Since the items in the field dict are unique, value identity is however sufficient for the NPY_TITLE_KEY macro. On PyPy, fix the macro by comparing values instead.
* | | | Merge pull request #10796 from juliantaylor/inplace-overlapCharles Harris2018-04-091-4/+16
|\ \ \ \ | |_|/ / |/| | | BUG: fix wrong inplace vectorization on overlapping arguments
| * | | BUG: fix wrong inplace vectorization on overlapping argumentsJulian Taylor2018-03-251-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The input arguments to inplace operations can overlap for accumulate operatation where out[i+1] = in[i] + out[i] This breaks the no loop carried dependency assumptions the compiler has due to the ivdep pragma that is required for GCC to vectorize the loop. Currently this does not harm as accumulate operations are out of place, but future enhancements may change that. Fix this by verifying the arguments do not overlap within a hardware vector size. As we do not know the vector size of future machines use an extremely large value of 1024 bytes (commodity hardware currently has at most 64 bytes)
* | | | Merge pull request #10859 from charris/remove-yield-testsCharles Harris2018-04-091-64/+70
|\ \ \ \ | | | | | | | | | | MAINT: Remove yield tests
| * | | | TST: Remove yield tests from core/tests/test_umath_complex.py.Charles Harris2018-04-081-64/+70
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | Just replaces yields with normal function calls. Some of these tests could be parametrized with a bit of reorganization, however, the comments in the tests would have been lost and they seemed worth keeping.
* | | | Merge pull request #10850 from charris/deprecate-some-importsCharles Harris2018-04-091-0/+15
|\ \ \ \ | |/ / / |/| | | DEP: Issue deprecation warnings for some imports.
| * | | DEP: Issue deprecation warnings for some imports.Charles Harris2018-04-061-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following modules have been moved or renamed and should not be imported. This adds shim modules for the old names that issue a DeprecationWarning on import. * numpy/core/umath_tests.py * numpy/testing/decorators.py * numpy/testing/noseclasses.py * numpy/testing/nosetester.py * numpy/testing/utils.py Closes #10845.
* | | | MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-0637-236/+87
|/ / / | | | | | | | | | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* | | Merge pull request #10842 from charris/switch-to-pytestCharles Harris2018-04-0622-130/+169
|\ \ \ | | | | | | | | TST: Switch to pytest
| * | | TST: Update modules `test` to PytestTester.Charles Harris2018-04-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Numpy can now be tested using the standard `python -c"import numpy; numpy.test()"` construct.
| * | | TST: Switch to using pytest markersCharles Harris2018-04-0421-126/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use standard pytest markers everywhere in the numpy tests. At this point there should be no nose dependency. However, nose is required to test the legacy decorators if so desired. At this point, numpy test cannot be run in the way with runtests, rather installed numpy can be tested with `pytest --pyargs numpy` as long as that is not run from the repo. Run it from the tools directory or some such.
* | | | Merge pull request #10670 from eric-wieser/deprecate-sum-generatorCharles Harris2018-04-062-0/+12
|\ \ \ \ | | | | | | | | | | DEP: Deprecate np.sum(generator)
| * | | | DEP: Deprecate np.sum(generator)Eric Wieser2018-02-262-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #10652 Introduced in a13aad3ac33b629f3e696b4d4d5dbf4b5605d567
* | | | | Merge pull request #10826 from tylerjereddy/issue_10779_squeezeCharles Harris2018-04-062-6/+64
|\ \ \ \ \ | | | | | | | | | | | | BUG: np.squeeze() now respects older API axis expectation
| * | | | | BUG: np.squeeze() now respects older API axis expectationTyler Reddy2018-03-302-6/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixes Issue #10779 by removing the interception of an otherwise normal Exception when an object implemented with the expectation that squeeze() does not accept an axis argument receives an axis argument * Added unit tests that enforce respect for the old API expectation in objects, and ensure that silent success (or forced usage of the new API on objects) is no longer the case * Updated compatibility notes to explain this change
* | | | | | Merge pull request #10763 from ahaldane/fix_float_repr_tp_print_overrideCharles Harris2018-04-052-0/+54
|\ \ \ \ \ \ | | | | | | | | | | | | | | BUG: floating types should override tp_print
| * | | | | | BUG: floating types should override tp_printAllan Haldane2018-03-192-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #10753
* | | | | | | Merge pull request #10800 from eric-wieser/unify-ufunc-docsCharles Harris2018-04-051-110/+168
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | DOC: Add remarks about array vs scalar output to every ufunc
| * | | | | | | DOC: Add remarks about array vs scalar output to every ufuncEric Wieser2018-03-251-110/+168
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | Some ufuncs already mentioned this, but it seems sensible for all of them to describe it in exactly the same way.