def from_dict(cls, d):
        """
        Generates an ion object from a dict created by as_dict().

        Args:
            d:
                {symbol: amount} dict.
        """
        charge = d.pop('charge')
        composition = Composition(d)
        return Ion(composition, charge)
Generates an ion object from a dict created by as_dict().

        Args:
            d:
                {symbol: amount} dict.