def test_defect_energy_cross_points(defect_energy): actual = defect_energy.cross_points(1, 6) expected = CrossPoints([[5.0, 6.0]], [[1.0, -2.0], [6.0, 6.0]]) assert actual == expected actual = defect_energy.cross_points(1, 6, 1) expected = CrossPoints([[4.0, 6.0]], [[0.0, -2.0], [5.0, 6.0]]) assert actual == expected
def test_cross_points_dicts(): charge_energies = ChargeEnergies( charge_energies_dict={"Va_Mg": SingleChargeEnergies([(0, 2.0)]), "Va_O": SingleChargeEnergies([(1, 1.0)])}, e_min=0.0, e_max=2.0) actual = charge_energies.cross_point_dicts expected = {"Va_Mg": CrossPoints(inner_cross_points=[], boundary_points=[[0.0, 2.0], [2.0, 2.0]]), "Va_O": CrossPoints(inner_cross_points=[], boundary_points=[[0.0, 1.0], [2.0, 3.0]])} assert actual == expected
def cross_points(): inner_cross_points = [[2, 30], [3, 40]] boundary_points = [[1, 10], [4, 40]] return CrossPoints(inner_cross_points, boundary_points)
def test_charge_energies_cross_points(charge_energies): actual = charge_energies.cross_point_dicts expected = {"Va_O": CrossPoints([[3.0, 6.0]], [[6.0, 6.0], [1.0, 4.0]])} assert actual == expected