spinetoolbox.kernel_fetcher

Contains a class for fetching kernel specs in a thread.

Module Contents

Classes

KernelFetcher

Worker class for retrieving local kernels.

class spinetoolbox.kernel_fetcher.KernelFetcher(conda_path, fetch_mode=1)[source]

Bases: PySide6.QtCore.QThread

Worker class for retrieving local kernels.

Parameters
  • conda_path (str) – Path to (mini)conda executable

  • fetch_mode (int) – 1: Fetch all kernels, 2: Fetch regular and Conda Python kernels, 3: Fetch only regular Python kernels, 4: Fetch only regular Julia kernels, 5: Fetch kernels that are neither Python nor Julia

kernel_found[source]
stop_fetcher[source]
stop_thread()[source]

Slot for handling a request to stop the thread.

get_all_regular_kernels()[source]

Finds all kernel specs as quickly as possible.

get_all_conda_kernels()[source]

Finds auto-generated Conda kernels.

run()[source]

Finds kernel specs based on selected fetch mode. Sends found kernels one-by-one via signals.

static get_icon(p)[source]

Retrieves the kernel’s icon. First tries to find the .svg icon then .png’s.

Parameters

p (str) – Path to Kernel’s resource directory

Returns

Kernel’s icon or a null icon if icon was not found.

Return type

QIcon

static get_kernel_deats(kernel_path)[source]

Reads kernel.json from given kernel’s resource dir and returns the details in a dictionary.

Parameters

kernel_path (str) – Full path to kernel resource directory

Returns

language (str), path to executable (str), display name (str), project (str) (NA for Python kernels)

Return type

dict