Generated compounds have no synonyms
Problem: When calling get_common_name
on a generated compound slugify
calls an error due to empty input.
This issue came up when trying to use the coco identifier in a reaction formula that was used to generate a ThermodynamicModel
.
Explanation: Compounds generated from get_compounds
have no synonyms, causing an error when calling get_common_name
at the following line in the compound object due to slugify
getting an empty input.
Proposed Solution The two ways I have thought about fixing this are:
- Returning the compounds internal id as the default synonym if no synonyms are found.
- Create a synonym identifier for each new compound. This synonym will be either the coco-id or the internal id, depending on which method is used to create the compound.
The first solution is a bit of a lazy fix and I am using it locally for the time being. I believe the second solution makes more sense to use and will allow the coco id to be used as a label on any plots as well.
@elad.noor do you have any thoughts on this? Otherwise I will just modify generated compounds to include a synonym.