summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-05-19 13:17:21 -0600
committerGitHub <noreply@github.com>2021-05-19 13:17:21 -0600
commit5bc6926d063866731cbe568366137f9e12182648 (patch)
tree4ae737c766674cad4d497cf4d5b558d3bf76c3a0 /numpy/lib/function_base.py
parentf4c2d090045004a28a7776e5eb2a156a1295f3be (diff)
downloadnumpy-5bc6926d063866731cbe568366137f9e12182648.tar.gz
STY: Break long lines
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 83786adfd..d1d33b321 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -1495,9 +1495,10 @@ def unwrap(p, discont=None, axis=-1, *, period=2*pi):
difference from their predecessor of more than ``max(discont, period/2)``
to their `period`-complementary values.
- For the default case where `period` is :math:`2\pi` and is `discont` is :math:`\pi`,
- this unwraps a radian phase `p` such that adjacent differences are never
- greater than :math:`\pi` by adding :math:`2k\pi` for some integer :math:`k`.
+ For the default case where `period` is :math:`2\pi` and is `discont` is
+ :math:`\pi`, this unwraps a radian phase `p` such that adjacent differences
+ are never greater than :math:`\pi` by adding :math:`2k\pi` for some
+ integer :math:`k`.
Parameters
----------
@@ -1505,12 +1506,14 @@ def unwrap(p, discont=None, axis=-1, *, period=2*pi):
Input array.
discont : float, optional
Maximum discontinuity between values, default is ``period/2``.
- Values below ``period/2`` are treated as if they were ``period/2``. To have an effect
- different from the default, `discont` should be larger than ``period/2``.
+ Values below ``period/2`` are treated as if they were ``period/2``.
+ To have an effect different from the default, `discont` should be
+ larger than ``period/2``.
axis : int, optional
Axis along which unwrap will operate, default is the last axis.
period: float, optional
- Size of the range over which the input wraps. By default, it is ``2 pi``.
+ Size of the range over which the input wraps. By default, it is
+ ``2 pi``.
.. versionadded:: 1.21.0
@@ -1567,9 +1570,11 @@ def unwrap(p, discont=None, axis=-1, *, period=2*pi):
interval_low = -interval_high
ddmod = mod(dd - interval_low, period) + interval_low
if boundary_ambiguous:
- # for `mask = (abs(dd) == period/2)`, the above line made `ddmod[mask] == -period/2`.
- # correct these such that `ddmod[mask] == sign(dd[mask])*period/2`.
- _nx.copyto(ddmod, interval_high, where=(ddmod == interval_low) & (dd > 0))
+ # for `mask = (abs(dd) == period/2)`, the above line made
+ # `ddmod[mask] == -period/2`. correct these such that
+ # `ddmod[mask] == sign(dd[mask])*period/2`.
+ _nx.copyto(ddmod, interval_high,
+ where=(ddmod == interval_low) & (dd > 0))
ph_correct = ddmod - dd
_nx.copyto(ph_correct, 0, where=abs(dd) < discont)
up = array(p, copy=True, dtype=dtype)