Convert compound entry to YAML dict.

def convert_compound_entry(self, compound):
        """Convert compound entry to YAML dict."""
        d = OrderedDict()
        d['id'] = compound.id

        order = {
            key: i for i, key in enumerate(
                ['name', 'formula', 'formula_neutral', 'charge', 'kegg',
                 'cas'])}
        prop_keys = (
            set(compound.properties) - {'boundary', 'compartment'})
        for prop in sorted(prop_keys,
                           key=lambda x: (order.get(x, 1000), x)):
            if compound.properties[prop] is not None:
                d[prop] = compound.properties[prop]

        return d