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

Feature Request: Silent spotpy call #239

Open
florianjehn opened this issue Oct 31, 2019 · 3 comments
Open

Feature Request: Silent spotpy call #239

florianjehn opened this issue Oct 31, 2019 · 3 comments

Comments

@florianjehn
Copy link
Contributor

Spotpy prints out a lot of things each time you create a new sampler and run it. This is useful if you want to run one model several times, however it slows down things considerably when you want to run a lot of models after another. It would be useful if you could provide spotpy with keywords that silences this output.

@MuellerSeb
Copy link
Contributor

A good idea would be to include a verbose keyword-argument here:

def __init__(self, spot_setup, dbname=None, dbformat=None, dbinit=True,

which is True by default, so everything will work as usual.

Then every print statement has to be hunt down and should be equipped with:

if self.verbose:
    print(statement)

My two cents.
Cheers, Sebastian

@philippkraft
Copy link
Collaborator

Better solution in my opinion: Search for all print functions and exchange them with logging.info, logging.warning, logging.error and logging.debug, depending on the importance of the message. That is the way how libraries like spotpyshould communicate with the user. I wish we knew about this, when we started. The user can then change the logging level with logging.basicConfig. See: https://docs.python.org/3/library/logging.html

@cpwnd cpwnd mentioned this issue Apr 2, 2020
@cpwnd
Copy link

cpwnd commented Apr 2, 2020

I opened a pull request #244 and hope it could help to solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants