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.
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
Allow bonds etc to be additively guessed when present #4761
Allow bonds etc to be additively guessed when present #4761
Changes from 31 commits
6ee7c17
ada6967
5ce43e0
7db0f6a
f22a9a6
e21059c
aed3d31
e88af7a
11a14c1
523f06d
a27bebf
219ee09
1e6d9ab
2918ae7
3e17007
892bc42
451d6a8
f044fa1
e17c57e
1fc4514
7305e60
970371f
909ec37
c190ca8
f03a394
80c68a6
5ab97d4
38077d6
ab6418e
26f91b5
36b62e6
839e7f3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Do we really want to do this? There are a couple of cases in
guess_bonds
where we can encounter a ValueError instead of a NoDataError.e.g. https://github.com/MDAnalysis/mdanalysis/blob/develop/package/MDAnalysis/guesser/default_guesser.py#L430
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.
Also what should happen when you encounter a KeyError? (i.e. the unrecognised topologyattr check you added)
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.
Yup for this exact case -- I didn't want to change existing behaviour too much in case downstream packages were relying on it, and this is an existing test for vdwradii that wasn't introduced with guessers. The NoDataError is meant to catch cases where (e.g.) masses can't be guessed since there aren't types, not if the vdwradii is incomplete, so you can turn it off with
error_if_missing
. Same with the KeyError.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.
I'm sorry, I just don't follow what you mean here.
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.
Oops. I hallucinated that you linked a test instead of a spot in the code, sorry about that. Basically IIRC there's two tests that test for this ValueError. One is definitely
mdanalysis/testsuite/MDAnalysisTests/core/test_universe.py
Lines 464 to 467 in e776f12
These passed in the initial guesser PR because that was pre #4754.
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.
Yes, keeping the original behavior makes sense to me (and I confirm it is the original behavior).
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.
I'm not sure I understand what you mean by "same with the KeyError" - i.e. there is nothing here that catches the KeyError as far as I can tell.
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 sake of not stalling things more I'm going to go with it (i.e. the KeyError shouldn't happen under normal circumstances), but I would like to know what you meant here @lilyminium - it's unclear if you meant that the KeyError should behave like the NoDataError, in which case this except should include the KeyError too?