def charge(self):
        """
        Returns the net charge of the structure based on oxidation states. If
        Elements are found, a charge of 0 is assumed.
        """
        charge = 0
        for site in self:
            for specie, amt in site.species.items():
                charge += getattr(specie, "oxi_state", 0) * amt
        return charge
Returns the net charge of the structure based on oxidation states. If
        Elements are found, a charge of 0 is assumed.