def test_dict(self): fe = Element("Fe") d = fe.to_dict self.assertEqual(fe, Element.from_dict(d))
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)
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))