Exemplo n.º 1
0
    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))
Exemplo n.º 2
0
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))
Exemplo n.º 3
0
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))
Exemplo n.º 4
0
 def test_to_from_dict(self):
     d = self.entry.as_dict()
     e = ExpEntry.from_dict(d)
     self.assertAlmostEqual(e.energy, -825.5)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 def test_to_from_dict(self):
     d = self.entry.as_dict()
     e = ExpEntry.from_dict(d)
     self.assertAlmostEqual(e.energy, -825.5)
Exemplo n.º 7
0
 def setUp(self):
     thermodata = json.load(open(os.path.join(test_dir, "Fe2O3_exp.json"),
                                 "r"), cls=MontyDecoder)
     self.entry = ExpEntry("Fe2O3", thermodata)
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
 def setUp(self):
     thermodata = json.load(open(os.path.join(test_dir, "Fe2O3_exp.json"),
                                 "r"),
                            cls=PMGJSONDecoder)
     self.entry = ExpEntry("Fe2O3", thermodata)