summaryrefslogtreecommitdiff
path: root/numpy/polynomial/polyutils.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: limit the number of decimals in Polynomial representation (#21654)Lev Maximov2022-06-141-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* DOC: Do not leave space between directive name and double colon.Matthias Bussonnier2021-11-031-2/+2
| | | | | | | | | | | 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.
* 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.
* DOC: cleanup of numpy/polynomial.Matthias Bussonnier2021-01-281-9/+9
| | | | | Numpydoc format says that the colon need o be omitted if there is no type, there were also some empty Examples Sections
* MAINT: Prefer generator expressions over list comprehensionsLukas Geiger2020-06-211-2/+2
|
* Added some chained exceptionsChris Holland2020-04-231-4/+4
|
* Updated files in polynomial/ to use fstringsAnton Ritter-Gogerly2020-01-271-6/+5
|
* MAINT: Ragged cleanup (#15085)Matti Picus2020-01-151-7/+5
| | | | | | | | | | | | * 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-051-1/+1
| | | | | | | 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-031-2/+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-141-29/+74
| | | | | | | | 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.
* add missing import warningspatto902019-07-131-0/+1
|
* MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-011-4/+4
|
* MAINT: Unify polynomial power functionsEric Wieser2019-03-161-0/+33
| | | | | | 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
* DEP: polynomial: Be stricter about integral argumentsEric Wieser2019-03-161-10/+48
| | | | | | | | | | | | | | | | | | | 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-151-0/+88
| | | | | | | | | | 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-141-0/+27
| | | | These functions are all the same - the algorithm used does not care about the basis.
* MAINT: Unify polynomial division functionsEric Wieser2019-03-121-0/+36
| | | | | | 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: Unify polynomial valnd functionsEric Wieser2019-03-121-0/+48
| | | | 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-111-0/+30
| | | | | | 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-021-0/+49
| | | | | | | 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.
* TST, DOC: enable refguide_checkTyler Reddy2018-12-141-15/+15
| | | | | | | | * 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
* DOC: Add polyutils subpackage to reference documentation [skip ci]Michael Seifert2017-09-231-14/+23
|
* Merge pull request #9214 from eric-wieser/no-one-arg-whereCharles Harris2017-06-031-1/+1
|\ | | | | MAINT: Don't internally use the one-argument where
| * MAINT: Don't internally use the one-argument whereEric Wieser2017-06-031-1/+1
| | | | | | | | nonzero is a clearer spelling
* | BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-1/+1
|/ | | | Bare except is very rarely the right thing
* MAINT: Fix typos in docs/comment of `ma` and `polynomial` modules.Dongjoon Hyun2016-02-191-2/+2
|
* DOC: Reconcile docstrings and function signatures where they disagreeRobert McGibbon2015-03-021-1/+1
| | | | | Fixed typos in docstrings were updated for functions where the parameter names in the docstring didn't match the function signature.
* MAINT: Remove unused variables and imports in numpy/polynomial/*.py.Charles Harris2014-07-291-4/+2
| | | | Detected by pyflakes.
* STY: PEP8 fixes for files in numpy/polynomial.Charles Harris2014-07-291-32/+32
| | | | | The rather lax standards used in scipy were used to identify the needed style fixups.
* DOC: Cleanup polyutils.py module documentation.Charles Harris2014-03-261-18/+39
| | | | Also note that PolyBase is no longer to be used.
* MAINT: Remove unneeded version checks.Charles Harris2013-04-241-10/+0
| | | | | | Now that only Python versions 2.6-2.7 and 3.2-3.3 are supported some version checks are no longer needed. This patch removes them so as to clean up the code.
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* Merge pull request #460 from endolith/regex_formattingCharles Harris2013-04-031-1/+1
|\ | | | | DOC: Formatting fixes using regex
| * DOC: regex-assisted fixes of definition list formattingendolith2013-03-191-1/+1
| |
* | 2to3: Use absolute imports.Charles Harris2013-03-281-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* SPELL: Spellcheck the modules. Clarify an example.Charles Harris2012-01-091-2/+2
|
* BUG: Make mapdomain work for multidimensional arrays as advertized inCharles Harris2010-08-111-6/+7
| | | | the documentation. Fixes ticket #1554.
* more docstring updates from pydoc website (thanks to everyone who contributed!)Jarrod Millman2010-02-171-64/+173
|
* 3K: polynomial: exceptions module is removedPauli Virtanen2009-12-061-1/+1
|
* Small cleanups in polynomial modules.Charles Harris2009-11-281-6/+8
|
* Add any function for python < 2.5.Charles Harris2009-11-151-0/+9
|
* Add support for chebyshev series and polynomials.Charles Harris2009-11-141-0/+273
New modules chebyshev and polynomial are added. The new polynomial module is not compatible with the current polynomial support in numpy, but is much like the new chebyshev module. The most noticeable difference to most will be that coefficients are specified from low to high power, that the low level functions do *not* accept the Chebyshev and Polynomial classes as arguements, and that the Chebyshev and Polynomial classes include a domain. Mapping between domains is a linear substitution and the two classes can be converted one to the other, allowing, for instance, a Chebyshev series in one domain to be expanded as a polynomial in another domain. The new modules are not automatically imported into the numpy namespace, they must be explicitly brought in with a "import numpy.polynomial" statement.