feat!: Renames to pyewjn
All checks were successful
gitea-physics/pyewjn/pipeline/head This commit looks good
All checks were successful
gitea-physics/pyewjn/pipeline/head This commit looks good
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import pynam.dielectric
|
||||
import pyewjn.dielectric
|
||||
import numpy as np
|
||||
import pytest
|
||||
from pynam.baskets import CalculationParams
|
||||
from pyewjn.baskets import CalculationParams
|
||||
|
||||
|
||||
def get_common_lindhard_dielectric():
|
||||
params = CalculationParams(omega=1e9, omega_p=3.5e15, tau=1e-14, v_f=2e6)
|
||||
return pynam.dielectric.get_lindhard_dielectric(params)
|
||||
return pyewjn.dielectric.get_lindhard_dielectric(params)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -52,4 +52,4 @@ def zeta_p_i_epsilon():
|
||||
params = CalculationParams(
|
||||
omega=1e9, omega_p=3.544907701811032e15, tau=1e-14, v_f=2e6
|
||||
)
|
||||
return pynam.dielectric.get_lindhard_dielectric(params)
|
||||
return pyewjn.dielectric.get_lindhard_dielectric(params)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import pynam.dielectric.low_k_nam
|
||||
import pyewjn.dielectric.low_k_nam
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
@@ -9,7 +9,7 @@ import pytest
|
||||
)
|
||||
def test_g(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.low_k_nam.g(*test_input),
|
||||
pyewjn.dielectric.low_k_nam.g(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="g function is off",
|
||||
@@ -22,7 +22,7 @@ def test_g(test_input, expected):
|
||||
)
|
||||
def test_f(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.low_k_nam.f(*test_input),
|
||||
pyewjn.dielectric.low_k_nam.f(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="f function is off",
|
||||
@@ -35,7 +35,7 @@ def test_f(test_input, expected):
|
||||
)
|
||||
def test_i1(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.low_k_nam.i1(*test_input),
|
||||
pyewjn.dielectric.low_k_nam.i1(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="i1 function is off",
|
||||
@@ -48,7 +48,7 @@ def test_i1(test_input, expected):
|
||||
)
|
||||
def test_i2(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.low_k_nam.i2(*test_input),
|
||||
pyewjn.dielectric.low_k_nam.i2(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="i1 function is off",
|
||||
@@ -62,7 +62,7 @@ def test_i2(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_a(test_input, expected):
|
||||
actual = np.real_if_close(pynam.dielectric.low_k_nam.a(*test_input))
|
||||
actual = np.real_if_close(pyewjn.dielectric.low_k_nam.a(*test_input))
|
||||
np.testing.assert_almost_equal(
|
||||
actual, expected, decimal=6, err_msg="a function is off"
|
||||
)
|
||||
@@ -76,7 +76,7 @@ def test_a(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_b_int(test_input, expected):
|
||||
actual = np.real_if_close(pynam.dielectric.low_k_nam.b_int(*test_input))
|
||||
actual = np.real_if_close(pyewjn.dielectric.low_k_nam.b_int(*test_input))
|
||||
np.testing.assert_almost_equal(
|
||||
actual, expected, decimal=6, err_msg="b int function is off"
|
||||
)
|
||||
@@ -90,7 +90,7 @@ def test_b_int(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_b(test_input, expected):
|
||||
actual = np.real_if_close(pynam.dielectric.low_k_nam.b(*test_input))
|
||||
actual = np.real_if_close(pyewjn.dielectric.low_k_nam.b(*test_input))
|
||||
np.testing.assert_almost_equal(
|
||||
actual, expected, decimal=6, err_msg="b function is off"
|
||||
)
|
||||
@@ -104,14 +104,14 @@ def test_b(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_sigma_alk(test_input, expected):
|
||||
actual = np.real_if_close(pynam.dielectric.low_k_nam.sigma_nam_alk(*test_input))
|
||||
actual = np.real_if_close(pyewjn.dielectric.low_k_nam.sigma_nam_alk(*test_input))
|
||||
np.testing.assert_almost_equal(
|
||||
actual, expected, decimal=6, err_msg="b function is off"
|
||||
)
|
||||
|
||||
|
||||
def test_sigma_alk_benchmark(benchmark):
|
||||
result = benchmark(pynam.dielectric.low_k_nam.sigma_nam_alk, 1, 2, 3, 4)
|
||||
result = benchmark(pyewjn.dielectric.low_k_nam.sigma_nam_alk, 1, 2, 3, 4)
|
||||
np.testing.assert_almost_equal(
|
||||
result, 0.98358 + 0.648221j, decimal=6, err_msg="b function is off"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
import numpy as np
|
||||
import pynam.dielectric.nam_dielectric_coefficient_approximator
|
||||
from pynam.baskets import CalculationParams
|
||||
import pyewjn.dielectric.nam_dielectric_coefficient_approximator
|
||||
from pyewjn.baskets import CalculationParams
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -24,7 +24,7 @@ from pynam.baskets import CalculationParams
|
||||
],
|
||||
)
|
||||
def test_dedimensionalise_parameters(test_input, expected):
|
||||
actual_parameters = pynam.dielectric.nam_dielectric_coefficient_approximator.get_dedimensionalised_parameters(
|
||||
actual_parameters = pyewjn.dielectric.nam_dielectric_coefficient_approximator.get_dedimensionalised_parameters(
|
||||
*test_input
|
||||
)
|
||||
|
||||
@@ -72,7 +72,7 @@ def test_dedimensionalise_parameters(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_nam_coefficients(test_input, expected):
|
||||
actual_coefficients = pynam.dielectric.nam_dielectric_coefficient_approximator.get_nam_dielectric_coefficients(
|
||||
actual_coefficients = pyewjn.dielectric.nam_dielectric_coefficient_approximator.get_nam_dielectric_coefficients(
|
||||
*test_input
|
||||
)
|
||||
|
||||
@@ -112,7 +112,7 @@ def test_nam_coefficients(test_input, expected):
|
||||
def test_nam_eps():
|
||||
u_c = 1e15
|
||||
eps_to_test = (
|
||||
pynam.dielectric.nam_dielectric_coefficient_approximator.get_nam_dielectric(
|
||||
pyewjn.dielectric.nam_dielectric_coefficient_approximator.get_nam_dielectric(
|
||||
u_c,
|
||||
CalculationParams(
|
||||
omega=1e9, omega_p=3.54491e15, tau=1e-14, v_f=2e6, t_rel=0.8, t_c=1e11
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import pynam.dielectric.sigma_nam
|
||||
import pyewjn.dielectric.sigma_nam
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
@@ -9,7 +9,7 @@ import pytest
|
||||
)
|
||||
def test_g(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.sigma_nam.g(*test_input),
|
||||
pyewjn.dielectric.sigma_nam.g(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="g function is off",
|
||||
@@ -21,7 +21,7 @@ def test_g(test_input, expected):
|
||||
)
|
||||
def test_s(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.sigma_nam.s(*test_input),
|
||||
pyewjn.dielectric.sigma_nam.s(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="s function is off",
|
||||
@@ -41,7 +41,7 @@ def test_s(test_input, expected):
|
||||
)
|
||||
def test_f(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.sigma_nam.f(*test_input),
|
||||
pyewjn.dielectric.sigma_nam.f(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="f function is off",
|
||||
@@ -62,7 +62,7 @@ def test_f(test_input, expected):
|
||||
)
|
||||
def test_i1(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.sigma_nam.i1(*test_input),
|
||||
pyewjn.dielectric.sigma_nam.i1(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="i1 function is off",
|
||||
@@ -83,7 +83,7 @@ def test_i1(test_input, expected):
|
||||
)
|
||||
def test_i2(test_input, expected):
|
||||
np.testing.assert_almost_equal(
|
||||
pynam.dielectric.sigma_nam.i2(*test_input),
|
||||
pyewjn.dielectric.sigma_nam.i2(*test_input),
|
||||
expected,
|
||||
decimal=7,
|
||||
err_msg="i1 function is off",
|
||||
@@ -101,7 +101,7 @@ def test_i2(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_a(test_input, expected):
|
||||
actual = np.real_if_close(pynam.dielectric.sigma_nam.a(*test_input))
|
||||
actual = np.real_if_close(pyewjn.dielectric.sigma_nam.a(*test_input))
|
||||
np.testing.assert_allclose(actual, expected, rtol=1e-5, err_msg="a function is off")
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ def test_a(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_b_int(test_input, expected):
|
||||
actual = np.real_if_close(pynam.dielectric.sigma_nam.b_int(*test_input))
|
||||
actual = np.real_if_close(pyewjn.dielectric.sigma_nam.b_int(*test_input))
|
||||
np.testing.assert_almost_equal(
|
||||
actual, expected, decimal=6, err_msg="b int function is off"
|
||||
)
|
||||
@@ -131,7 +131,7 @@ def test_b_int(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_b(test_input, expected):
|
||||
actual = np.real_if_close(pynam.dielectric.sigma_nam.b(*test_input))
|
||||
actual = np.real_if_close(pyewjn.dielectric.sigma_nam.b(*test_input))
|
||||
np.testing.assert_almost_equal(
|
||||
actual, expected, decimal=6, err_msg="b function is off"
|
||||
)
|
||||
@@ -149,14 +149,14 @@ def test_b(test_input, expected):
|
||||
],
|
||||
)
|
||||
def test_sigma_nam(test_input, expected):
|
||||
actual = np.real_if_close(pynam.dielectric.sigma_nam.sigma_nam(*test_input))
|
||||
actual = np.real_if_close(pyewjn.dielectric.sigma_nam.sigma_nam(*test_input))
|
||||
np.testing.assert_allclose(
|
||||
actual, expected, rtol=1e-3, err_msg="sigma_nam function is off"
|
||||
)
|
||||
|
||||
|
||||
def test_sigma_nam_benchmark(benchmark):
|
||||
result = benchmark(pynam.dielectric.sigma_nam.sigma_nam, 1, 2, 3, 4)
|
||||
result = benchmark(pyewjn.dielectric.sigma_nam.sigma_nam, 1, 2, 3, 4)
|
||||
np.testing.assert_almost_equal(
|
||||
result,
|
||||
0.984117 + 0.647951j,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
import pynam.dielectric
|
||||
import pynam.noise.chi
|
||||
from pynam.baskets import CalculationParams
|
||||
import pyewjn.dielectric
|
||||
import pyewjn.noise.chi
|
||||
from pyewjn.baskets import CalculationParams
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -11,8 +11,8 @@ def chi_zz_e_lindhard():
|
||||
params = CalculationParams(
|
||||
omega=1e9, v_f=2e6, omega_p=3.544907701811032e15, tau=1e-14
|
||||
)
|
||||
eps_l = pynam.dielectric.get_lindhard_dielectric(params)
|
||||
return pynam.noise.chi.get_chi_zz_e(eps_l)
|
||||
eps_l = pyewjn.dielectric.get_lindhard_dielectric(params)
|
||||
return pyewjn.noise.chi.get_chi_zz_e(eps_l)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
import pynam.dielectric
|
||||
import pynam.noise.im_ref
|
||||
from pynam.baskets import CalculationParams
|
||||
import pyewjn.dielectric
|
||||
import pyewjn.noise.im_ref
|
||||
from pyewjn.baskets import CalculationParams
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -11,8 +11,8 @@ def im_ref_p_lindhard():
|
||||
params = CalculationParams(
|
||||
omega=1e9, v_f=2e6, omega_p=3.544907701811032e15, tau=1e-14
|
||||
)
|
||||
eps_l = pynam.dielectric.get_lindhard_dielectric(params)
|
||||
return pynam.noise.im_ref.get_im_ref_p(eps_l)
|
||||
eps_l = pyewjn.dielectric.get_lindhard_dielectric(params)
|
||||
return pyewjn.noise.im_ref.get_im_ref_p(eps_l)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
import pynam.dielectric
|
||||
import pynam.noise.zeta
|
||||
from pynam.baskets import CalculationParams
|
||||
import pyewjn.dielectric
|
||||
import pyewjn.noise.zeta
|
||||
from pyewjn.baskets import CalculationParams
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -11,8 +11,8 @@ def zeta_p_integrand_lindhard():
|
||||
params = CalculationParams(
|
||||
omega=1e9, v_f=2e6, omega_p=3.544907701811032e15, tau=1e-14
|
||||
)
|
||||
eps_l = pynam.dielectric.get_lindhard_dielectric(params)
|
||||
return pynam.noise.zeta.get_zeta_p_integrand(eps_l)
|
||||
eps_l = pyewjn.dielectric.get_lindhard_dielectric(params)
|
||||
return pyewjn.noise.zeta.get_zeta_p_integrand(eps_l)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -41,8 +41,8 @@ def zeta_p_lindhard():
|
||||
params = CalculationParams(
|
||||
omega=1e9, v_f=2e6, omega_p=3.544907701811032e15, tau=1e-14
|
||||
)
|
||||
eps_l = pynam.dielectric.get_lindhard_dielectric(params)
|
||||
return pynam.noise.zeta.get_zeta_p_function(eps_l)
|
||||
eps_l = pyewjn.dielectric.get_lindhard_dielectric(params)
|
||||
return pyewjn.noise.zeta.get_zeta_p_function(eps_l)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from pynam import __version__
|
||||
from pyewjn import __version__
|
||||
|
||||
|
||||
def test_version():
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import numpy as np
|
||||
import pynam.util.complex_integrate
|
||||
import pyewjn.util.complex_integrate
|
||||
|
||||
|
||||
def test_complex_quad():
|
||||
actual = pynam.util.complex_integrate.complex_quad(
|
||||
actual = pyewjn.util.complex_integrate.complex_quad(
|
||||
lambda x: x**2 + 1j * x**3, 0, 6
|
||||
)[0]
|
||||
# int_1^6 dx x^2 + i x^3 should equal (1/3)6^3 + (i/4)6^4
|
||||
@@ -17,7 +17,7 @@ def test_complex_quad():
|
||||
|
||||
|
||||
def test_complex_quadrature():
|
||||
actual = pynam.util.complex_integrate.complex_quadrature(
|
||||
actual = pyewjn.util.complex_integrate.complex_quadrature(
|
||||
lambda x: x**2 + 1j * x**3, 0, 6
|
||||
)[0]
|
||||
# int_1^6 dx x^2 + i x^3 should equal (1/3)6^3 + (i/4)6^4
|
||||
|
||||
Reference in New Issue
Block a user