Skip to content

analysis.gnm: optimizations and doc/code cleanup#1272

Merged
orbeckst merged 2 commits intodevelopfrom
optimize-gnm
Mar 31, 2017
Merged

analysis.gnm: optimizations and doc/code cleanup#1272
orbeckst merged 2 commits intodevelopfrom
optimize-gnm

Conversation

@orbeckst
Copy link
Copy Markdown
Member

@orbeckst orbeckst commented Mar 30, 2017

  • optimization
    • eliminated costly lookup of residue sizes
    • reduces run time of TestGNM.test_closeContactGNMAnalysis by about
      a factor of 5 (!) --- should go a long way to improve Benchmark & Trim unit test time #1191
    • made sure that numpy arrays are used
  • argument changes and deprecations
    • new weights="size" kwargs
    • deprecated MassWeight for 0.17.0 (but have tests until then that
      check that it works and overrides weights)
    • in GNMAnalysis, replaced skip kwarg with start/stop/step
      (without going through deprecation because of limited use)
    • added/adapted tests for new kwargs
  • code cleanup
    • removed unused backup_file() function
    • made GNMAnalysis._generate_output() a private method (so that I do not have
      to document it...)
  • numpy-style docs in whole module

Fixes #

Changes made in this Pull Request:

PR Checklist

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

- optimization
  - eliminated costly lookup of residue sizes
  - reduces run time of TestGNM.test_closeContactGNMAnalysis by about
    a factor of 5 (!) --- should go a long way to improve #1191
  - made sure that numpy arrays are used
- argument changes and deprecations
  - new weights="size" kwargs
  - deprecated MassWeight for 0.17.0 (but have tests until then that
    check that it works and overrides weights)
  - in GNMAnalysis, replaced skip kwarg with start/stop/step
    (without going through deprecation because of limited use)
  - added/adapted tests for new kwargs
- code cleanup
  - removed unused backup_file() function
  - made GNMAnalysis._generate_output() a private method (so that I do not have
    to document it...)
- numpy-style docs in whole module
@orbeckst
Copy link
Copy Markdown
Member Author

This was split off from PR #1240 based on @kain88-de 's suggestion.

Copy link
Copy Markdown
Member

@kain88-de kain88-de left a comment

Choose a reason for hiding this comment

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

Looks good. Only two minor comments.

filename to write eigenvectors to, by default no output is written
(``None``)
Bonus_groups : tuple
This is a tuple of selection groups, the com of each which will be
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.

You should specify that this has to be selection strrings. Giving an atomgroup doesn't work and will likely produce a Attribute error

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

expanded docs in 6145479

def __init__(self, universe, selection='protein', cutoff=4.5, ReportVector=None, MassWeight=True):
def __init__(self, universe, selection='protein', cutoff=4.5, ReportVector=None,
weights="size",
MassWeight=None):
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.

should be on the same line as weights.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in 6145479

@orbeckst
Copy link
Copy Markdown
Member Author

Done as far as I can tell, thanks for the comments.

Please squash and merge.

@orbeckst orbeckst added this to the 0.16.0 milestone Mar 31, 2017
frame = ts.frame
timestep = ts.time
self._timesteps.append(timestep)
for ts in self.u.trajectory[start:stop:step]:
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.

I really like that our API does this now!

@orbeckst orbeckst self-assigned this Mar 31, 2017
@orbeckst orbeckst merged commit 71589b9 into develop Mar 31, 2017
@orbeckst orbeckst deleted the optimize-gnm branch March 31, 2017 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants