Fix OpenBabel segfault in frame_to_rdkit
#25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Back when we were using PyCall instead of PythonCall, there was an issue where repeated calling of
frame_to_rdkit
could cause a segfault within OpenBabel (as in the original implementation in 86ad962). This was originally fixed in 96539b7 by creating a pure Python function that could run this part of the code. No idea why this fix works, but it seems OB doesn't like being passed back and forth between Python and Julia very quickly and this works around it.When we moved to PythonCall in e06ad7b it seemed like this was fixed and we went back to a mixed Julia/Python implementation of this functionality, but recent testing on large CRNs has caused it to rear its ugly head again.
This has been fixed by reimplementing a pure Python function called
frame_to_rdkit_remap_atoms
in Kinetica's__init__
function, using PythonCall this time.