Пример #1
0
 def test_as_dict_and_from_dict(self):
     file_name = os.path.join(test_dir, 'HEADER')
     header = Header.from_file(file_name)
     struct = header.struct
     atoms = Atoms(struct, 'O', radius=10.)
     d = atoms.as_dict()
     atoms2 = Atoms.from_dict(d)
     self.assertEqual(str(atoms), str(atoms2),
                      "Atoms failed to and from dict test")
Пример #2
0
 def test_as_dict_and_from_dict(self):
     file_name = os.path.join(test_dir, 'HEADER')
     header = Header.from_file(file_name)
     struct = header.struct
     atoms = Atoms(struct, 'O', radius=10.)
     d = atoms.as_dict()
     atoms2 = Atoms.from_dict(d)
     self.assertEqual(str(atoms), str(atoms2),
                      "Atoms failed to and from dict test")
Пример #3
0
 def test_as_dict_and_from_dict(self):
     file_name = os.path.join(PymatgenTest.TEST_FILES_DIR, "HEADER")
     header = Header.from_file(file_name)
     struct = header.struct
     atoms = Atoms(struct, "O", radius=10.0)
     d = atoms.as_dict()
     atoms2 = Atoms.from_dict(d)
     self.assertEqual(str(atoms), str(atoms2),
                      "Atoms failed to and from dict test")