rxn4chemistry / rxn-chemutils

Chemistry-related Python utilities used in the RXN universe
https://rxn4chemistry.github.io/rxn-chemutils/
MIT License
21 stars 2 forks source link

Canonicalisation of Reactions from ReactionEquation #10

Open A-Thakkar opened 2 years ago

A-Thakkar commented 2 years ago

Related to https://github.com/rxn4chemistry/rxn-chemutils/issues/8

proposal to add canonicalisation and removal of atom mapping as arguments to the to_string method of ReactionEquation reaction.to_string(canonicalise=True, remove_atom_mapping=True)

avaucher commented 2 years ago

My personal choice would be not to do that. A few points of explanation:

Having said that, I am more open to having an external function doing multiple of those if needed. Something along the lines of cleanup_reaction(reaction_equation)? Here I would prefer to work on the reaction equation as on the str, as it is compatible with extended SMILES for instance. Also, I tend to prefer free non-member functions when possible.

What are your thoughts on this?

[PS1]: following up on the arguments with free functions and other kinds of strings, I was already tempted a few times to remove to_string from the ReactionEquation class 😉