-
Notifications
You must be signed in to change notification settings - Fork 659
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
improved specifications for keyword arguments of run method #3191
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,7 +161,7 @@ def _conclude(self): | |
""" | ||
pass # pylint: disable=unnecessary-pass | ||
|
||
def run(self, start=None, stop=None, step=None, verbose=None): | ||
def run(self, start=None, stop=None, step=None, verbose=None, **kwargs): | ||
"""Perform the calculation | ||
|
||
Parameters | ||
|
@@ -174,18 +174,23 @@ def run(self, start=None, stop=None, step=None, verbose=None): | |
number of frames to skip between each analysed frame | ||
verbose : bool, optional | ||
Turn on verbosity | ||
kwargs : keyword arguments, which will be used to access the | ||
underlying functionality in tqdm class, via ProgressBar class, | ||
specifically, to adjust the location of the bar on the screen | ||
""" | ||
logger.info("Choosing frames to analyze") | ||
# if verbose unchanged, use class default | ||
verbose = getattr(self, '_verbose', | ||
False) if verbose is None else verbose | ||
kwargs['verbose'] = verbose | ||
|
||
self._setup_frames(self._trajectory, start, stop, step) | ||
logger.info("Starting preparation") | ||
self._prepare() | ||
|
||
for i, ts in enumerate(ProgressBar( | ||
self._trajectory[self.start:self.stop:self.step], | ||
verbose=verbose)): | ||
**kwargs)): | ||
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. May I ask why you didn't simply 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. Hey, I tried that, and yes, I won't have to modify the 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. Also, please guide me on creating the tests. From what I understand, I need to create a function at the end of the 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. Have a look at the tqdm documentation for possible parameters you could pass through, and the existing ProgressBar tests in MDAnalysis for suggestions on how you could test for progress bar appearance. We also have a brief guide for writing tests in the user guide. 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.
I don't think I understand what you mean here. Could you show me your suggested changes? If you just pass in |
||
self._frame_index = i | ||
self._ts = ts | ||
self.frames[i] = ts.frame | ||
|
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.
Please make sure that you keep the empty line between the author list and the "External code" heading.