Ejemplo n.º 1
0
 def test_group_entries_by_structure(self):
     entries = loadfn(os.path.join(PymatgenTest.TEST_FILES_DIR, "TiO2_entries.json"))
     groups = group_entries_by_structure(entries)
     self.assertEqual(sorted(len(g) for g in groups), [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4])
     self.assertLess(len(groups), len(entries))
     # Make sure no entries are left behind
     self.assertEqual(sum(len(g) for g in groups), len(entries))
Ejemplo n.º 2
0
 def test_group_entries_by_structure(self):
     entries = loadfn(str(test_dir / "TiO2_entries.json"))
     groups = group_entries_by_structure(entries)
     self.assertEqual(sorted([len(g) for g in groups]),
                      [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4])
     self.assertLess(len(groups), len(entries))
     # Make sure no entries are left behind
     self.assertEqual(sum([len(g) for g in groups]), len(entries))
Ejemplo n.º 3
0
 def test_group_entries_by_structure(self):
     with open(os.path.join(test_dir, "TiO2_entries.json"), "r") as f:
         entries = json.load(f, cls=MontyDecoder)
     groups = group_entries_by_structure(entries)
     self.assertEqual(sorted([len(g) for g in groups]),
                      [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4])
     self.assertLess(len(groups), len(entries))
     #Make sure no entries are left behind
     self.assertEqual(sum([len(g) for g in groups]), len(entries))
Ejemplo n.º 4
0
 def test_group_entries_by_structure(self):
     with open(os.path.join(test_dir, "TiO2_entries.json"), "r") as f:
         entries = json.load(f, cls=MontyDecoder)
     groups = group_entries_by_structure(entries)
     self.assertEqual(sorted([len(g) for g in groups]),
                      [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4])
     self.assertLess(len(groups), len(entries))
     #Make sure no entries are left behind
     self.assertEqual(sum([len(g) for g in groups]), len(entries))
Ejemplo n.º 5
0
    def test_group_entries_by_structure(self):

        entries = loadfn(str(test_dir / "TiO2_entries.json"))
        groups = group_entries_by_structure(entries)
        self.assertEqual(sorted([len(g) for g in groups]),
                         [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4])
        self.assertLess(len(groups), len(entries))
        # Make sure no entries are left behind
        self.assertEqual(sum([len(g) for g in groups]), len(entries))