def from_dict(cls, d, fmt=None):
        """
        Reconstitute a Structure object from a dict representation of Structure
        created using as_dict().

        Args:
            d (dict): Dict representation of structure.

        Returns:
            Structure object
        """
        if fmt == "abivars":
            from pymatgen.io.abinit.abiobjects import structure_from_abivars
            return structure_from_abivars(cls=cls, **d)

        lattice = Lattice.from_dict(d["lattice"])
        sites = [PeriodicSite.from_dict(sd, lattice) for sd in d["sites"]]
        charge = d.get("charge", None)
        return cls.from_sites(sites, charge=charge)
def from_dict ( cls , d , fmt = None ) : if fmt == "abivars" : from pymatgen . io . abinit . abiobjects import structure_from_abivars return structure_from_abivars ( cls = cls , ** d ) lattice = Lattice . from_dict ( d [ "lattice" ] ) sites = [ PeriodicSite . from_dict ( sd , lattice ) for sd in d [ "sites" ] ] charge = d . get ( "charge" , None ) return cls . from_sites ( sites , charge = charge )
Reconstitute a Structure object from a dict representation of Structure
        created using as_dict().

        Args:
            d (dict): Dict representation of structure.

        Returns:
            Structure object