Skip to content

Commit

Permalink
fix nonzero deprecation warnings (#814)
Browse files Browse the repository at this point in the history
Co-authored-by: Pieter Eendebak <[email protected]>
  • Loading branch information
peendebak and eendebakpt authored Oct 23, 2022
1 parent 1d860dd commit 86a2bdc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lmfit/lineshapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ def step(x, amplitude=1.0, center=0.0, sigma=1.0, form='linear'):
out = 0.5 + arctan(out)/pi
elif form == 'linear':
out = out + 0.5
out[where(out < 0)] = 0.0
out[where(out > 1)] = 1.0
out[out < 0] = 0.0
out[out > 1] = 1.0
else:
msg = (f"Invalid value ('{form}') for argument 'form'; should be one "
"of 'erf', 'logistic', 'atan', 'arctan', or 'linear'.")
Expand Down Expand Up @@ -475,10 +475,10 @@ def rectangle(x, amplitude=1.0, center1=0.0, sigma1=1.0,
elif form in ('atan', 'arctan'):
out = (arctan(arg1) + arctan(arg2))/pi
elif form == 'linear':
arg1[where(arg1 < 0)] = 0.0
arg1[where(arg1 > 1)] = 1.0
arg2[where(arg2 > 0)] = 0.0
arg2[where(arg2 < -1)] = -1.0
arg1[arg1 < 0] = 0.0
arg1[arg1 > 1] = 1.0
arg2[arg2 > 0] = 0.0
arg2[arg2 < -1] = -1.0
out = arg1 + arg2
else:
msg = (f"Invalid value ('{form}') for argument 'form'; should be one "
Expand Down

0 comments on commit 86a2bdc

Please sign in to comment.