docs: def parse_formula(formula):
      """Parse a chemical formula and construct a :class:`PyComposition` object
  
      Parameters
      ----------
      formula : :class:`str`
  
      Returns
      -------
      :class:`PyComposition`
  
      Raises
      ------
      ValueError
          If the formula doesn't match the expected pattern
      """
      if not formula_pattern.match(formula):
          raise ValueError("%r does not look like a formula" % (formula,))
      composition = PyComposition()
      for elem, isotope, number in atom_pattern.findall(formula):
          composition[_make_isotope_string(elem, int(isotope) if isotope else 0)] += int(number)
      return composition