Skip to content

Fix flake8 error lambda functions (E731) by importing erfc from scipy #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/diffpy/srfit/pdf/characteristicfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from numpy import arctanh as atanh
from numpy import ceil, exp, log, log2, pi, sign, sqrt
from numpy.fft import fftfreq, ifft
from scipy.special import erf
from scipy.special import erfc
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erf was imported to calculate erfc but erfc is provided


from diffpy.srfit.fitbase.calculator import Calculator

Expand Down Expand Up @@ -198,8 +198,6 @@ def lognormalSphericalCF(r, psize, psig):
if psig <= 0:
return sphericalCF(r, psize)

erfc = lambda x: 1.0 - erf(x)

sqrt2 = sqrt(2.0)
s = sqrt(log(psig * psig / (1.0 * psize * psize) + 1))
mu = log(psize) - s * s / 2
Expand Down