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