-
Notifications
You must be signed in to change notification settings - Fork 826
Adds unwrap keyword to shape_parameter #2296
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
Closed
Closed
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
2052a80
Merge pull request #2 from MDAnalysis/develop
NinadBhat 0c5ebc3
Merge pull request #3 from MDAnalysis/develop
NinadBhat 4ac9ab0
Merge pull request #4 from MDAnalysis/develop
NinadBhat 4819464
Adds unwrap to center
NinadBhat 300c955
Adds tests
NinadBhat 6f21b31
Review changes
NinadBhat 55d0a84
add unwrap to 'cog'
NinadBhat 76876d4
Merge develop
NinadBhat 6ae780b
check for pbc and unwrap
NinadBhat 6d33fe9
Removes unnecessary lines
NinadBhat 71f5dc9
:Merge remote-tracking branch 'upstream/develop' into develop
NinadBhat cc6dae2
Merge remote-tracking branch 'upstream/develop' into develop
NinadBhat 38478f8
Merge upstream-develop
NinadBhat 33e609c
Merge upstream/develop
NinadBhat 369d413
adds unwrap to shape_parameter
NinadBhat c23f28b
Adds docs
NinadBhat 69e27ba
Merge upstrem develop
NinadBhat b358f8f
Adds unwrap to center
NinadBhat eedd201
Adds tests
NinadBhat 816d7a9
Review changes
NinadBhat b35e4c1
add unwrap to 'cog'
NinadBhat 84c2cae
check for pbc and unwrap
NinadBhat 319dd79
Removes unnecessary lines
NinadBhat 0791014
adds unwrap to shape_parameter
NinadBhat 3eed1f2
Adds docs
NinadBhat ab8f22b
Merge branch 'shape_parameter' of https://github.com/NinadBhat/mdanal…
NinadBhat dcf85b9
Adds unwrap to center
NinadBhat 86ad2ae
Adds tests
NinadBhat 839afb8
Review changes
NinadBhat 1227777
add unwrap to 'cog'
NinadBhat 47bc7e1
Removes unnecessary lines
NinadBhat dabe357
adds unwrap to shape_parameter
NinadBhat d1da577
Adds docs
NinadBhat 343fd43
Adds unwrap to center
NinadBhat acc0640
Adds tests
NinadBhat 15eb0fb
Review changes
NinadBhat 8acad5b
add unwrap to 'cog'
NinadBhat c88398c
check for pbc and unwrap
NinadBhat e73ec8a
Removes unnecessary lines
NinadBhat 3cf5cd0
adds unwrap to shape_parameter
NinadBhat aff0349
Adds docs
NinadBhat c32af6d
merge remote
NinadBhat d5c865c
Remove repeated lines
NinadBhat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -858,7 +858,9 @@ def ref_noUnwrap_residues(self): | |
| [7333.79167791, -211.8997285, -721.50785456], | ||
| [-211.8997285, 7059.07470427, -91.32156884], | ||
| [-721.50785456, -91.32156884, 6509.31735029]]), | ||
| 'Shape': 0.00173905, | ||
| 'Asph': 0.02060121, | ||
| 'Shape': 0.00173905, | ||
| } | ||
|
|
||
| @pytest.fixture() | ||
|
|
@@ -873,7 +875,9 @@ def ref_Unwrap_residues(self): | |
| 'MOI': np.array([[16747.486, -1330.489, 2938.243], | ||
| [-1330.489, 19315.253, 3306.212], | ||
| [ 2938.243, 3306.212, 8990.481]]), | ||
| 'Shape': 0.27397619, | ||
| 'Asph': 0.2969491080, | ||
| 'Shape': 0.27397619, | ||
| } | ||
|
|
||
| @pytest.fixture() | ||
|
|
@@ -885,7 +889,9 @@ def ref_noUnwrap(self): | |
| [0.0, 0.0, 0.0], | ||
| [0.0, 98.6542, 0.0], | ||
| [0.0, 0.0, 98.65421327]]), | ||
| 'Shape': 2.0, | ||
| 'Asph': 1.0, | ||
| 'Shape': 2.0, | ||
| } | ||
|
|
||
| @pytest.fixture() | ||
|
|
@@ -897,20 +903,23 @@ def ref_Unwrap(self): | |
| [0.0, 0.0, 0.0], | ||
| [0.0, 132.673, 0.0], | ||
| [0.0, 0.0, 132.673]]), | ||
| 'Shape': 2.0, | ||
| 'Asph': 1.0, | ||
| 'Shape': 2.0, | ||
| } | ||
|
|
||
| def test_default_residues(self, ag, ref_noUnwrap_residues): | ||
| assert_almost_equal(ag.center_of_geometry(compound='residues'), ref_noUnwrap_residues['COG'], self.prec) | ||
| assert_almost_equal(ag.center_of_mass(compound='residues'), ref_noUnwrap_residues['COM'], self.prec) | ||
| assert_almost_equal(ag.moment_of_inertia(compound='residues'), ref_noUnwrap_residues['MOI'], self.prec) | ||
| assert_almost_equal(ag.shape_parameter(compound='residues'), ref_noUnwrap_residues['Shape'], self.prec) | ||
| assert_almost_equal(ag.asphericity(compound='residues'), ref_noUnwrap_residues['Asph'], self.prec) | ||
|
|
||
| def test_UnWrapFlag_residues(self, ag, ref_Unwrap_residues): | ||
| assert_almost_equal(ag.center_of_geometry(unwrap=True, compound='residues'), ref_Unwrap_residues['COG'], self.prec) | ||
| assert_almost_equal(ag.center_of_mass(unwrap=True, compound='residues'), ref_Unwrap_residues['COM'], self.prec) | ||
| assert_almost_equal(ag.moment_of_inertia(unwrap=True, compound='residues'), ref_Unwrap_residues['MOI'], self.prec) | ||
| assert_almost_equal(ag.asphericity(unwrap=True, compound='residues'), ref_Unwrap_residues['Asph'], self.prec) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this deliberate? |
||
| assert_almost_equal(ag.shape_parameter(unwrap=True, compound='residues'), ref_Unwrap_residues['Shape'], self.prec) | ||
|
|
||
| def test_default(self, ref_noUnwrap): | ||
| u = UnWrapUniverse(is_triclinic=False) | ||
|
|
@@ -921,16 +930,19 @@ def test_default(self, ref_noUnwrap): | |
| assert_almost_equal(group.center_of_geometry(), ref_noUnwrap['COG'], self.prec) | ||
| assert_almost_equal(group.center_of_mass(), ref_noUnwrap['COM'], self.prec) | ||
| assert_almost_equal(group.moment_of_inertia(), ref_noUnwrap['MOI'], self.prec) | ||
| assert_almost_equal(group.shape_parameter(), ref_noUnwrap['Shape'], self.prec) | ||
| assert_almost_equal(group.asphericity(), ref_noUnwrap['Asph'], self.prec) | ||
|
|
||
| def test_UnWrapFlag(self, ref_Unwrap): | ||
| u = UnWrapUniverse(is_triclinic=False) | ||
| group = u.atoms[31:39] # molecules 11 | ||
|
|
||
| # Changing masses for center_of_mass | ||
| group.masses = [100.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] | ||
| assert_almost_equal(group.center_of_geometry(unwrap=True), ref_Unwrap['COG'], self.prec) | ||
| assert_almost_equal(group.center_of_mass(unwrap=True), ref_Unwrap['COM'], self.prec) | ||
| assert_almost_equal(group.moment_of_inertia(unwrap=True), ref_Unwrap['MOI'], self.prec) | ||
| assert_almost_equal(group.shape_parameter(unwrap=True), ref_Unwrap['Shape'], self.prec) | ||
| assert_almost_equal(group.asphericity(unwrap=True), ref_Unwrap['Asph'], self.prec) | ||
|
|
||
|
|
||
|
|
||
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
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.
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.
needs tests for compound != group