CosmiQ / solaris

CosmiQ Works Geospatial Machine Learning Analysis Toolkit
https://solaris.readthedocs.io
Apache License 2.0
413 stars 112 forks source link

[FEATURE]: (import `tqdm` from `tqdm.auto`) #335

Open mlubej opened 4 years ago

mlubej commented 4 years ago

Currently, if solaris is run in a notebook environment, the progress bar is being printed out as stderr. This prints out unnecessary lines.

tqdm can be imported as from tqdm.auto import tqdm, and the proper progress bar is loaded, either fr a notebook or script environment.

I've noticed this happening in https://github.com/CosmiQ/solaris/blob/master/solaris/eval/base.py but it's probably also elsewhere.

nrweir commented 4 years ago

Hi @mlubej!

Thanks for bringing this up. I agree that using the version from tqdm.auto is better. If you have the time to make those changes and put in a PR we'd greatly appreciate it! If not, we'll try to get to it during our next batch of changes.

-Nick

nrweir commented 4 years ago

Worth noting, though, that at least in some Jupyter environments, from tqdm.auto import tqdm doesn't really solve the problem. I was just trying that out in a Jupyterlab notebook I'm working in right now, and instead of a progress bar, it's printing the following:

HBox(children=(IntProgress(value=0, max=381), HTML(value='')))
mlubej commented 4 years ago

Hi @nrweir,

your problem with the progress bar is native only to the Jupyterlab environment. You have to enable the ipywidgets.

See: https://github.com/tqdm/tqdm/issues/394#issuecomment-384743637

nrweir commented 4 years ago

Yeah...that makes sense! Thanks.

jayaBalaR commented 4 years ago

Hi

Even I am facing the same issue since two days. The progress bar for tqdm never loads image

I am running this on jupyter notebook in GCP. version jupyter-notebook : 5.7.8

Thanks

rbavery commented 4 years ago

Thanks for the helpful issue @mlubej, I'm adding this into https://github.com/CosmiQ/solaris/pull/331

It looks like changing the import introduced other issues so this actually wasn't included in #331