Skip to content
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

Fixed the run() method of analysis.hydrogenbonds.hbond_analysis method to use atom indices instead of ids #2572

Merged
merged 9 commits into from
Mar 16, 2020

Conversation

bieniekmateusz
Copy link
Member

@bieniekmateusz bieniekmateusz commented Mar 1, 2020

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Co-authored-by: @p-j-smith [email protected]

Fixed the attribute error (MDAnalysis#2396).

Added test cases that check the ids and indices of atoms in a hydrogen bond.

Co-authored-by: p-j-smith <[email protected]>
@codecov
Copy link

codecov bot commented Mar 1, 2020

Codecov Report

Merging #2572 into develop will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2572      +/-   ##
===========================================
- Coverage    90.71%   90.70%   -0.02%     
===========================================
  Files          174      174              
  Lines        23555    23554       -1     
  Branches      3073     3073              
===========================================
- Hits         21369    21365       -4     
- Misses        1565     1569       +4     
+ Partials       621      620       -1     
Impacted Files Coverage Δ
...DAnalysis/analysis/hydrogenbonds/hbond_analysis.py 97.29% <100.00%> (+1.84%) ⬆️
coordinates/base.py 94.33% <0.00%> (-0.63%) ⬇️
util.py 88.06% <0.00%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da67789...2801f2d. Read the comment docs.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor issues, see comments.

Please also update CHANGELOG as this fixes an issue.

Paul Smith added 3 commits March 6, 2020 10:29
Tidied up the mock universe in TestHydrogenBondAnalysisMock.

Using numpy asserts rather than bare asserts.
Copy link
Member

@zemanj zemanj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe replace hasattr(u, 'bonds') by hasattr(u._topology, 'bonds') for performance reasons (see comment below). Since I don't know how long the analysis usually takes (per frame), I don't know if this is an issue. So I leave the decision up to you. If you decide to follow my suggestion, the reason should be commented in the code.

@richardjgowers
Copy link
Member

richardjgowers commented Mar 9, 2020 via email

It is a million times faster to access.
See MDAnalysis#2396 (comment)
@orbeckst
Copy link
Member

@zemanj are you happy with the changes? I'll leave it to you to shepherd the PR to the final merge.

Copy link
Member

@zemanj zemanj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome, just found some minor thingies.
Your tests are really neat, especially the ASCII art 😁👍

@zemanj
Copy link
Member

zemanj commented Mar 16, 2020

Thank you @bieniekmateusz @p-j-smith!

@bieniekmateusz
Copy link
Member Author

@zemanj are you happy with the changes? I'll leave it to you to shepherd the PR to the final merge.

Thanks @zemanj, would you mind merging it when you get a chance? Thanks, Mat

@zemanj zemanj merged commit 7cb4184 into MDAnalysis:develop Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants