datamol-io / datamol

Molecular Processing Made Easy.
https://docs.datamol.io
Apache License 2.0
462 stars 48 forks source link

`dm.align.template_align` modify the global rdkit behaviour #117

Open hadim opened 2 years ago

hadim commented 2 years ago

See https://github.com/datamol-org/datamol/blob/013d93012abb7fb309a382d8b3eedaca4c2f4425/datamol/align.py#L107

We should not modify the global behaviour. The best is probably to put back the original value if it has been modified. This is not ideal in when doing multithreading.

maclandrol commented 2 years ago

Good point, I remember looking at that and did not find any way to know the current state of PreferCoordGen from python in order to restore it.

hadim commented 2 years ago

Ok thanks (that was my first guess as well). A context manager for this would be nice. I'll try to investigate this more and eventually raise an issue upstream.