code: def to_file(self, filename):
          
          d = {"mass_info": self.mass_info,
               "nonbond_coeffs": self.nonbond_coeffs,
               "topo_coeffs": self.topo_coeffs}
          yaml = YAML(typ="safe")
          with open(filename, "w") as f:
              yaml.dump(d, f)
docs: Saves object to a file in YAML format.
  
          Args:
              filename (str): Filename.