feat!: Renames to pyewjn
All checks were successful
gitea-physics/pyewjn/pipeline/head This commit looks good

This commit is contained in:
2022-03-28 19:08:35 -05:00
parent 40adf494d6
commit 071cd2503e
28 changed files with 88 additions and 88 deletions

View File

@@ -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)

View File

@@ -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"
)

View File

@@ -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

View File

@@ -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,