summaryrefslogtreecommitdiff
path: root/numpy/polynomial/_polybase.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Chain exceptions in "_polybase.py" (#17453)Sahil Siddiq2020-10-071-4/+4
| | | * Removed "from" keyword and changed "raise e" to "raise"
* MAINT: Remove nickname from polynomial classes. (gh-16589)Ross Barnowski2020-07-081-5/+0
| | | | | | | | | | | | | | | | * MAINT: Remove nickname from polynomial classes. The convenience classes derived from ABCPolyBase had a nickname attribute that was only used internally in the previous implementation of __str__. After the overhaul of __str__ in #15666, this attr is no longer used. * DOC: Add release note. Add release note to notify users of removal of the abstract property, and highlight users that may be affected by the change. * DOC: fixed rST in release note
* DOC: add the number of sample points as suggestedWojciech Rzadkowski2020-06-081-1/+1
| | | Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* DOC: expand the docstring as suggested in reviewWojciech Rzadkowski2020-06-051-1/+1
| | | Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* DOC: mention only single-polynomial fitting in np.polynomial.Polynomial.fit()Wojciech Rzadkowski2020-06-051-4/+2
|
* STY: Move comment outside of try/except.Ross Barnowski2020-05-131-3/+3
|
* Handle TypeError in _generate_str for coefs.Ross Barnowski2020-05-131-3/+9
| | | | | | 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-071-3/+107
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge pull request #15434 from notanton/maintenance-fstringsCharles Harris2020-01-261-24/+18
|\ | | | | MAINT: Updated polynomial to use fstrings
| * Updated files in polynomial/ to use fstringsAnton Ritter-Gogerly2020-01-271-24/+18
| |
* | MAINT: Remove Python2 workaroundsSeth Troisi2020-01-231-4/+0
|/
* 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: 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.
* MAINT: remove surviving, unused, list comprehension (#11843)Jeff2018-09-031-7/+0
| | | | | | This variable is never used, and shows signs of being leftover from a previous implementation. Introduced in gh-11528. Closes gh-11842
* Merge pull request #11850 from jeffyancey/update-polybase-commentCharles Harris2018-08-311-1/+1
|\ | | | | DOC: add comment to remove fn after python 2 support is dropped
| * DOC: closes #11845Jeffrey Yancey2018-08-311-1/+1
| |
* | DOC: Polybase augmented assignment notes (#11806)Jeff2018-08-261-4/+1
|/ | | | | | | | | | | | | | * Add augmented assignment for supported operations Add augmented assignments for `+=`, `-=`, `*=`, `/=`, `%=`, and `**=`. * correct idiv and imod * remove augomented operationa. add notes. Explicitly state the intention that all instances of a polynomial baseclass are immutable. * fix typo, remove Note from _polybase
* DOC: Small docstring fixes for old polyfit.Charles Harris2018-08-151-1/+1
| | | | | * Remove misleading reference to numpy/polynomial/polynomial/polyfit. * Add missing period in numpy/polynomial/_polybase.py
* DOC: recommend polynomial.Polynomial over np.polyfit (#11733)Matti Picus2018-08-141-1/+3
| | | | | | | | | | * DOC: reccomend polynomail.Polynomial over np.polyfit * update from review * update from review, fix links * fix from review
* ENH: Add support for ipython latex printing to polynomialEric Wieser2018-08-121-2/+89
| | | | | | | | | | | | | | | Choices made, and the alternatives rejected (for no particularly strong reason): 1. Show terms in ascending order, to match their internal representation * alternative: descending, to match convention 2. Shows 0 terms in gray * alternative: omit entirely * alternative: show normally to aid comparison 3. Write each term as `basis(ax + b) * alternative: write as `basis(u) ... where u = ax + b` * alternative: show the normalized polynomial In future it would perhaps make sense to expose these options to the end user
* ENH: Show domain and window as kwargs in reprEric Wieser2017-08-101-1/+1
| | | | Also, update the docs with this new repr
* BUG: Only propagate TypeError from where we throw itEric Wieser2017-06-031-11/+5
|
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-8/+8
| | | | Bare except is very rarely the right thing
* ENH: Use `__array_ufunc__ = None` in polynomial convenience classes.Charles Harris2017-04-271-2/+2
| | | | | | | | Add `__array_ufunc__ = None` to ABCPolyBase. This ensures that polynomial convenience classes will not participate in ufuncs and will have priority when combined with an ndarray in a Python binary operator. `__array_priority__` is removed, as it is no longer needed.
* DOC: change version references from x.y to x.y.zPierre de Buyl2016-09-071-1/+1
|
* DOC: change Numpy to NumPy in dosctrings and commentsPierre de Buyl2016-09-061-1/+1
| | | | The strings in error messages were left untouched
* DOC: Fix some incorrect RST definition listsEndolith2016-05-111-2/+2
|
* MAINT: Refactor polynomial leastsquares fits.Charles Harris2016-01-191-8/+5
| | | | | | | * Rewrite the documentation for `deg`. * Check that the passed degrees are int and raise if not. * Do not accept `deg` arguments that do not convert as 0-D or 1-D. * Sort passed degree terms for repeatability.
* ENH: Allow specification of terms to fit in fit methodJonathan Underwood2016-01-181-2/+8
|
* DOC: Polynomial.deriv refers to integrations, not differentiationsAndrew Nelson2015-06-101-1/+1
|
* STY: PEP8 fixes for files in numpy/polynomial.Charles Harris2014-07-291-3/+1
| | | | | The rather lax standards used in scipy were used to identify the needed style fixups.
* MAINT: Comparison deprecation followup fixesSebastian Berg2014-05-041-2/+3
| | | | | | | 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.
* MAINT: Refactor numpy/polynomial/_polybase.pyCharles Harris2014-05-031-121/+100
| | | | | | | | | | 1) Clean up the code and move repeated snippet to a method. 2) Remove use of has_sametype, has_samewindow, has_samedomain. I would like to deprecate those methods. 3) Fix error in __truediv__, and make it only allow non-boolean numbers for the denominator. Closes #4631.
* DOC: Fixup documentation for new way of generating classes.Charles Harris2014-03-261-195/+171
| | | | | | | | | | Move the class documentation to the place of definition in the appropriate module. This allow for documenting the specific series kind along with the series specific default domains and windows Remove template placeholders from the ABCPolyBase class documention. General fixup of documentation that rendered poorly.
* ENH, MAINT: Use an abstract base class for the polynomial classes.Charles Harris2014-03-261-0/+1008
The new base is ABCPolyBase and is intended to replace the use of the polytemplate string. In this way the need to compile the polynomial classes on import is avoided. Closes #634. Closes #3639.