summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* BUG: Ensure SeedSequence 0-padding does not collide with spawn keysRobert Kern2020-06-092-2/+37
| | | | | | | | | | | | | Fixes #16539 The implicit 0-padding that is done to small entropy inputs to make them the size of the internal pool conflicts with the spawn keys, which start with an appended 0. In order to maintain stream compatibility with unspawned `SeedSequence`s, we explicitly 0-pad short inputs out to the pool size only if the spawn key is provided, and thus would trigger the bug. This should minimize the impact on users that were not encountering the bug.
* DOC: Fix ``np.ma.core.doc_note`` (#16311)Takanori H2020-06-092-11/+35
| | | * fix np.ma.core.doc_note
* Merge pull request #16515 from person142/add-type-stubsMatti Picus2020-06-0934-0/+2502
|\ | | | | ENH: add type stubs from numpy-stubs
| * MAINT: avoid more division by zero in typing test causing aarch64 to failJosh Wilson2020-06-071-5/+6
| |
| * MAINT: avoid divide by zero in typing test causing aarch64 tests to failJosh Wilson2020-06-071-1/+1
| |
| * MAINT: modify mypy error line parsing to work on windowsJosh Wilson2020-06-071-2/+14
| | | | | | | | It currently splits on ":", which causes problems with drives.
| * MAINT: move typing tests cases into a subdirectory of numpy/testsJosh Wilson2020-06-0728-6/+6
| |
| * ENH: add type stubs from numpy-stubsJosh Wilson2020-06-0634-0/+2489
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the type stubs and tests from numpy-stubs. Things this entails: - Copy over the stubs (numpy/__init__.pyi and numpy/core/_internal.pyi) - The only modification made was removing `ndarray.tostring` since it is deprecated - Update some setup.py files to include pyi files - Move the tests from numpy-stubs/tests into numpy/tests - Skip them if mypy is not installed (planning on setting up CI in a future PR) - Add a mypy.ini; use it to configure mypy in the tests - It tells mypy where to find NumPy in the test env - It ignores internal NumPy type errors (since we only want to consider errors from the tests cases) - Some small edits were made to fix test cases that were emitting deprecation warnings - Add numpy/py.typed so that the types are picked up in an installed version of NumPy
* | Merge pull request #16446 from dgasmith/einsum_orderSebastian Berg2020-06-082-2/+48
|\ \ | | | | | | BUG: fixes einsum output order with optimization (#14615)
| * | BUG: fixes einsum ouput order with optimization (#14615)Daniel G. A. Smith2020-06-082-2/+48
| | |
* | | Merge pull request #16504 from bashtage/doc-mv-normCharles Harris2020-06-081-1/+2
|\ \ \ | | | | | | | | DOC: Correct MV Normal sig
| * | | DOC: Correct MV Normal sigKevin Sheppard2020-06-051-1/+2
| | |/ | |/| | | | | | | Add new kw arg to sig
* | | DEP: Deprecate inexact matches for mode, searchside (gh-16056)Anirudh Subramanian2020-06-086-71/+125
| | | | | | | | | | | | | | | | | | | | | Previously misspelling were allowed by these functions as long as e.g. the first letter matched. They will now check whether the match is exact giving a deprecation warning when it is not. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | | Merge pull request #16510 from madphysicist/patch-1Charles Harris2020-06-081-1/+1
|\ \ \ | | | | | | | | DOC: Minor rounding correction in Generator.binomial
| * | | DOC: Minor rounding correction in Generator.binomialJoseph Fox-Rabinovitz2020-06-061-1/+1
| |/ / | | | | | | Changed 38.88 from 38 to 39
* | | ENH: Improve the ARM cpu feature detection by parsing /proc/cpuinfo (#16321)Chunlin2020-06-082-25/+268
| | | | | | | | | * when parsing auxv fail, try parsing /proc/cpuinfo
* | | BUG: Fix cython warning in random/_common.pyx.Charles Harris2020-06-071-1/+2
| | | | | | | | | | | | | | | Fix for #16508. Cython wants every pointer declaration to be on a separate line.
* | | Merge pull request #16503 from bashtage/bug-broadcast-sizeCharles Harris2020-06-072-0/+70
|\ \ \ | | | | | | | | BUG:random: Error when ``size`` is smaller than broadcast input shapes.
| * | | BUG: Correct broadcasting when size is not NoneKevin Sheppard2020-06-052-0/+70
| |/ / | | | | | | | | | | | | | | | | | | Broadcastable size with inputs does not produce an error when size produces a smaller output array than the broadcast input shape. Patch checks that the output shape matches the outer shape of the broadcast fo all inputs and the size when given.
* | | Merge pull request #16524 from pv/f2py-threadsafe-cb-fixupCharles Harris2020-06-072-19/+18
|\ \ \ | | | | | | | | MAINT: f2py: move thread-local declaration definition to common macro
| * | | MAINT: f2py: move thread-local declaration definition to common macroPauli Virtanen2020-06-082-19/+18
| | | | | | | | | | | | | | | | | | | | Move compiler thread-local declaration detection to a common macro. Also support C11 thread_local declaration, if available.
* | | | Merge pull request #16522 from seiko2plus/issue_16516Charles Harris2020-06-071-3/+4
|\ \ \ \ | |/ / / |/| | | MAINT:ARMHF Fix detecting feature groups NEON_HALF and NEON_VFPV4
| * | | MAINT:ARMHF Fix detecting feature groups NEON_HALF and NEON_VFPV4Sayed Adel2020-06-071-3/+4
| | | |
* | | | TST: f2py: add test for callback threadsafetyPauli Virtanen2020-06-071-0/+50
| | | |
* | | | BUG: numpy/f2py: put callback globals to thread-local storagePauli Virtanen2020-06-074-47/+156
|/ / /
* | | STY: f2py/rules: replace \t with whitespace for readabilityPauli Virtanen2020-06-071-37/+37
| | |
* | | STY: f2py/cb_rules: replace \t by whitespace for readabilityPauli Virtanen2020-06-071-147/+147
| | |
* | | Merge pull request #16500 from bjnath/move_c_style_linkRalf Gommers2020-06-062-3/+3
|\ \ \ | | | | | | | | DOC: Point Contributing page to new NEP 45
| * | | DOC: Use intersphinx for NEP referencesBen Nathanson2020-06-042-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per #16500 discussion, adds link updates to PR. Replaces NEP URLs with intersphinx links in these files: * doc/HOWTO_RELEASE.rst.txt * doc/source/dev/howto-docs.rst * numpy/doc/dispatch.py * numpy/lib/format.py and incorporates @rossbar's #16502 change of `config.py`.
* | | | DOC: Fixes for 18 broken links (#16472)bjnath2020-06-064-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | | MAINT: make Py_SET_SIZE and Py_SET_TYPE macros a bit safer (#16501)Thomas A Caswell2020-06-061-2/+2
| |/ / |/| | | | | | | | | | | | | | This is the spelling of the compatibility macro that CPython is recommending. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | | Merge pull request #15162 from seberg/reduce-axes-tryMatti Picus2020-06-0410-595/+479
|\ \ \ | | | | | | | | BUG,MAINT: Fix issues with non-reduce broadcasting axes
| * | | BUG: The reduction output must not cause the input to be broadcastSebastian Berg2020-05-302-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was previously checked for, but during the refactor using NPY_ITER_REDUCTION_AXIS to allocate the result in the iterator instead of manually was lost here. Einsum has a similar issue, but this is not modified here.
| * | | MAINT: Address review comments related to NPY_ITER_REDUCTION_AXISSebastian Berg2020-05-304-11/+11
| | | | | | | | | | | | | | | | Incorporate suggestions by Marten and Eric.
| * | | DOC: Slightly improve error message on incorrectly shaped reductionsSebastian Berg2020-05-111-7/+9
| | | |
| * | | BUG,MAINT: Simplify reduction result creation using reduce axisSebastian Berg2020-05-113-387/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new reduce axis marker for nditer/NpyIter allows to move the allocation logic necessary to allocate the reduction result to the nditer, thus simplifying the logic here. This leads to some other related cleanups of the result initialization. The subok flag was removed, since it was always set to 0 and the iterator rejects subclasses.
| * | | BUG: Avoid incorrect broadcasts on non-core outputs in gufuncsSebastian Berg2020-05-112-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark the core dimensions as reduce axis. This allows them to be freely broadcast (basically ignored for most practical purposes) while other axes are normally broadcast even though the operand is read-only or write-only. If we were to use read-write operands with `REDUCE_OK` these additional dimensions are currently simply absored as reduction dimensions... (I hope this is understandable, please see the issues/test for an example...) Fixes gh-15139, replaces gh-15142 Co-Authored-By: Marten van Kerkwijk <mhvk@astro.utoronto.ca>
| * | | MAINT: Use reduction axis marker for einsumSebastian Berg2020-05-111-4/+2
| | | |
| * | | ENH: Allow specifying reduction axis in nditer/NpyIterSebastian Berg2020-05-112-12/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A reduction axis can be a broadcast axis (-1), which does not exist. Or an existing axis which then must have a length of 1, or will be allocated with a length of 1. This allows the correct allocation of reduction outputs with axes of size 1 (instead of only newaxis/-1), i.e. it allows supporting the result output with `keepdims=True` in reductions. It can also be used by generalized ufuncs to specific that one operand does not need to iterate a core dimensions. In the case of generalized ufuncs, this is handled like a reduce dimensions, but that dimension is later removed. This means that the operand can be specified without read-write. It mainly is necessary to allow normal broadcasting for the axes _not_ marked as reduce axis. In most cases however, an operand should never use broadcasting when marking axes as reduction.
| * | | MAINT: Simplify strides and axis check in npyiter_new_temp_arraySebastian Berg2020-05-112-64/+75
| | | | | | | | | | | | | | | | | | | | | | | | The stride calculation and axis check redid some of the work finding the number of dimensions again. This simplifies the logic and clarifies an error message a bit.
| * | | MAINT: Simplify signature of npyiter_replace_axisdataSebastian Berg2020-05-111-13/+11
| | | |
| * | | MAINT: (nditer) move duplicated reduce axis check into helper funcSebastian Berg2020-05-111-54/+43
| | | |
| * | | MAINT: Simplify undoing of iter-axis-perm in nditerSebastian Berg2020-05-113-54/+57
| | | |
* | | | Merge pull request #16468 from scivision/gcc10Sebastian Berg2020-06-041-1/+2
|\ \ \ \ | |_|/ / |/| | | BUG: fix GCC 10 major version comparison
| * | | BUG: gcc >= 10: correctly compare major versionMichael Hirsch2020-06-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comparison of GCC major version used a string comparison, which is known to break when comparing single vs. double version numbers. This fix compares the integer of the major GCC version. Before this fix, GCC/Gfortran 10 would get inappropriate flag "-mno-cygwin" applied, which was removed in GCC 4 and makes GCC error out.
* | | | Merge pull request #15666 from rossbar/enh/poly_strMatti Picus2020-06-044-23/+463
|\ \ \ \ | | | | | | | | | | ENH: Improved `__str__` for polynomials
| * | | | STY: Move comment outside of try/except.Ross Barnowski2020-05-131-3/+3
| | | | |
| * | | | Handle TypeError in _generate_str for coefs.Ross Barnowski2020-05-132-7/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a fallback for TypeErrors that are raised when attempting to compare arbitrary elements (e.g. strings or Python complex) to 0 in _generate_str.
| * | | | ENH: Improved __str__, __format__ for polynomialsRoss Barnowski2020-05-074-23/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes the printing style of instances of the convenience classes in the polynomial package to a more "human-readable" format. __str__ has been modified and __format__ added to ABCPolyBase, modifying the string representation of polynomial instances, e.g. when printed. __repr__ and the _repr_latex method (which is used in the Jupyter environment are unchanged. Two print formats have been added: 'unicode' and 'ascii'. 'unicode' is the default mode on *nix systems, and uses unicode values for numeric subscripts and superscripts in the polynomial expression. The 'ascii' format is the default on Windows (due to font considerations) and uses Python-style syntax to represent powers, e.g. x**2. The default printing style can be controlled at the package-level with the set_default_printstyle function. The ABCPolyBase.__str__ has also been made to respect the linewidth printoption. Other parameters from the printoptions dictionary are not used. Co-Authored-By: Warren Weckesser <warren.weckesser@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | | | | Merge pull request #16389 from seberg/hardcode-scalar-buffersMatti Picus2020-06-0411-30/+182
|\ \ \ \ \ | | | | | | | | | | | | ENH: Hardcode buffer handling for simple scalars