tomalrussell / snkit

spatial networks toolkit (python)
MIT License
31 stars 10 forks source link

Make tqdm progress bars optional #24

Closed ElcoK closed 1 year ago

ElcoK commented 5 years ago

Show them by default, but add an optional argument to turn it off. When running a bunch of regions parallel, its preferably to track the progress on the amount of regions finished. It is less interesting what the progress is of individual parts of the calculation.

tomalrussell commented 1 year ago

You can now set the environment variable SNKIT_PROGRESS to True or 1 to enable progress bars. See e.g. tutorial on setting environment variables.

For a one-off command, set the variable before calling the script:

SNKIT_PROGRESS=True python script.py

For the rest of a shell session, export the variable so it's set for later commands:

export SNKIT_PROGRESS=True 
python script.py 1
python script.py 2
export SNKIT_PROGRESS=False
parallel 'python script.py {}' ::: seq 20