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
Fixes chi1_selections (#4108) #4109
Fixes chi1_selections (#4108) #4109
Changes from 1 commit
14ffcfd
abdde48
a2a7d58
65ea91b
b6ef5b3
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.
Why did you change to using a selection instead of keeping the faster array construct?
Unless there's a good reason, change back. You can time the two approaches and I am sure you'll find that select_atoms is substantially slower.
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.
The old code fails when
cg_name
includes multiple names. E.g. ifcg_name='CG CG1 OG OG1 SG'
then the old code checks whether each atom's name is equal to the entire string'CG CG1 OG OG1 SG'
. This always returns False. So changing this line is a key part of fixing the bug.I based my fix on
chi1_selection
, which also uses atom selection. But I agree that this is slow. I wrote an alternate version that avoids atom selection. In my testing, the newest code takes 18 us while the atom selection code takes 147 us.Should I submit a PR to change
chi1_selection
to use the faster procedure? For now, I'm just going to push a version with the newestchi1_selections
.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.
Thanks for the explanation.
Please push an update for your
chi1_selections
with faster code.Let us have a look at it. We can then decide if we want to update chi1_selection right away or in a separate PR.