-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Index symbol customization #71
Conversation
Removed index alphabet and index code from constants
Create index_alphabet.py following style of bond_constraints.py
import index_alphabet and index_code from index_alphabet.py
import index_alphabet from index_alphabet.py
Check length, keys, values of passed index_alphabet dict
Add functions from index_alphabet.py
Thanks for the feedback - I made most of the suggested changes!
|
Fix some formatting for unused imports, line spacing, white spaces, and line lengths.
I think that this latest commit complies with PEP8 length requirements, besides the error messages (I'm not too familiar with the standard so I don't know if this is an issue). In my testing I did find a bug that affects both setting semantic bond constraints and index alphabets when using dask. Dask parallelized functions don't use updated bond constraints or index alphabets unless the bond constraints or index alphabet is updated within the function itself, which is inefficient. I'm not exactly sure why this happens, but my guess is that dask reinitializes SELFIES for use in the parallelized function, causing settings to reset to defaults. Could a proper config file for SELFIES customizations fix this? An example of the bug:
|
Thanks for discovering the subtle bug. Could you pls repost as an issue so we can look at it further? Thank you! Please give me some time to decode the CI errors. |
hi @csnbritt -- this PR shows some CI mistakes for some time. Do you plan to continue try fixing these issues, and submit this valueable contribution - or shall we close the PR? Thanks! |
Added index symbol customization functionality following the style of the bond constraints code to address #69
index_alphabet.py includes three new functions:
Currently I've only included one preset index alphabet, the default one. Having multiple presets may or may not be useful, remains to be seen how much different index alphabets affect performance on different tasks I suppose.
New index alphabets can be set by passing a dictionary with tokens as keys and indices as values. Checks to make sure the passed dictionary has 16 keys, each key is a valid atom or ring/branch token, and that the set of dictionary values includes all integers 0-15