xiaoruiDong / RDMC

Reaction Data and Molecular Conformers (RDMC) is a package dealing with reactions, molecules, conformers, majorly in 3D.
https://xiaoruidong.github.io/RDMC/
MIT License
23 stars 1 forks source link

Deal with carbene & avoid `UnboundLocalError` #7

Closed hwpang closed 2 years ago

hwpang commented 2 years ago

I added code to deal with carbene and nitrene, and I move the conf = self.GetConformer() outside of the else block, since the else block is only performed for the code in the try block, but not the except block.

xiaoruiDong commented 2 years ago

@hwpang Many thanks! I merged in your commit for assigning conformed. But I may have reservations about dealing with carbene. Instead of forcing carbenes to always be singlet, I suggest you use mol.SaturateCarbene(1, verbose=False) whenever you create a molecule in your implementation. This not only works for CH2 and NH, but also for other species like C[C]C, [N]C, etc. Currently only works for C and N.