def write_compounds(self, stream, compounds, properties=None):
        """Write iterable of compounds as YAML object to stream.

        Args:
            stream: File-like object.
            compounds: Iterable of compound entries.
            properties: Set of compound properties to output (or None to output
                all).
        """
        self._write_entries(
            stream, compounds, self.convert_compound_entry, properties)