Yield weight of each formula element.

def _weighted_formula(form, weight_func):
    """Yield weight of each formula element."""
    for e, mf in form.items():
        if e == Atom.H:
            continue

        yield e, mf, weight_func(e)