def get_exp_entry(self, formula): """ Returns an ExpEntry object, which is the experimental equivalent of a ComputedEntry and can be used for analyses using experimental data. Args: formula (str): A formula to search for. Returns: An ExpEntry object. """ return ExpEntry(Composition(formula), self.get_exp_thermo_data(formula))
class ExpEntryTest(unittest.TestCase): def setUp(self): with open(os.path.join(test_dir, "Fe2O3_exp.json"), "r") as f: thermodata = json.load(f, cls=MontyDecoder) self.entry = ExpEntry("Fe2O3", thermodata) def test_energy(self): self.assertAlmostEqual(self.entry.energy, -825.5) def test_to_from_dict(self): d = self.entry.as_dict() e = ExpEntry.from_dict(d) self.assertAlmostEqual(e.energy, -825.5) def test_str(self): self.assertIsNotNone(str(self.entry))
class ExpEntryTest(unittest.TestCase): def setUp(self): thermodata = json.load(open(os.path.join(test_dir, "Fe2O3_exp.json"), "r"), cls=MontyDecoder) self.entry = ExpEntry("Fe2O3", thermodata) def test_energy(self): self.assertAlmostEqual(self.entry.energy, -825.5) def test_to_from_dict(self): d = self.entry.as_dict() e = ExpEntry.from_dict(d) self.assertAlmostEqual(e.energy, -825.5) def test_str(self): self.assertIsNotNone(str(self.entry))
def test_to_from_dict(self): d = self.entry.as_dict() e = ExpEntry.from_dict(d) self.assertAlmostEqual(e.energy, -825.5)
def setUp(self): with open(os.path.join(test_dir, "Fe2O3_exp.json"), "r") as f: thermodata = json.load(f, cls=MontyDecoder) self.entry = ExpEntry("Fe2O3", thermodata)
def setUp(self): thermodata = json.load(open(os.path.join(test_dir, "Fe2O3_exp.json"), "r"), cls=MontyDecoder) self.entry = ExpEntry("Fe2O3", thermodata)
def setUp(self): with open(os.path.join(PymatgenTest.TEST_FILES_DIR, "Fe2O3_exp.json")) as f: thermodata = json.load(f, cls=MontyDecoder) self.entry = ExpEntry("Fe2O3", thermodata)
def setUp(self): thermodata = json.load(open(os.path.join(test_dir, "Fe2O3_exp.json"), "r"), cls=PMGJSONDecoder) self.entry = ExpEntry("Fe2O3", thermodata)