Closed ricrogz closed 2 weeks ago
Please note the only real changes here are in get_atom_order_in_smiles()
. The rest are just changes due to format on save.
Dear Ricardo,
Thank you for identifying the problem and contributing a solution. We merged the commit.
Best, Jerome.
Fixes #65
RDKit's https://github.com/rdkit/rdkit/pull/7749 fixed an issue with the formatting of
_smilesAtomOutputOrder
: before this bugfix, the code added an extra comma at the end of the list of atom indexes, which required some custom parsing code such as the one inget_atom_order_in_smiles()
.Once that patch was merged, the parsing code broke, as it expects the comma to be there.
After the patch,
_smilesAtomOutputOrder
can be parsed as json, or usingast.literal_eval()
, which is what I'm adding here. For backwards compatibility with RDKit builds that do not include that patch, I added a couple of lines that remove the extra comma before usingast.literal_eval()
to parse the list.