| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|