def test_phi_g5(): xs.xs_cache.clear() E_g = np.array([0.0, 4.0, 10.0]) E_n = np.array([0.0, 2.5, 5.0, 7.5, 10.0]) phi_n = np.ones(4) phi_g = xs.phi_g(E_g, E_n, phi_n) expected = np.array([1.6, 2.4]) assert_array_equal(phi_g, expected)
def test_phi_g2(): xs.xs_cache.clear() E_g = np.array([0.0, 5.0, 10.0]) E_n = np.array([0.0, 5.0, 10.0]) phi_n = np.ones(2) phi_g = xs.phi_g(E_g, E_n, phi_n) expected = np.array([1.0, 1.0]) assert_array_equal(phi_g, expected)
def test_phi_g7(): xs.xs_cache.clear() E_g = np.array([0.0, 4.0, 8.0]) E_n = np.array([0.0, 2.5, 5.0, 7.5, 10.0]) phi_n = np.array([0.0, 2.0, 1.0, 0.5]) phi_g = xs.phi_g(E_g, E_n, phi_n) expected = np.array([1.2, 1.9]) # Floating point error here requires 'alomst' equal assert_array_almost_equal(phi_g, expected)