Skip to content

Commit

Permalink
add TestPhaseDiagram.test_get_reference_energy
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Aug 5, 2023
1 parent 4ad0f93 commit b45dd04
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/analysis/test_phase_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,26 @@ def test_get_form_energy(self):
# test get_form_energy_per_atom
assert self.pd.get_form_energy_per_atom(entry) == approx(expected / n_atoms), formula

def test_get_reference_energy(self):
expected_ref_energies = {
"Li5FeO4": -265.5546721,
"Li2O2": -24.685172046,
"Fe2O3": -51.93425725,
"FeO": -21.70885048,
"Li": -1.91301487,
"LiFeO2": -17.02571825,
"Li2O": -8.084307881,
"Fe": -6.5961471,
"Fe3O4": -73.6431077,
"Li2FeO3": -92.78804506,
"O2": -25.54966885,
}
for entry in self.pd.stable_entries:
formula = entry.composition.reduced_formula
actual = self.pd.get_reference_energy(entry.composition)
expected = expected_ref_energies[formula]
assert actual == approx(expected), formula

def test_all_entries_hulldata(self):
assert len(self.pd.all_entries_hulldata) == 490

Expand Down

0 comments on commit b45dd04

Please sign in to comment.