Exemple #1
0
 def test_dict(self):
     fe = Element("Fe")
     d = fe.to_dict
     self.assertEqual(fe, Element.from_dict(d))
Exemple #2
0
 def from_dict(cls, d):
     entries = [ComputedEntry.from_dict(dd) for dd in d["all_entries"]]
     elements = [Element.from_dict(dd) for dd in d["elements"]]
     return cls(entries, elements)
Exemple #3
0
 def test_dict(self):
     fe = Element.Fe
     d = fe.as_dict()
     self.assertEqual(fe, Element.from_dict(d))
 def test_dict(self):
     fe = Element("Fe")
     d = fe.as_dict()
     self.assertEqual(fe, Element.from_dict(d))
Exemple #5
0
 def from_dict(cls, d):
     entries = [ComputedEntry.from_dict(dd) for dd in d["all_entries"]]
     elements = [Element.from_dict(dd) for dd in d["elements"]]
     return cls(entries, elements)