예제 #1
0
 def test_as_dict_and_from_dict(self):
     file_name = os.path.join(test_dir, 'PARAMETERS')
     tags = FeffTags.from_file(file_name)
     d=tags.as_dict()
     tags2 = FeffTags.from_dict(d)
     self.assertEqual(tags, tags2,
                      "Parameters do not match to and from dict")
예제 #2
0
 def test_as_dict_and_from_dict(self):
     file_name = os.path.join(test_dir, 'PARAMETERS')
     tags = FeffTags.from_file(file_name)
     d = tags.as_dict()
     tags2 = FeffTags.from_dict(d)
     self.assertEqual(tags, tags2,
                      "Parameters do not match to and from dict")
예제 #3
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'PARAMETERS')
     parameters = FeffTags.from_file(filepath)
     parameters["RPATH"] = 10
     self.assertEqual(parameters["COREHOLE"], "Fsr",
                      "Failed to read PARAMETERS file")
     self.assertEqual(parameters["LDOS"], [-30., 15., .1],
                      "Failed to read PARAMETERS file")
예제 #4
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'PARAMETERS')
     parameters = FeffTags.from_file(filepath)
     parameters["RPATH"] = 10
     self.assertEqual(parameters["COREHOLE"], "Fsr",
                      "Failed to read PARAMETERS file")
     self.assertEqual(parameters["LDOS"], [-30., 15., .1],
                      "Failed to read PARAMETERS file")
예제 #5
0
 def test_diff(self):
     filepath1 = os.path.join(test_dir, 'PARAMETERS')
     parameters1 = FeffTags.from_file(filepath1)
     filepath2 = os.path.join(test_dir, 'PARAMETERS.2')
     parameters2 = FeffTags.from_file(filepath2)
     self.assertEqual(FeffTags(parameters1).diff(parameters2),
                      {'Different': {},
                       'Same': {'CONTROL': [1, 1, 1, 1, 1, 1],
                                'MPSE': [2],
                                'OPCONS': '',
                                'SCF': [6.0, 0, 30, .2, 1],
                                'EXCHANGE': [0, 0.0, 0.0, 2],
                                'S02': [0.0],
                                'COREHOLE': 'Fsr',
                                'FMS': [8.5, 0],
                                'XANES': [3.7, 0.04, 0.1],
                                'EDGE': 'K',
                                'PRINT': [1, 0, 0, 0, 0, 0],
                                'LDOS': [-30., 15., .1]}})
예제 #6
0
 def test_diff(self):
     filepath1 = os.path.join(test_dir, 'PARAMETERS')
     parameters1 = FeffTags.from_file(filepath1)
     filepath2 = os.path.join(test_dir, 'PARAMETERS.2')
     parameters2 = FeffTags.from_file(filepath2)
     self.assertEqual(FeffTags(parameters1).diff(parameters2),
                      {'Different': {},
                       'Same': {'CONTROL': [1, 1, 1, 1, 1, 1],
                                'MPSE': [2],
                                'OPCONS': '',
                                'SCF': [6.0, 0, 30, .2, 1],
                                'EXCHANGE': [0, 0.0, 0.0, 2],
                                'S02': [0.0],
                                'COREHOLE': 'Fsr',
                                'FMS': [8.5, 0],
                                'XANES': [3.7, 0.04, 0.1],
                                'EDGE': 'K',
                                'PRINT': [1, 0, 0, 0, 0, 0],
                                'LDOS': [-30., 15., .1]}})