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

verbose not set in analysis.AnalysisBase.run #2504

Closed
lilyminium opened this issue Feb 5, 2020 · 11 comments · Fixed by #2617
Closed

verbose not set in analysis.AnalysisBase.run #2504

lilyminium opened this issue Feb 5, 2020 · 11 comments · Fixed by #2617

Comments

@lilyminium
Copy link
Member

lilyminium commented Feb 5, 2020

Expected behavior

From #1463, I think that AnalysisBase.run(verbose=True) is supposed to override the existing self._verbose. From #2206, it seems that verbose is supposed to be deprecated, but there are no deprecation warnings about it. (For what it's worth, I think the progress meter is cute.)

EDIT (@orbeckst): Analysis classes should be able to take the verbose kwarg for both the __init__() constructor and the run() method. The value give for run() should override the constructor value while run() is executing, as described in #1463 .

Actual behavior

Nothing happens.

Code to reproduce the behavior

verbose = getattr(self, '_verbose', False) if verbose is None else verbose

Nothing's done with verbose. _setup_frames defaults to False.

verbose = getattr(self, '_verbose', False)

Currently version of MDAnalysis

  • Which version are you using? (run python -c "import MDAnalysis as mda; print(mda.__version__)") 0.20.1
  • Which version of Python (python -V)? 3.7
  • Which operating system? MacOS
@orbeckst
Copy link
Member

orbeckst commented Feb 5, 2020

@lilyminium thanks for pointing out this inconsistency.

From #2206, it seems that verbose is supposed to be deprecated, but there are no deprecation warnings about it.

I just re-read my comments namely #2206 (comment) and as far as I can tell, I mis-remembered: verbose in both AnalysisBase.__init__() and AnalysisBase.run() is not deprecated but conforms to the "Bauhaus" API #719 and #1463 is correct. (I updated my comment.)

@Purva-Chaudhari
Copy link

Purva-Chaudhari commented Mar 6, 2020

@lilyminium , @orbeckst I would like to work on the issue

@lilyminium
Copy link
Member Author

Please go ahead @Purva-Chaudhari! Put up a pull request and link this issue, and it will get reviewed.

@kpiyush04
Copy link

Hi! @lilyminium @orbeckst
I would like to work on this issue

@Purva-Chaudhari
Copy link

@lilyminium From what I have understood(ran example with run(verbose=True)),in the run method in AnalysisBase() self_verbose is not getting overridden. Referring to issue #2206 I Raised deprecation warning if step/start/stop is none and made their scope private. Is it now expected that the self_verbose in run to override the default .

@Purva-Chaudhari
Copy link

If I am mistaken in understanding the objective please do let me know

@lilyminium
Copy link
Member Author

@kpiyush04 thanks for looking at this, but as @Purva-Chaudhari has already started working on the issue, their pull request will get prioritised. Perhaps you could work on something else, e.g. #2599 was recently opened.

@Purva-Chaudhari Yep, that sounds about right -- as @orbeckst clarified above, verbose is not deprecated. Setting verbose in run() should override the existing self._verbose.

@orbeckst
Copy link
Member

orbeckst commented Mar 9, 2020

Just to add: @Purva-Chaudhari please open a PR that references this issue in a timely manner. Just saying "I want to do this" is not enough – we'll give you some leeway but we expect that you follow up within a day or so.

@Purva-Chaudhari
Copy link

@orbeckst Sure will follow that

@Purva-Chaudhari
Copy link

@lilyminium could you please review the PR, I am a bit new to open source contribution. Hope i made it in a correct way. If not please do let me know and also regarding the changes I made, are they correct or what should I improve in the code,
Thanking you

@lilyminium
Copy link
Member Author

lilyminium commented Mar 11, 2020

@Purva-Chaudhari Thanks for having a go at this, welcome to open source! I see that you opened a PR in your own fork of MDAnalysis -- however, to merge code into this code-base, you need to open one here. The user guide lays out the steps of how to contribute to MDAnalysis, including adding and writing tests.

You have also commented which part of the code you would like to change, but you should actually make changes to the code so that tests can be run on it to see if it works. In terms of your suggested change -- it's not quite what we were looking for. The line verbose = getattr(self, '_verbose', False) overrides the verbose argument passed in run, whereas the value I pass into run() should override the saved _verbose, at least while the class is running.

Please ping me or another dev for a proper review when you open a PR into this repository :-)

@Purva-Chaudhari Purva-Chaudhari mentioned this issue Mar 16, 2020
4 tasks
orbeckst pushed a commit that referenced this issue Mar 22, 2020
* Fixes #928
* Fixes #2504
* Added the ProgressBar class which inherits the tqdm.auto.tqdm object. 
   - For now, the disable keyword takes precedence over verbose, i.e. if both are set to 
     True the progress bar won't show. Setting disable=True will disable the progress bar 
     as expected. Setting verbose=False will disable the progress bar.
  - Automatically detect which version of tqdm to use (console or notebook):
     If run from a jupyter notebook or jupyter lab, will use the
     tqdm.notebook.tqdm class, else (ipython, shell, or anything else)
     will use the default tqdm.tqdm class
* add tqdm to dependencies
* Deprecate ProgressMeter through warning and text
* Replace ProgressMeter with ProgressBar everywhere in MDAnalysis
* add tests (for #928 and #2504)
* update CHANGELOG and AUTHORS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants