-
Notifications
You must be signed in to change notification settings - Fork 53
added chain-matching AlignError #483
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Minor comments below! (Sorry i edited my original message)
src/haddock/libs/libalign.py
Outdated
| min_idx = min(chain_dic[chain]) | ||
| max_idx = max(chain_dic[chain]) | ||
| chain_ranges[chain] = (min_idx, max_idx) | ||
| if chain_dic[chain] == []: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the pure pythonic way of doing it, I suggest:
if not chain_dic[chain]:or
if len(chain_dic[chain]) == 0:| max_idx = max(chain_dic[chain]) | ||
| chain_ranges[chain] = (min_idx, max_idx) | ||
| if chain_dic[chain] == []: | ||
| raise ALIGNError(f"Chain matching error on {pdb_f}, chain {chain}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can, please add a minor test covering the new lines:
def test_new_test_function():
with pytest.raises(ALIGNError):
load_coords(...)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines and you comply with the following criteria:
toxtests pass. Runtoxcommand inside the repository folder-test.cfgexamples execute without errors. Insideexamples/runpython run_tests.py -bCloses #472 by adding a call to an AlignError. It does not stop caprieval, but rather the
capri_ss.tsvfile is still produced for all those models that do not show an evident (empty chain) chain-matching error.