-
Notifications
You must be signed in to change notification settings - Fork 14
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
add tqdm disabling option #689
Conversation
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.
Thanks for the quick turnaround. This all looks fine to me, but I do have one request.
Can you make a global var in top-level init something like:
PROGRESS_BAR=True
and then make
disable_progress=kbmod.PROGRESS_BAR
so that I can
import kbmod
kbmod.PROGRESS_BARS = False
and turn them all off at once.
Bonus points if you set the default value as:
PROGRESS_BARS = bool(os.environ.get("KB_PROGRESS_BARS", True)
so that I can also set the KB_PROGRESS_BARS
env to a falsy value in the running scripts instead of having to repeat it in every task after import.
EDIT: this last request won't work because env will return a string. You can still do something like:
$ ~: export KB_PROGRESS_BARS=1 or 0
# in python
>>> bool(int(os.environ.get("KB_PROGRESS_BARS", 1))
or just an if a = os.environ.get("KB_PROGRESS_BARS", False); PROGRESS_BARS = a if a else True
part one of your request (being able to set |
56442f0
to
634c74c
Compare
Importing it will make a copy of the variable and then keep it in the module's global namespace. You have to get your values from where they're defined. I rejiggered the global variable access and removed some unused imports. This seems to work fine for me now, perhaps double check. |
634c74c
to
deb7a25
Compare
looks good to me (can I say that on my on pr? 😭 ) |
Merge it then :D |
resolves #688
also adds the progress bar to the lazy work unit reprojection changes (which weren't merged at the time of the original pr 😅 )