| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Increment stacklevel for warnings to account for NEP-18 overrides
For NumPy functions that make use of `__array_function__`, the appropriate the
stack level for warnings should generally be increased by 1 to account for
the override function defined in numpy.core.overrides.
Fixes GH-13329
* Update numpy/lib/type_check.py
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
|
|\ |
|
| |
| |
| |
| | |
2 for polyfit rankwarning, 2 for divide by zero in log10.
|
| |
| |
| |
| | |
These ones just generated warnings, not build failures
|
| |\
| | |
| | | |
BUG: polyval returned non-masked arrays for masked input.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This fix will preserve subtypes of ndarray when given as input (x)
to the polyval function. In particular, the results for masked
values of a masked array will be masked.
Fixes #2477.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* ported the refguide_check module from SciPy for usage
in NumPy docstring execution/ verification; added the
refguide_check run to Azure Mac OS CI
* adjusted NumPy docstrings such that refguide_check passes
|
| | |
| | |
| | |
| | | |
disable scaling completely.
|
| | |
| | |
| | |
| | |
| | | |
Change differentiate to integrate in parameter `p` description.
Fixes #12386.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes GH-12271
Tests verify that everything in ``dir(numpy)`` either has ``__module__`` set to
``'numpy'``, or appears in an explicit whitelist of undocumented functions and
exported bulitins. These should eventually be documented or removed.
I also identified a handful of functions for which I had accidentally not setup
dispatch for with ``__array_function__`` before, because they were listed under
"ndarray methods" in ``_add_newdocs.py``. I guess that should be a lesson in
trusting code comments :).
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* ENH: __array_function__ support for np.lib, part 2
xref GH12028
np.lib.npyio through np.lib.ufunclike
* Fix failures in numpy/core/tests/test_overrides.py
* CLN: handle depreaction in dispatchers for np.lib.ufunclike
* CLN: fewer dispatchers in lib.twodim_base
* CLN: fewer dispatchers in lib.shape_base
* CLN: more dispatcher consolidation
* BUG: fix test failure
* Use all method instead of function in assert_equal
* DOC: indicate n is array_like in scimath.logn
* MAINT: updates per review
* MAINT: more conservative changes in assert_array_equal
* MAINT: add back in comment
* MAINT: casting tweaks in assert_array_equal
* MAINT: fixes and tests for assert_array_equal on subclasses
|
| |
| |
| |
| |
| | |
* Remove misleading reference to numpy/polynomial/polynomial/polyfit.
* Add missing period in numpy/polynomial/_polybase.py
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* DOC: reccomend polynomail.Polynomial over np.polyfit
* update from review
* update from review, fix links
* fix from review
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
This previously failed with:
TypeError: Cannot cast ufunc subtract output from dtype('complex128') to dtype('float64') with casting rule 'same_kind'
|
|/
|
|
|
|
|
| |
Turns out that this was relied upon downstream
We also add a setter for coeffs, so that augmented assignment does not both
change state and raise an exception suggesting state could not be changed.
|
|
|
|
| |
Remove the comment suggesting that they are not
|
|
|
|
|
|
|
| |
`poly.coeffs = 1` has always failed with a strong exception guarantee.
However, `poly.coeffs += 1` would both change the state and fail.
Now both fail without affecting the value.
|
|
|
|
| |
Scipy needs `.__dict__['coeffs']` to work, so we can't call the member _coeffs
|
| |
|
|
|
|
|
| |
Presumably written long before @property existed. This means we don't need
__dict__ everywhere
|
|
|
|
| |
Fixes #8760
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
np.roots() does not always return complex roots, the
roots of a polynomial depend its coefficients and
therefore may be in the real or complex domain.
e.g.
```
>>> (np.roots([1,2,3])).dtype
dtype('complex128')
>>> (np.roots([1,2,])).dtype
dtype('float64')
```
|
| |
|
|
|
| |
The first dimension of the return value depends on the degree of the polynomial, not the number of elements being used in the fit.
|
|
|
|
| |
Also a slight refactoring of np.polyfit.
|
|
|
|
|
|
|
|
| |
This should fix the issue discussed at
https://mail.scipy.org/pipermail/numpy-discussion/2013-July/067076.html
Without the ValueError added here, polyfit can (and does) return
negative or nan variances with no warning.
|
|\
| |
| | |
BUG: change real output checking to test if all imaginary parts are zero
|
| | |
|
| |
| |
| |
| | |
conjugates
|
| | |
|
| |
| |
| |
| | |
Closes gh-6849.
|
| |
| |
| |
| | |
Closes gh-6863.
|
|/ |
|
|
|
|
|
|
|
|
|
| |
- {ndarray, bool} -> ndarray or bool
- {int, array of ints} -> int or array of ints
- {str, function} -> str or function
- {sequnce, int} -> sequence or int
- {array_like, poly1d} -> array_like or poly1d
- {None, list of `m` scalars, scalar} -> list of `m` scalars or scalar
|
|
|
|
|
|
| |
Closes #5096. Casts integer arrays to np.double, to prevent
integer overflow. Object arrays are left unchanged, to allow
use of arbitrary precision objects.
|
|
|
|
|
|
|
|
|
| |
Multiplying a numpy_scalar times a numpy_array is much faster than
the other way around. This PR switches the order of multiplication
in the polyval function resulting in a speedup of about 5x for scalar
values of x.
Closes #4610.
|
|
|
|
| |
The rules enforced are the same as those used for scipy.
|
|
|
|
|
|
|
| |
Makes the identity check `a = np.array([np.nan], dtype=object)`
`a == a`, etc. a deprecation/futurewarning instead of just
changing it.
Also fixes some smaller things.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This means that for example broadcasting errors get raised.
The array_equiv function is changed to explicitely test
if broadcasting is possible. It may be nice to do this
test differently, but I am not sure if that is possible.
Create a FutureWarning for comparisons to None, which
should result in areal elementwise (object) comparisons.
Slightly adepted a wrong test.
Poly changes: Some changes in the polycode was necessary,
the one is probably a bug fix, the other needs to be
thought over, since len check is not perfect maybe, since
it is more liekly to raise raise an error.
Closes gh-3759 and gh-1608
|
|
|
|
| |
Matlab uses `conv` for both convolution and polynomial multiplication. Clarifying that numpy has functions for each.
|
|
|
|
| |
Fixes #2092. Changes message passed to ValueError.
|
|\
| |
| | |
BUG: Set __hash__ = None for non-hashable classes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Because neither poly1d nor the Polynomial package polynomial classes are
immutable, hence not reliably hashable, they should signal that by
setting __hash__ = None. This also fixes the warning
Overriding __eq__ blocks inheritance of __hash__ in 3.x
that is given when the command `python2.7 -3 -c"import numpy"` is run.
|
|/
|
|
| |
the notes were wrong in the order of the index for p.
|
|
|
|
|
|
|
| |
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idioms fixer makes the following replacements.
1) int <- bool
2) comparison or identity of types <- isinstance
3) a.sort() <- sorted(a)
There were two problems that needed to be dealt with after the
application of the fixer. First, the replacement of comparison or
identity of types by isinstance was not always correct. The isinstance
function returns true for subtypes whereas many of the places where the
fixer made a substitution needed to check for exact type equality.
Second, the sorted function was applied to arrays, but because it treats
them as iterators and constructs a sorted list from the result, that is
the wrong thing to do.
Closes #3062.
|