-
Notifications
You must be signed in to change notification settings - Fork 81
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
Allow users to disable progress bars #612
Comments
@simonhatcher I agree it's a good idea to provide this control. For now, since export TQDM_DISABLE=1 Or in Python ahead of any TQDM imports: import os
os.environ["TQDM_DISABLE"] = "1" The environment variable requires tqdm v4.66.0+, but you can also hack it for older versions ahead of any TQDM imports like: from tqdm import tqdm
from functools import partialmethod
tqdm.__init__ = partialmethod(tqdm.__init__, disable=True) |
@jhkennedy Thank you! That does work, but the one challenge is that I'm using TQDM elsewhere and I don't want to globally disable it in the long run. |
yes, definitely exactly why we should provide a way to disable it for Earthaccess. 🤔 I think you could write a context manager that would disable it temporarily... but that's getting to be a lot. Something like (I'm sure there are much cleaner ways to do this): from tqdm import tqdm
from functools import partialmethod
class DisableTqdm(object):
def __init__(self):
self._tqdm_init = tqdm.__init__
def __enter__(self):
tqdm.__init__ = partialmethod(tqdm.__init__, disable=True)
def __exit__(self, type, value, traceback):
tqdm.__init__ = self._tqdm_init
with DisableTqdm():
# Do stuff
... |
Please add an optional argument to earthaccess.open to disable PQDM progress bars. The progress bars clog up my Jupyter notebook output very badly.
The text was updated successfully, but these errors were encountered: