summaryrefslogtreecommitdiff
path: root/numpy/polynomial
Commit message (Collapse)AuthorAgeFilesLines
* DOC: Fixes for 18 broken links (#16472)bjnath2020-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * DOC: Fixes for 18 broken links This, with PR #16465, should fix nearly all the remaining broken links on the site. 4 or 5 others should be easy to fix and just need attention from someone more knowledgeable -- will open an issue. For release notes with dead links, I could usually find links on archive.org for roughly contemporary versions. * DOC: Update to "Fixes for 18 broken links #16472" * Obsolete links, previously commented out, now deleted: https://github.com/numpy/numpy/pull/16472#discussion_r433928958 * Semantic markup for reference to Python class: https://github.com/numpy/numpy/pull/16472#discussion_r433553928 * Missing :ref: in internal link: https://github.com/numpy/numpy/pull/16472#discussion_r433554484 Not included: Resolution on using external/internal doc link in .py: https://github.com/numpy/numpy/pull/16472#discussion_r433554824 * DOC: Add internal link for 'Fixes for 18 broken links' PR #16472 Making reference [1] an internal link in function_base.py => numpy.vectorize.html * DOC: Redirect 2 link fixes in PR #16472 * governance.rst link reverted * ununcs.rst `overridden` link goes where it was meant to per https://github.com/numpy/numpy/pull/16472#pullrequestreview-424666070
* Merge pull request #15666 from rossbar/enh/poly_strMatti Picus2020-06-044-23/+463
|\ | | | | ENH: Improved `__str__` for polynomials
| * STY: Move comment outside of try/except.Ross Barnowski2020-05-131-3/+3
| |
| * Handle TypeError in _generate_str for coefs.Ross Barnowski2020-05-132-7/+54
| | | | | | | | | | | | Add a fallback for TypeErrors that are raised when attempting to compare arbitrary elements (e.g. strings or Python complex) to 0 in _generate_str.
| * ENH: Improved __str__, __format__ for polynomialsRoss Barnowski2020-05-074-23/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes the printing style of instances of the convenience classes in the polynomial package to a more "human-readable" format. __str__ has been modified and __format__ added to ABCPolyBase, modifying the string representation of polynomial instances, e.g. when printed. __repr__ and the _repr_latex method (which is used in the Jupyter environment are unchanged. Two print formats have been added: 'unicode' and 'ascii'. 'unicode' is the default mode on *nix systems, and uses unicode values for numeric subscripts and superscripts in the polynomial expression. The 'ascii' format is the default on Windows (due to font considerations) and uses Python-style syntax to represent powers, e.g. x**2. The default printing style can be controlled at the package-level with the set_default_printstyle function. The ABCPolyBase.__str__ has also been made to respect the linewidth printoption. Other parameters from the printoptions dictionary are not used. Co-Authored-By: Warren Weckesser <warren.weckesser@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | Mark tests as a subpackage rather than data.Hameer Abbasi2020-05-061-1/+1
| |
* | DOC: Add missing bracket (gh-16051)Chunlin2020-04-255-16/+16
| | | | | | Add missing closing brackets, script to generate the list in the PR gh-16051.
* | Added some chained exceptionsChris Holland2020-04-231-4/+4
| |
* | MAINT,TST: Move _repr_latex tests to test_printing.Ross Barnowski2020-04-212-50/+49
| | | | | | | | | | | | | | | | | | | | Organizational refactoring - the tests for the polynomial _repr_latex method were originally defined in test_classes.py. Based on the descriptions of the various test files, it is a better fit in test_printing.py. Updated docstring to reflect that _repr_latex is used in Jupyter environments, not IPython terminals (by default).
* | MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-261-2/+1
|/ | | | | types (#15816) Cleanup from the dropping of python 2
* DOC: Refactor `np.polynomial` docs using `automodule` (#15662)Ross Barnowski2020-03-126-220/+306
| | | * DOC: Refactor polynomial docs using automodule.
* Merge pull request #15434 from notanton/maintenance-fstringsCharles Harris2020-01-2610-68/+61
|\ | | | | MAINT: Updated polynomial to use fstrings
| * Updated files in polynomial/ to use fstringsAnton Ritter-Gogerly2020-01-2710-68/+61
| |
* | MAINT: Remove Python2 workaroundsSeth Troisi2020-01-231-4/+0
|/
* MAINT: Clean up, mostly unused imports.Warren Weckesser2020-01-236-7/+0
|
* MAINT: Ragged cleanup (#15085)Matti Picus2020-01-152-10/+10
| | | | | | | | | | | | * TST: refactor sorter tests, use proper ragged array creation syntax * MAINT: code never hit the exception, but would error when iterating * MAINT: pytest.mark.parametrize did not add much, removing (from review) * MAINT: use asanyarray and generalize (from review) Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-0510-67/+67
| | | | | | | 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.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-0319-38/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* MAINT: polynomial: Add an N-d vander implementation used under the hood of ↵Eric Wieser2019-09-147-41/+86
| | | | | | | | the vander2d and vander3d functions The generalization is not exposed in the public API yet, but it could be if the need arises. The shape / dtype conversion logic is left as is for now, even if it might be broken.
* MAINT: Remove redundant deprecation checksEric Wieser2019-08-241-8/+2
| | | | These deprecations already happen inside `vanderf`, so don't need to be repeated here.
* TST: hit the deprecationwarningpatto902019-07-141-1/+3
|
* check also warning messagepatto902019-07-141-2/+3
|
* add missing import warningspatto902019-07-131-0/+1
|
* add test to hit RankWarning in polyutils._fitpatto902019-07-131-2/+12
|
* MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-017-29/+29
|
* DOC: fix some more See Also issuesRalf Gommers2019-04-145-10/+5
| | | | These ones just generated warnings, not build failures
* DOC: fix doc formatting issues exposed by numpydoc 0.9.0rc1Ralf Gommers2019-04-146-12/+12
|
* ENH: rotate companion matrix for all polynomial basesTyler Moncur2019-04-086-7/+13
|
* ENH: use rotated companion matrix to reduce errorTyler Moncur2019-04-081-1/+1
|
* Merge pull request #13146 from eric-wieser/poly-powCharles Harris2019-03-177-90/+43
|\ | | | | MAINT: Unify polynomial power functions
| * MAINT: Unify polynomial power functionsEric Wieser2019-03-167-90/+43
| | | | | | | | | | | | These power functions are all the same - the algorithm used does not care about the basis. `polypow` and `chebpow` have some optimizations in their versions, which this maintains
* | Merge branch 'master' into deprecate-float-orderEric Wieser2019-03-161-23/+2
|\ \ | |/ |/|
| * Merge pull request #13130 from eric-wieser/unify-polyfitCharles Harris2019-03-167-450/+94
| |\ | | | | | | MAINT: Unify polynomial fitting functions
| * \ Merge pull request #13128 from eric-wieser/unify-polyaddCharles Harris2019-03-157-114/+39
| |\ \ | | | | | | | | MAINT: Unify polynomial addition and subtraction functions
| * \ \ Merge pull request #13111 from eric-wieser/unify-polydivCharles Harris2019-03-137-96/+58
| |\ \ \ | | | | | | | | | | MAINT: Unify polydiv
| * \ \ \ Merge pull request #13107 from eric-wieser/simplify-val-ndEric Wieser2019-03-127-144/+72
| |\ \ \ \ | | | | | | | | | | | | MAINT: Unify polynomial valnd functions
| * \ \ \ \ Merge pull request #13078 from eric-wieser/simplify-from-rootsCharles Harris2019-03-127-90/+36
| |\ \ \ \ \ | | | | | | | | | | | | | | MAINT: deduplicate fromroots in np.polynomial
| * | | | | | MAINT: Merge duplicate implementations of `hermvander2d` and `hermvander3d` ↵Eric Wieser2019-03-111-23/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions One was missing from gh-13079
* | | | | | | DEP: polynomial: Be stricter about integral argumentsEric Wieser2019-03-1613-132/+111
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior for: * The `deg` and `axis` arguments of `<type>der` * The `deg` and `axis` arguments of `<type>int` * The `deg` argument of `<type>gauss` * The `deg` argument of `<type>vander2d` * The `deg` argument of `<type>vander3d` The old behavior was: * Raise `ValueError` if the argument is a float, but not an integral one * Allow a float like `1.0` to mean `1`. This is inconsistent with most other integer-accepting APIs in numpy, which require these to be actual integers, and raise TypeError when they are not. The new behavior is: * Raise `TypeError` if the argument is a float, but not an integral one * Emit a `DeprecationWarning` if a float like `1.0` is passed, continuing to allow it its old meaning.
* | | | | | MAINT: Unify polynomial fitting functionsEric Wieser2019-03-157-450/+94
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These fitting functions are all the same - the algorithm used does not care about the basis. This was done using: * A regex find / replace on all but poly and cheb * A manual diff showing that cheb differed only by whitespace * A manual diff showing that poly differed in `deg.ndim == 1` vs `deg.ndim > 0`. Given that this function only allows `deg.ndim <= 1`, and `ndim >= 0`, these two comparison are equivalent.
* | | | | MAINT: Unify polynomial addition and subtraction functionsEric Wieser2019-03-147-114/+39
| |_|_|/ |/| | | | | | | | | | | These functions are all the same - the algorithm used does not care about the basis.
* | | | MAINT: Unify polynomial division functionsEric Wieser2019-03-127-80/+42
| | | | | | | | | | | | | | | | | | | | | | | | These division functions are all the same - the algorithm used does not care about the basis. Note that while chebdiv and polydiv could be implemented in terms of this function, their current implementations are more optimal and exploit the properties of a multiplication by a basis polynomial.
* | | | MAINT: Adjust variable names for consistencyEric Wieser2019-03-122-16/+16
| |_|/ |/| | | | | | | | | | | This makes the variable names in polydiv and chebdiv match polyutils._div. It also brings the order of the special-casing in line to match.
* | | MAINT: Unify polynomial valnd functionsEric Wieser2019-03-127-144/+72
| |/ |/| | | | | No point writing the same function 12 times, when you can write it once
* | MAINT: Move duplicate implementations of ABCPolyBase._fromroots into polyutilsEric Wieser2019-03-117-90/+36
|/ | | | | | Every implementation is the same right now, other than calling different line / mul functions. Found by LGTM.
* MAINT: Merge duplicate implementations of `*vander2d` and `*vander3d` functionsEric Wieser2019-03-026-119/+59
| | | | | | | Every implementation is the same right now, other than calling a different `*vander` function. Merging these into a single private function taking a callback results in significant deduplication. Found by LGTM.
* MAINT: Fix ABCPolyBase in various waysEric Wieser2019-03-021-31/+46
| | | | | | | | | | | This previously: * Did not indicate the arguments in the abstract methods * Did not actually use the `abc` mechanism at all on python 3 (`__metaclass__` does not work any more) * Used the now-deprecated `@abstractproperty` This didn't cause any runtime problems, but does confuse LGTM, and was using the `abc` module incorrectly. This uses python3-only features of the abc module, so can't be backported.
* Merge pull request #12239 from daten-kieker/polyval_2477Marten van Kerkwijk2019-01-041-1/+14
|\ | | | | BUG: polyval returned non-masked arrays for masked input.
| * BUG: polyval returned Non-Masked Arrays for Masked Input.Joachim Hereth2018-10-211-1/+14
| | | | | | | | | | | | | | | | 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.
* | TST, DOC: enable refguide_checkTyler Reddy2018-12-147-141/+144
| | | | | | | | | | | | | | | | * 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