analysis.gnm: optimizations and doc/code cleanup#1272
Merged
Conversation
- 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
Member
Author
|
This was split off from PR #1240 based on @kain88-de 's suggestion. |
1 task
kain88-de
reviewed
Mar 30, 2017
Member
kain88-de
left a comment
There was a problem hiding this comment.
Looks good. Only two minor comments.
package/MDAnalysis/analysis/gnm.py
Outdated
| 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 |
Member
There was a problem hiding this comment.
You should specify that this has to be selection strrings. Giving an atomgroup doesn't work and will likely produce a Attribute error
package/MDAnalysis/analysis/gnm.py
Outdated
| 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): |
Member
There was a problem hiding this comment.
should be on the same line as weights.
Member
Author
|
Done as far as I can tell, thanks for the comments. Please squash and merge. |
kain88-de
approved these changes
Mar 31, 2017
richardjgowers
approved these changes
Mar 31, 2017
| frame = ts.frame | ||
| timestep = ts.time | ||
| self._timesteps.append(timestep) | ||
| for ts in self.u.trajectory[start:stop:step]: |
Member
There was a problem hiding this comment.
I really like that our API does this now!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
a factor of 5 (!) --- should go a long way to improve Benchmark & Trim unit test time #1191
check that it works and overrides weights)
(without going through deprecation because of limited use)
to document it...)
Fixes #
Changes made in this Pull Request:
PR Checklist