scimba_torch.utils.environment

A module to check the current environment.

Functions

get_static_terminal_width()

Get the width of the current terminal.

is_google_colab()

Check if code is run within google.colab.

is_jupyter_notebook()

Check if code is run within a jupyter notebook.

is_static_width_environment()

Check if one can trust dynamic width for tqdm.

is_jupyter_notebook()[source]

Check if code is run within a jupyter notebook.

Return type:

bool

Returns:

True if running inside a Jupyter-like environment (Notebook, JupyterLab, VSCode notebooks, …?)

is_google_colab()[source]

Check if code is run within google.colab.

Return type:

bool

Returns:

True if running inside google.colab)

is_static_width_environment()[source]

Check if one can trust dynamic width for tqdm.

Return type:

bool

Returns:

True if one can not trust dynamic width for tqdm. Return False if running in a normal terminal.

get_static_terminal_width()[source]

Get the width of the current terminal.

Return type:

int

Returns:

the width of the current terminal