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

gyration_moments method / allow shape parameters to yield per residue quantities #3905

Merged
merged 14 commits into from
Mar 15, 2023

Conversation

jaclark5
Copy link
Contributor

@jaclark5 jaclark5 commented Nov 4, 2022

… per residue quantities

Fixes #3002
Fixes #3904

Changes made in this Pull Request:

  • Added AtomGroup Method to provide group and per residue moments of gyration.

PR Checklist

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

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ec2f2c0) 93.56% compared to head (6782962) 93.56%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3905   +/-   ##
========================================
  Coverage    93.56%   93.56%           
========================================
  Files          191      191           
  Lines        25065    25075   +10     
  Branches      4042     4049    +7     
========================================
+ Hits         23452    23462   +10     
  Misses        1093     1093           
  Partials       520      520           
Impacted Files Coverage Δ
package/MDAnalysis/core/topologyattrs.py 96.12% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

Few comments and queries. :)

package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
@hmacdope hmacdope linked an issue Nov 21, 2022 that may be closed by this pull request
@hmacdope
Copy link
Member

@jaclark5 would you be able to fix conflicts / trigger CI and we can go from there? Might also be good to have another pair of eyes @MDAnalysis/coredevs?

@jaclark5
Copy link
Contributor Author

jaclark5 commented Nov 29, 2022

@hmacdope These errors occur from the new Bibtex citation style. This would be resolved with the following changes:

maintainer/conda/environment.yml:  - pyyaml>=3.02
package/requirements.txt:pyyaml>=3.02

Recall that these changes were added so that the tests would pass in my other PR #3842. So as soon as those are merged, I'll update this PR with the develop branch ;)

@jaclark5
Copy link
Contributor Author

jaclark5 commented Dec 7, 2022

@hmacdope I'm now getting an error in the tests from MDAnalysis/coordinate/XTC.py

@IAlibay
Copy link
Member

IAlibay commented Dec 7, 2022

I'm now getting an error in the tests from MDAnalysis/coordinate/XTC.py

@jaclark5 are you getting this locally? If you so you might need to pip install MDAnalysis again.

@jaclark5
Copy link
Contributor Author

jaclark5 commented Dec 7, 2022

I am getting it locally. Good point, thanks.

Edit: That worked

@orbeckst
Copy link
Member

orbeckst commented Jan 6, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

Looking good just a few little things :)

package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

LGTM @jaclark5, thanks for another great contribution. @MDAnalysis/coredevs could I get a second review here?

@jaclark5 jaclark5 changed the title gyration_moments method / allow shape parameters to yield per residue quantities gyration_moments method / allow shape parameters to yield per residue quantities 1 Feb 9, 2023
@jaclark5 jaclark5 changed the title gyration_moments method / allow shape parameters to yield per residue quantities 1 gyration_moments method / allow shape parameters to yield per residue quantities Feb 9, 2023
@hmacdope
Copy link
Member

@MDAnalysis/coredevs still looking for a second review here. :)

@hmacdope
Copy link
Member

@MDAnalysis/coredevs still looking for a second review here. :)

Bump on this @MDAnalysis/coredevs?

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.

Thanks for the fix and code consolidation. I had a quick look through and mainly noticed doc things.

Did we have tests for the case where the methods actually worked as expected and do these tests still produce the same values?

package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
@@ -1800,32 +1889,17 @@ def asphericity(group, wrap=False, unwrap=None, compound='group'):
.. versionchanged:: 2.1.0
Renamed `pbc` kwarg to `wrap`. `pbc` is still accepted but
is deprecated and will be removed in version 3.0.
.. versionchanged:: 2.5.0
Added use of gyration_moments for per residue quantities
Copy link
Member

Choose a reason for hiding this comment

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

Is this important for the user to know how the quantities are computed? I'd assume the more important message is what you have in the CHANGELOG: since 2.5.0 you can calculate asphericity for any compound.

Copy link
Contributor Author

@jaclark5 jaclark5 Mar 2, 2023

Choose a reason for hiding this comment

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

That's what I was going for with "for per residue quantities" but hopeful the change is more clear.

package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
@jaclark5
Copy link
Contributor Author

jaclark5 commented Mar 2, 2023

I kept the same testing structure that existed, some results stayed the same and others changed. For a calculation with the entire atom group, the result stayed the same (line 1098, 1120 in the test file.). In the tests where other compound options were used, the result changed as there is more than one value each reflecting a residue, while before each instance had the same value as when there was no compound specified.

@jaclark5 jaclark5 requested a review from orbeckst March 15, 2023 13:08
@orbeckst
Copy link
Member

sorry, I currently only have very limited time and won't be able to review soon

@orbeckst
Copy link
Member

actually... that should be quick

@hmacdope
Copy link
Member

Brilliant! two reviews. I will merge now.

@hmacdope hmacdope merged commit dd234c1 into MDAnalysis:develop Mar 15, 2023
@jaclark5 jaclark5 deleted the gyration_eig branch March 17, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants