tardis.util.environment module

class tardis.util.environment.Environment(*values)[source]

Bases: StrEnum

JUPYTER = 'jupyter'
SPHINX = 'sphinx'
SSH_JH = 'ssh_jh'
TERMINAL = 'terminal'
VSCODE = 'vscode'
static allows_widget_display() bool[source]

Checking if the current environment allows widget display

Returns:
Trueif the environment supports widget display (notebook, vscode, sshjh, or sphinx)
Falseotherwise
classmethod get_current_environment() Environment[source]

Get the current execution environment.

Returns:
Environment

The current environment enum member.

static is_notebook() bool[source]

Checking the shell environment where the simulation is run is Jupyter based

Returns:
Trueif the shell environment is Jupyter Based
Falseif the shell environment is Terminal or anything else
static is_sphinx() bool[source]

Checking if the current environment is Sphinx documentation build

Returns:
Trueif running in Sphinx build environment
Falseotherwise
static is_sshjh() bool[source]

Checking if the current environment is JupyterHub

Returns:
Trueif running in notebook with JupyterHub environment variables
Falseotherwise
static is_terminal() bool[source]

Checking if the current environment is a terminal.

static is_vscode() bool[source]

Checking if the current environment is VSCode