def test__nondim_tec_spitzer(Z): """test _nondim_tec_spitzer function""" beta = _nondim_tec_spitzer(Z) if Z == 1: beta_check = 0.699 rtol = 1e-3 elif Z in [2, 4, np.inf]: beta_check = _nondim_tec_braginskii(0, Z, "par") rtol = 2e-2 elif Z == 16: beta_check = _nondim_tec_ji_held(0, Z, "par") rtol = 2e-2 assert np.isclose(beta, beta_check, rtol=rtol)
def test_cross_vs_ji_held(self, Z): """cross should roughly agree with ji-held""" beta_hat_cross_brag = _nondim_tec_braginskii(self.big_hall, Z, "cross") beta_hat_cross_jh = _nondim_tec_ji_held(self.big_hall, Z, "cross") assert np.isclose(beta_hat_cross_brag, beta_hat_cross_jh, rtol=3e-2)
def test__nondim_tec_ji_held(hall, Z, field_orientation, expected): """test _nondim_tec_ji_held function""" beta_hat = _nondim_tec_ji_held(hall, Z, field_orientation) beta_check = expected assert np.isclose(beta_hat, beta_check, rtol=2e-2)