| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
| |
Numpydoc format says that the colon need o be omitted if there is no
type, there were also some empty Examples Sections
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
These deprecations already happen inside `vanderf`, so don't need to be repeated here.
|
| |
|
| |
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
These functions are all the same - the algorithm used does not care about the basis.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
No point writing the same function 12 times, when you can write it once
|
|
|
|
|
|
| |
Every implementation is the same right now, other than calling different line / mul functions.
Found by LGTM.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|\
| |
| | |
MAINT: Don't internally use the one-argument where
|
| |
| |
| |
| | |
nonzero is a clearer spelling
|
|/
|
|
| |
Bare except is very rarely the right thing
|
| |
|
|
|
|
|
| |
Fixed typos in docstrings were updated for functions where the parameter
names in the docstring didn't match the function signature.
|
|
|
|
| |
Detected by pyflakes.
|
|
|
|
|
| |
The rather lax standards used in scipy were used to identify the
needed style fixups.
|
|
|
|
| |
Also note that PolyBase is no longer to be used.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|
|\
| |
| | |
DOC: Formatting fixes using regex
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
the documentation. Fixes ticket #1554.
|
| |
|
| |
|
| |
|
| |
|
|
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.
|