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

fix the versionchanged for frames #3710

Merged
merged 1 commit into from
Jun 9, 2022
Merged

Conversation

orbeckst
Copy link
Member

@orbeckst orbeckst commented Jun 8, 2022

Fixes #3700

Changes made in this Pull Request:

  • fix versionchanged
  • updated reST and style guide conformance in analysis.base
  • additional logger.info output in run() when per-frame analysis starts

PR Checklist

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

@pep8speaks
Copy link

pep8speaks commented Jun 8, 2022

Hello @orbeckst! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 140:76: W291 trailing whitespace
Line 142:74: W291 trailing whitespace
Line 339:1: W293 blank line contains whitespace
Line 341:1: W293 blank line contains whitespace
Line 409:60: W291 trailing whitespace
Line 411:1: W293 blank line contains whitespace
Line 413:1: W293 blank line contains whitespace
Line 419:72: W291 trailing whitespace
Line 431:80: E501 line too long (86 > 79 characters)
Line 593:67: W291 trailing whitespace

Comment last updated at 2022-06-08 23:58:43 UTC

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #3710 (ee98c51) into develop (56cbf56) will not change coverage.
The diff coverage is n/a.

❗ Current head ee98c51 differs from pull request most recent head 70b96e4. Consider uploading reports for the commit 70b96e4 to get more accurate results

@@           Coverage Diff            @@
##           develop    #3710   +/-   ##
========================================
  Coverage    94.35%   94.35%           
========================================
  Files          191      191           
  Lines        24984    24984           
  Branches      3375     3375           
========================================
  Hits         23574    23574           
  Misses        1362     1362           
  Partials        48       48           
Impacted Files Coverage Δ
package/MDAnalysis/analysis/base.py 96.94% <ø> (ø)

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 56cbf56...70b96e4. Read the comment docs.

@@ -390,15 +390,18 @@ def run(self, start=None, stop=None, step=None, frames=None,
start frame of analysis
stop : int, optional
stop frame of analysis
step : int, optional
step : in, optional
Copy link
Member

Choose a reason for hiding this comment

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

Int right?

Copy link
Member Author

Choose a reason for hiding this comment

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

oops...

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

@orbeckst
Copy link
Member Author

orbeckst commented Jun 8, 2022

... fine, I'll fix the PEP8 issues. I am procrastinating anyway.

- fix #3700 (fix incorrect versionchanged for new frames argument
  for base.AnalysisBase.run())
- updated docs to conform to Style Guide
- additional logger.info output in run() when per-frame analysis starts
- update CHANGELOG
@orbeckst orbeckst force-pushed the fix-versionchanged-frames branch from a87cb36 to 70b96e4 Compare June 9, 2022 00:14
@@ -23,6 +23,7 @@ Fixes
Enhancements
* Add `norm` parameter to InterRDF, InterRDF_s to normalize as rdf,
number density or do not normalize at all. (Issue #3687)
* Additional logger.info output when per-frame analysis starts (PR #3710)
Copy link
Member Author

Choose a reason for hiding this comment

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

It's minor but might actually be useful if one wants to see in the log when the per-frame loop starts and stops (that's one way to get timing information even if one only enabled logging).

Support for setting ``start``, ``stop``, and ``step`` has been
removed. These should now be directly passed to
:meth:`AnalysisBase.run`.
Support for setting `start`, `stop`, and `step` has been removed. These
Copy link
Member Author

Choose a reason for hiding this comment

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

use 79 character line width

@@ -452,7 +470,7 @@ class AnalysisFromFunction(AnalysisBase):
Raises
------
ValueError
if ``function`` has the same ``kwargs`` as :class:`AnalysisBase`
if `function` has the same `kwargs` as :class:`AnalysisBase`
Copy link
Member Author

Choose a reason for hiding this comment

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

follow Style Guide and reference args and kwargs with single backticks

Comment on lines +430 to +431
logger.info("Starting analysis loop over %d trajectory frames",
self.n_frames)
Copy link
Member Author

Choose a reason for hiding this comment

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

We announce frame selection, preparation and conclusion but not the main analysis loop. Adding this logger call makes it visible in a log file and allows reasonable ad-hoc benchmarking because the number of frames analyzed is also printed: one can calculate ((time of logger call conclusions) - (time of call starting analysis))/n_frames.

@orbeckst
Copy link
Member Author

orbeckst commented Jun 9, 2022

Apologies to @richardjgowers and @hmacdope , I made a few more changes (see summary and comments) and squashed everything. Please let me know if anything needs changing. If not, feel free to merge (assuming CI is happy).

@hmacdope
Copy link
Member

hmacdope commented Jun 9, 2022

Nothing to change that I could see. Cheers @orbeckst

@hmacdope hmacdope merged commit 08824a8 into develop Jun 9, 2022
@RMeli RMeli deleted the fix-versionchanged-frames branch August 18, 2023 20:10
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.

Wrong versionchanged in AnalysisBase
5 participants