adds more type hinting
All checks were successful
gitea-physics/pysuperconductor/pipeline/head This commit looks good

This commit is contained in:
Deepak Mallubhotla 2020-11-24 12:52:50 -06:00
parent 5bb3a2163f
commit 346caf3ea0
Signed by: deepak
GPG Key ID: 64BF53A3369104E7

View File

@ -51,7 +51,9 @@ def find_gap(
# this is n * Delta_0, calling it n in this file for brevity
def n_integrand_function(xi, temp, delta, mu_star):
def n_integrand_function(
xi: float, temp: float, delta: float, mu_star: float
) -> float:
big_e = energy(xi, delta)
left = 1 / (1 + numpy.exp((big_e - mu_star) / temp))
right = 1 / (1 + numpy.exp(big_e / temp))
@ -59,8 +61,8 @@ def n_integrand_function(xi, temp, delta, mu_star):
# as above, this is brevity n * Delta_0
def n_integral(temp, delta, mu_star):
def integrand(xi):
def n_integral(temp: float, delta: float, mu_star: float) -> float:
def integrand(xi: float) -> float:
return n_integrand_function(xi, temp, delta, mu_star)
intermediate = 20 * numpy.sqrt(delta ** 2 + mu_star ** 2)
lower = integrate.quad(integrand, 0, intermediate)[0]