| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When __getitem__ fails, assignment falls back on __iter__, which may not
have the same length as __len__, resulting in a segfault.
See gh-7264.
* BUG: Don't rely on __len__ for safe iteration.
Skip __len__ checking entirely, since this has no guarantees of being
correct. Instead, first convert to PySequence_Fast and use that length.
Also fixes a refleak when creating a tmp array fails.
See gh-7264.
* TST: Update test for related edge-case.
The previous fix more gracefully handles this edge case by skipping the
__len__ check. Rather than raising with an unhelpful error message, just
create the array with whatever elements C() actually yields.
See gh-7264.
|
| |
|
|
|
| |
Python 3.9 started to deprecate these calls and the PyObject_Call*
variants are equivalent or nicer in any case.
|
| |\
| |
| | |
ENH: improve printing of arrays with multi-line reprs
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |\ \
| | |
| | | |
BUG,DOC: Allow attach docs twice but error if wrong
|
| | | |
| | |
| | |
| | |
| | |
| | | |
The old pointers are now provided by the C-API and the macros
seemed a bit confusing since ``new`` appears from nowhere being
defined in the macro.
|
| | | |
| | |
| | |
| | |
| | | |
Its not quite the right file, but close to newdoc seemed sensible
and we do not have a "right" file right now...
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously some of these were not set, because they were already
set on the C-level. Remove the duplicate message and replace it
instead with a forward to the ``ndarray`` attribute/method.
These docstrings are inherited by the actual scalars and thus the
"virtual class" note was misleading.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is technically not a bug, but some IDEs and IPython have
autoreload magic which can mean that NumPy gets reloaded a second
time. This is not safe, but when it happens ignoring that an
identical docstring is already attached fixes the issue.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I found that when building the latest master branch on Cygwin, while testing #16246, that thousands of warnings were generated at build time like:
numpy/core/src/npysort/binsearch.c.src: In function ‘binsearch_left_bool’:
numpy/core/src/npysort/binsearch.c.src:82:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
Granted this is just a warning, so I don't think it's a serious issue.
It seems the test that was supposed to check for __attribute__ support was not working as expected. The #pragmas only take effect if I provide a function body--they are ignored for bare declarations. I don't know if that's by intent, or if it's a GCC issue. For reference:
$ gcc --version
gcc (GCC) 7.4.0
|
| | | |
| | |
| | |
| | |
| | | |
* BUG: relpath fails for different drives on windows
* ENH: always use abspath
|
| |\ \ \
| | | |
| | | | |
MAINT: Clean up the implementation of quantile
|
| | | | |
| | | |
| | | | |
take now correctly returns `out`, even on 0d arrays
|
| | | | |
| | | |
| | | |
| | | | |
This also simplifies the axis handling logic, taking advantage of the fact we know `axis` is 0 for the rest of the function body
|
| | | | |
| | | |
| | | |
| | | | |
This does not affect the behavior in any way
|
| | |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | | |
the => seem to be extra and rst seem to not interprete backtick with
leading space as closing a directive, the the full line on text was put
in a html pre-tag when building the docs.
see current https://numpy.org/doc/stable/reference/generated/numpy.packbits.html
|
| | | |
| | |
| | |
| | | |
Most compilers should optimize it, but it doesn't hurt to inline and has a better name
now.
|
| |\ \ \
| | | |
| | | | |
DEP: Deprecate `numpy.dual`.
|
| | | | |
| | | |
| | | |
| | | | |
Also make the correction "Scipy" -> "SciPy" in a few places.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add a deprecation warning in the `numpy.dual` module, and
remove the use of `numpy.dual` from the few places where it
is used in the numpy code.
|
| |\ \ \ \
| | | | |
| | | | | |
BUG: Fix default fallback in genfromtxt
|
| | | | | |
| | | | |
| | | | | |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This affected (for example?) if the `dtype=object` was used
without a converter, meaning that the default one is used.
And this is currently the last one, which is `string_` (and thus
bytes).
Closes gh-16189
|
| | | | | |
| | | | |
| | | | | |
* DOC: Move math.isclose note to See Also.
|
| |\ \ \ \ \
| | | | | |
| | | | | | |
BUG: Ensure out argument is returned by identity for 0d arrays
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This makes the following functions consistent with the behavior of ufuncs:
* `np.argmax`
* `np.argmin`
* `np.choose`
* `np.trace`
* `np.round`
* `np.take`
Previously they would unpack these into scalars.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit adds a note to the documentation of finfo clarifying that
the attribute `tiny` does not represent the smallest positive usable
number. Instead it refers to the smallest positive number with there
being no leading 0's in the mantisse (normalized floating point number).
Alternatively, `tiny` represents the smallest positive floating point
number with full precision. The smallest positive subnormal floating
point number is typically orders of magnitudes smaller, but has reduced
precision since leading 0's in the mantisse are used to allow smaller
exponents than indicated by `minexp`.
The commit also adds a brief clarification to the docstring of machar.
Closes #16252
Co-authored-by: Anirudh Subramanian <anirudh2290@apache.org>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |\ \ \ \ \ \
| | | | | | |
| | | | | | | |
DOC: Clarifications for ``np.var``.
|
| | | | | | | | |
|
| |\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
MAINT: Unify cached (C-level static) imports
|
| | | |_|/ / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The main idea is that once we unify them, we can think about actually
being able to also clean them up.
This is far away from having no global state, but at this time I do not
see that as a seriousl goal personally. But it could be possible
to reload the module safely in a single interpreter maybe.
The commit adds the cache import for the complex casts, since it doubles
performance for small casts when the warning is not suppressed and it
unifies the handling.
|
| |\ \ \ \ \ \ \
| |_|/ / / / /
|/| | | | / /
| | |_|_|/ /
| |/| | | | |
MAINT: cleanups to quantile
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
It's easier to move the relevant axis to position 0 in `ap` first than it is to move it for every relevant object simultaneously.
|
| | | |/ / /
| |/| | |
| | | | |
| | | | | |
The `add` ufunc is happy to handle `out=None` by itself
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* DOC: Clarifications for np.std
* Line lengths fixes in np.std
* Swapped variable names in np.std
|
| |/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- Delete release note fragments from 1.19.0 (towncrier)
- Update 1.19.x release note (towncrier)
- Create 1.20.0-notes.rst for master development
- Update C-API versions for 1.20.x
- Update setup.py for 1.20.0
|
| |\ \ \ \
| | | | |
| | | | | |
DOC: Fix typos and cosmetic issues
|
| | | | | | |
|
| |\ \ \ \ \
| | | | | |
| | | | | | |
BUG: Add missing decref in fromarray error path
|
| | |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This function steals the dtype, so it must decref it also
on error. This is fixup of ffe76ac8df65c8e7831df9924a782276e060f3e6
which accidentally deleted the decref.
|
| |/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Using PyArray_PyIntAsIntp helper function instead
* TST: add tests for einsum numpy int and bool list subscripts
Added tests to check that einsum accepts numpy int64 types and
rejects bool. Rejecting bools is new behaviour in subscript lists.
I changed ValueError to TypeError on line 2496 in multiarraymodule.c
as it is more appropriate. I also modified einsumfunc.py to have the
same behaviour as in the C file when checking subscript list.
(Reject bools but accept anything else from operator.index())
Closes gh-15961
|
| |\ \ \ \
| | | | |
| | | | | |
DOC: Unify cross-references between array joining methods
|