hic3defdr.util.progress module¶
-
hic3defdr.util.progress.
context
()[source]¶ Infers the context in which the current program is being executed.
https://stackoverflow.com/a/47428575
Returns: The context, either ‘colab’, ‘jupyter’, ‘ipython’, or ‘terminal’. Return type: str
-
hic3defdr.util.progress.
tqdm_maybe
(iter, **kwargs)[source]¶ Drop-in replacement from
tqdm.tqdm()
except will simply do nothing iftqdm
is not present and will usetqdm.tqdm_notebook()
if run in a notebook.Parameters: - iter (iterable) – The iterable to wrap.
- kwargs (kwargs) – Will be passed through to
tqdm.tqdm()
.
Returns: Wrapped by
tqdm
if it was installed, or justiter
otherwise.Return type: iterator