diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2017-10-26 12:45:29 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2017-10-26 13:26:29 -0600 |
commit | 8f3ee77dd2848640b5a5e7134729bc488f5c315f (patch) | |
tree | bdefb6938a4d1efc9e0cc22bd92d61e72928d7d3 /numpy/polynomial/polynomial.py | |
parent | 1e494f1e283340d545b1c7c15dded04a4aaae939 (diff) | |
download | numpy-8f3ee77dd2848640b5a5e7134729bc488f5c315f.tar.gz |
MAINT: Add parameter checks to polynomial integration functions.
It was not being checked that the `lbnd` and `scl` parameters were
scalars as required.
Closes #9901.
Diffstat (limited to 'numpy/polynomial/polynomial.py')
-rw-r--r-- | numpy/polynomial/polynomial.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py index 1be775f6a..a71e5b549 100644 --- a/numpy/polynomial/polynomial.py +++ b/numpy/polynomial/polynomial.py @@ -608,7 +608,8 @@ def polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0): Raises ------ ValueError - If ``m < 1``, ``len(k) > m``. + If ``m < 1``, ``len(k) > m``, ``np.ndim(lbnd) != 0``, or + ``np.ndim(scl) != 0``. See Also -------- @@ -654,6 +655,10 @@ def polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0): raise ValueError("The order of integration must be non-negative") if len(k) > cnt: raise ValueError("Too many integration constants") + if np.ndim(lbnd) != 0: + raise ValueError("lbnd must be a scalar.") + if np.ndim(scl) != 0: + raise ValueError("scl must be a scalar.") if iaxis != axis: raise ValueError("The axis must be integer") iaxis = normalize_axis_index(iaxis, c.ndim) |