summaryrefslogtreecommitdiff
path: root/numpy/polynomial
Commit message (Collapse)AuthorAgeFilesLines
* DOC: Add symbol in docstring for classes derived from ABCPolyBasePaul Romano2023-05-106-0/+36
| | | | | 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.
* DOC: Add example for Polynomial.degree(). (#23530)Stefanie Molin2023-04-131-0/+22
| | | | | Include additional example about 0-coefficients and the trim method. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* DOC: Update wording and xref domain from polynomial roots docstring #23374 ↵Younes2023-04-101-1/+1
| | | | (#23382)
* TST: Add fixture to avoid issue with randomizing test order.Ross Barnowski2023-01-041-0/+4
|
* Merge pull request #22670 from MatteoRaso/masterMatti Picus2022-11-272-1/+12
|\ | | | | BUG: Polynomials now copy properly (#22669)
| * Added pickle test for polynomialsMatteo Raso2022-11-261-0/+6
| |
| * BUG: Polynomials now copy properly (#22669)Matteo Raso2022-11-252-1/+6
| | | | | | | | | | | | | | | | 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.
* | TYP,ENH: Add annotations for the new `ABCPolyBase.symbol` propertyBvB932022-11-141-1/+3
|/ | | | Xref https://github.com/numpy/numpy/pull/16154
* DOC: Revert formula change, add note about order.Ross Barnowski2022-09-271-1/+2
| | | | Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
* DOC: Change in the documentation for chebpts2 methodShashank Gupta2022-09-161-1/+1
|
* DOC: Double backticks in lagfit. (#21948)Matthias Bussonnier2022-07-081-7/+7
| | | | | | 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.
* DOC: Replace the mathematical notation N(...) with text.warren2022-06-261-1/+1
| | | | | | | | | 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
* MAINT: limit the number of decimals in Polynomial representation (#21654)Lev Maximov2022-06-146-52/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* ENH: Add support for symbol to polynomial package (#16154)Ross Barnowski2022-06-013-42/+368
| | | | | | | 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>
* DOC: fix code sample for leg2poly (#21253)Pax2022-03-261-1/+1
| | | | | | | 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
* DOC: imbalanced backticks (#21020)Matthias Bussonnier2022-02-091-1/+1
|
* MAINT, DOC: discard repeated wordsDimitri Papadopoulos2022-01-134-4/+4
|
* STY: Use subscriptable `builtins` types over the generic aliases in `typing`Bas van Beek2021-12-239-16/+12
|
* DOC: Do not leave space between directive name and double colon.Matthias Bussonnier2021-11-033-6/+6
| | | | | | | | | | | 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.
* DOC: Fix math block in hermmulx, lagmulx (#20261)Matthias Bussonnier2021-10-313-3/+3
| | | | The math expression needs to be indented, Otherwise it is seen as being outside the directive and not rendered.
* Merge pull request #19478 from r-devulap/svmlMatti Picus2021-10-101-1/+1
|\ | | | | ENH: Vectorizing umath module using AVX-512 (open sourced from Intel Short Vector Math Library, SVML)
| * TST: increase error tol from 12 to 11 decimal places for test_approximationRaghuveer Devulapalli2021-08-241-1/+1
| | | | | | | | | | SVML library is accurate upto 4ULP and hence reduces the accuracy slightly
* | duplicate item in see also.Matthias Bussonnier2021-09-221-1/+1
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #19905 from Samyak2/polynomial-fit-doc-formattingCharles Harris2021-09-217-41/+41
|\ \ | | | | | | DOC: fix docstring formatting of polynomial fit method return values.
| * | DOC: fix formatting of a return value of polynomial fit methodsSamyak S Sarnayak2021-09-217-41/+41
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Typos found by codespellDimitri Papadopoulos2021-09-214-7/+7
|/
* ENH: Add `__path__` annotations to all sub-packagesBas van Beek2021-07-251-0/+1
|
* ENH: Add annotations for `<module>.test` objectsBas van Beek2021-07-251-0/+3
|
* DOC: Adjust polyfit doc to clarify the meaning of w (#18421)Mike Jarvis2021-06-087-29/+35
| | | | | | | | | | | | | | | | | * 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>
* DEP: Remove PolyBase from np.polynomial.polyutilsHolly Corbett2021-05-101-5/+0
| | | | Update stubs
* DEP: Remove PolyBase from np.polynomial.polyutilsHolly Corbett2021-05-101-24/+1
| | | | Additionally removes associated PolyError classes. These appear to me to be unused outside this file.
* DEP: Remove PolyBase from np.polynomial.polyutilsHolly Corbett2021-05-101-24/+1
| | | | Addresses issue #15658 by removing PolyBase class. Happy to submit alternative PR using getattr approach instead if desired.
* ENH: Add improved placeholder annotations for `np.polynomial`Bas van Beek2021-05-059-8/+370
|
* ENH: Add `__all__` to a number of public modulesBas van Beek2021-04-152-4/+16
|
* Merge pull request #18320 from madphysicist/patch-4Ralf Gommers2021-03-181-18/+17
|\ | | | | DOC: add links to polynomial function/class listing
| * DOC: Added links to text and tableJoseph Fox-Rabinovitz2021-03-051-18/+17
| | | | | | | | I found these convenient to have on hand while reading
* | API: Move `polynomial.polyutils` to the `PRIVATE_BUT_PRESENT_MODULES` listBas van Beek2021-03-161-1/+0
| | | | | | | | Aforementioned module was accidently marked as public
* | MAINT: Re-export a number of sub-modulesBas van Beek2021-03-151-0/+10
|/ | | | | | | Ensures that type checkers will allow the likes of: >>> import numpy as np >>> out = np.lib.stride_tricks.sliding_window_view(...)
* TST: Branch coverage improvement for `np.polynomial` (#18499)jbCodeHub2021-02-283-0/+34
| | | | | | | * 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
* DOC: cleanup of numpy/polynomial.Matthias Bussonnier2021-01-284-21/+9
| | | | | Numpydoc format says that the colon need o be omitted if there is no type, there were also some empty Examples Sections
* Use sinus based formula for `chebpts1`Weh Andreas2021-01-141-2/+2
|
* DOC: Avoid using "set of" when talking about an ordered list.Antony Lee2020-12-291-1/+1
| | | | | | | | | | | | ... 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.
* DOC: Update reference to verbatim in a few location.Matthias Bussonnier2020-12-287-7/+7
| | | | | Single backticks default role is reference, while here it seem to be for verbatim. Fix it in a couple of places.
* DOC: Fix a couple of reference to verbatim and vice versaMatthias Bussonnier2020-12-181-3/+3
| | | | | | | | | | | | | | | | 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.
* TST: Fix crosstalk issues with polynomial str tests.Ross Barnowski2020-12-071-5/+8
| | | | | | | | | | | 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.
* BUG: Fixed an issue where `.pyi` weren't picked up by numpy sub-packagesBas van Beek2020-11-031-0/+1
|
* MAINT: Chain exceptions in "_polybase.py" (#17453)Sahil Siddiq2020-10-071-4/+4
| | | * Removed "from" keyword and changed "raise e" to "raise"
* Merge pull request #17250 from albertvillanova/fix-docstringCharles Harris2020-09-106-44/+133
|\ | | | | DOC: Fix docstring cross-referencing
| * Fix docstring cross-referencingAlbert Villanova del Moral2020-09-046-44/+133
| |
* | ENH: Replace module-level `__getattr__` with explicitly defined objectsBas van Beek2020-08-201-2/+7
| |