| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
A 'symbol' argument was added in ABCPolyBase in 1.24 and documented there, but
the docstrings for derived classes (e.g., Polynomial) were not updated.
|
|
|
|
|
| |
Include additional example about 0-coefficients and the trim method.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
|
| |
(#23382)
|
| |
|
|\
| |
| | |
BUG: Polynomials now copy properly (#22669)
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
On line 502, self.symbol.copy() was called, which
causes an AttributeError, since self.symbol is a
string, so it doesn't have a copy() method. To fix
it, I simply removed the copy() and directly assigned
the string.
|
|/
|
|
| |
Xref https://github.com/numpy/numpy/pull/16154
|
|
|
|
| |
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
|
| |
|
|
|
|
|
|
| |
Some of the values in the documentation of lagfit are in single-backticks,
though single backticks usually means that this is a reference to
something else that sphinx tries to resolve. Here I update values that
reference nothing to use double backticks (verbatim), or emphasis.
|
|
|
|
|
|
|
|
|
| |
The meaning of the second argument in the mathematical notation
N(mu, b) for the normal distribution is not consistent. In some
references it is the variance while in others it is the standard
deviation. Let's avoid the ambiguity by not using the notation.
Fixes #21296
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* limit the number of decimals in Polynomial representation
* tests pass
* parenthesize exponential notation in polynomials
* fixed a long line warning
* added polynomial printoptions tests
* polynomial printoptions typo fixed
* made switch to exp notation in polynomial display more natural
* added a test on switching polynomials to exp notation
* fixed linter errors/warnings
* support for nanstr and infstr printoptions in polynomials
* 10^8 threshold for switching to exp notation when displaying polynomials
* merged in PR #21696 fixing issue #21695
* made linter happy
* made some docstring tests pass
* fixed the docs
Co-authored-by: Lev Maximov <lev.maximov@gmail.com>
|
|
|
|
|
|
|
| |
Adds a symbol attribute to the polynomials from the np.polynomial package to allow the user to control/modify the symbol used to represent the independent variable for a polynomial expression. This attribute corresponds to the variable attribute of the poly1d class from the old np.lib.polynomial module.
Marked as draft for now as it depends on #15666 - all _str* and _repr* methods of ABCPolyBase and derived classes would need to be modified (and tested) to support this change.
Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
|
|
|
|
|
|
|
| |
The previous code sample throws an attribute error around `P.leg2poly()`.
Since commit d41fc4d (2012), leg2poly is not exposed in
np.polynomial, and need to be explicitly called from `legendre`.
Fixes #20925
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
From my regular expression foo, those are the only 9 case whereas there
are about ~2000 usage that do not have spaces.
While this is ok with docutils/sphinx, it does not seem to be
documented, and that means that other parsers will see that as comments,
leading to for example improper syntax highlighting.
This make it also a tiny bit harder to develop alternative rst parsers.
|
|
|
|
| |
The math expression needs to be indented, Otherwise it is seen as being
outside the directive and not rendered.
|
|\
| |
| | |
ENH: Vectorizing umath module using AVX-512 (open sourced from Intel Short Vector Math Library, SVML)
|
| |
| |
| |
| |
| | |
SVML library is accurate upto 4ULP and hence reduces the accuracy
slightly
|
| |
| |
| |
| |
| |
| |
| |
| | |
Ok, I know legmul is important, I'm not sure I need it twice.
Joking aside, I belive that's a wrong copy-past, as other functions have
`legmulx, legmul`, but as this is the docs of legmulx, I guess the
author removed the `x` without realising legmul was already present.
|
|\ \
| | |
| | | |
DOC: fix docstring formatting of polynomial fit method return values.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #19897
The 2nd return value of the following methods/functions were badly
formatted and the list was all appearing in a single line. Changed them
to separate points which are rendered nicely.
- numpy.polyfit
- numpy.ma.polyfit
- numpy.polynomial.polynomial.polyfit
- numpy.polynomial.polynomial.Polynomial.fit
- numpy.polynomial.chebyshev.chebfit
- numpy.polynomial.chebyshev.Chebyshev.fit
- numpy.polynomial.hermite.hermfit
- numpy.polynomial.hermite.Hermite.fit
- numpy.polynomial.hermite_e.hermefit
- numpy.polynomial.hermite_e.HermiteE.fit
- numpy.polynomial.laguerre.lagfit
- numpy.polynomial.laguerre.Laguerre.fit
- numpy.polynomial.legendre.legfit
- numpy.polynomial.legendre.Legendre.fit
Also fixed erroneous links to `numpy.full` which were actually referring
to the `full` argument. Changed those to code strings (double backticks)
from single backticks.
Also fixed formatting issues in the 3rd return value of numpy.polyfit
(and hence also numpy.ma.polyfit).
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* DOC: Adjust polyfit doc to clarify the meaning of w
cov='unscaled', in particular, had inconsistently referred to a weight
of 1/sigma**2, while the doc for w says it should be equal to 1/sigma.
This change clarifies w to comport with more typical meanings of
weights in weighted least squares, and makes clear that cov='unscaled'
is appropriate when the weight w**2 = 1/sigma**2.
See Issue #5261 for more discussion of the errors/confusion in
the previous doc string.
* Update doc text for w in all polynomial module fit functions
Co-authored-by: Stefan van der Walt <sjvdwalt@gmail.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
|
| |
Update stubs
|
|
|
|
| |
Additionally removes associated PolyError classes. These appear to me to be unused outside this file.
|
|
|
|
| |
Addresses issue #15658 by removing PolyBase class. Happy to submit alternative PR using getattr approach instead if desired.
|
| |
|
| |
|
|\
| |
| | |
DOC: add links to polynomial function/class listing
|
| |
| |
| |
| | |
I found these convenient to have on hand while reading
|
| |
| |
| |
| | |
Aforementioned module was accidently marked as public
|
|/
|
|
|
|
|
| |
Ensures that type checkers will allow the likes of:
>>> import numpy as np
>>> out = np.lib.stride_tricks.sliding_window_view(...)
|
|
|
|
|
|
|
| |
* added tests for vander_nd in test_polyutils to cover some of the missed branches
* added tests to polyline and vander to improve branch coverage
* added tests to test_legendre.py to improve branch coverage
|
|
|
|
|
| |
Numpydoc format says that the colon need o be omitted if there is no
type, there were also some empty Examples Sections
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
... or when the input isn't/cannot be a set. I left a few usages, e.g.
in random sampling, where "set" is reasonable as informal description of
an array as the order doesn't matter; however, for e.g. np.gradient the
order of the returned list is clearly important, so "set" is wrong.
Also some other minor doc edits noticed during the grepping: using
`shape` instead of `form` in `cov` is consistent with most other places;
the wording in `Polynomial.trim` now matches other methods on the same
class.
|
|
|
|
|
| |
Single backticks default role is reference, while here it seem to be for
verbatim. Fix it in a couple of places.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This update a coupe of references (single backticks) that actually are not to
verbatim/code (double backticks); and a couple of verbatim to reference
when they do actually exists and can be resolved in context.
I probably missed other; and stayed simple but spoted a few other
inconsistencies that I did not fix:
- some ``...`` could actually be :math:`...` but not always clear if
it would be better.
- some intervals are [``...``], other are ``[...]``
I guess they could be discussed individually; it was mostly the failing
references that bothered me.
|
|
|
|
|
|
|
|
|
|
|
| |
Polynomial printing tests implicitly depended on calling
order, causing the test suite to fail when the test ordering was
randomized with the pytest-random plugin (gh-17954).
Two factors contributed to this:
* Improper setting of class-level test config and
* Poorly designed test that overrode an inherited class
variable.
|
| |
|
|
|
| |
* Removed "from" keyword and changed "raise e" to "raise"
|
|\
| |
| | |
DOC: Fix docstring cross-referencing
|
| | |
|
| | |
|