karabo.util package

Subpackages

Submodules

karabo.util.config_util module

karabo.util.dask module

karabo.util.data_util module

karabo.util.file_handler module

karabo.util.gpu_util module

get_gpu_memory() int

Retrieves the available GPU memory in MiB by invoking nvidia-smi.

Returns:

Available GPU memory in MiB.

Return type:

int

Raises:

RuntimeError – If unexpected output is encountered when running nvidia-smi.

is_cuda_available() bool

Checks if CUDA-compatible GPU is available on the system by invoking nvidia-smi.

Returns:

True if a CUDA-compatible GPU is found, otherwise False.

Return type:

bool

karabo.util.hdf5_util module

karabo.util.helpers module

karabo.util.jupyter module

isNotebook() bool

karabo.util.math_util module

karabo.util.plotting_util module

karabo.util.rascil_util module

Offers functions to handle some of the RASCIL output.

filter_data_dir_warning_message() None

Avoid unnecessary RASCIL warning that confuses users.

Currently the following RASCIL warning is suppressed:

The RASCIL data directory is not available - continuing but any simulations will fail

…which pops up because we don’t download the RASCIL data directory. To the best of our knowledge, we don’t need the data directory (31.07.2024). We can therefore ignore this warning and avoid unnecessarily alerting users with it.

karabo.util.survey module

karabo.util.testing module

class ChangeWorkingDir

Bases: object

Changes temporarily working dir for test-discovery.

run_tests(pytest_args: str | None = None) None

Launches pytest.

Parameters:

args – pytest cli-args, e.g. “-k test_my_favorite”

Module contents