Skip to content

Parallel version of the new mdanalysis hbond_analysis function#113

Merged
orbeckst merged 18 commits intoMDAnalysis:masterfrom
VOD555:H-bond
Nov 9, 2019
Merged

Parallel version of the new mdanalysis hbond_analysis function#113
orbeckst merged 18 commits intoMDAnalysis:masterfrom
VOD555:H-bond

Conversation

@VOD555
Copy link
Copy Markdown
Collaborator

@VOD555 VOD555 commented Oct 30, 2019

Fixes #95

Changes made in this Pull Request:

  • Add parallel analysis function based on the new hbond_analysiis function in MDAnalsysis.

PR Checklist

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

@VOD555 VOD555 self-assigned this Oct 30, 2019
@VOD555 VOD555 requested a review from orbeckst November 5, 2019 00:18
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 5, 2019

Codecov Report

Merging #113 into master will increase coverage by 0.37%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
+ Coverage   97.81%   98.19%   +0.37%     
==========================================
  Files          11       12       +1     
  Lines         642      776     +134     
  Branches       78       91      +13     
==========================================
+ Hits          628      762     +134     
  Misses          8        8              
  Partials        6        6
Impacted Files Coverage Δ
pmda/hbond_analysis.py 100% <100%> (ø)
pmda/parallel.py 98.5% <100%> (+0.01%) ⬆️

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 0465c49...a26f02a. Read the comment docs.

Copy link
Copy Markdown
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.

Add entry to CHANGELOG (with issue number)

Otherwise looking good!

Copy link
Copy Markdown
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.

overall lgtm, see minor comments

CHANGELOG Outdated
MM/DD/YYYY VOD555

* 0.3.1
* 0.3.1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This has to be 0.4.0 because this is a new feature and we do https://semver.org

# If donors_sel is not provided, use topology to find d-h pairs
if not self.donors_sel:

if not (hasattr(u, 'bonds') and len(u.bonds) != 0):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use len(u.bonds) > 0 – will never be negative.

if not self.donors_sel:

if not (hasattr(u, 'bonds') and len(u.bonds) != 0):
raise Exception(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Raise a ValueError instead of generic exception.

Is there a kwarg that could be set when instantiating the class? "set HydrogenBondAnalysis.donors_sel" does not really tell me what to do. This should be clearer – maybe add an example to the docs and include a link to the docs??

@orbeckst
Copy link
Copy Markdown
Member

orbeckst commented Nov 7, 2019

@VOD555 did you raise an issue for dealing with the missing bonds attribute in MDAnalysis itself?

Sorry – just saw MDAnalysis/mdanalysis#2396

hbonds.hydrogens_sel = f"({protein_hydrogens_sel}) or
({water_hydrogens_sel} and around 10 not resname TIP3})"
hbonds.acceptors_sel = f"({protein_acceptors_sel}) or
({water_acceptors_sel} and around 10 not resname TIP3})"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@orbeckst Here is the example to set the HydrogenBondAnalysis.donors_sel. The current online MDAnalysis docs is still version 0.20.1, which doesn't contain the new HBond analysis module, so there's no link can be referred to.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok thanks.

Btw, the devdocs are at https://www.mdanalysis.org/mdanalysis/ .

@orbeckst orbeckst merged commit 1ad4a53 into MDAnalysis:master Nov 9, 2019
@VOD555 VOD555 deleted the H-bond branch July 12, 2020 02:04
@VOD555 VOD555 mentioned this pull request Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hydrogen bonds analysis using PMDA

2 participants