Skip to main content

KernelDB.import_metakernel()

Track a metakernel that is already on disk, without a download (#47).

Usage

Source

KernelDB.import_metakernel(
    mk_path,
    mission=None,
    official=True,
)

This is what skd import does. The method indexes the metakernel’s entries, registers every kernel it resolves to that exists on disk, and adds the registry row with no source URL (as scan does for the .tm files it meets).

official=False marks a metakernel assembled locally (#48), such as a subsetter’s output or the one planetarypy builds in archived_kernels.py, as skd import --unofficial does. The flag is stored in the registry, ls appends unofficial to the name, and show prints Official: no. Importing a path again replaces its row, so the flag follows the latest call.

Parameters

mk_path: str | Path

The .tm file.

mission: str | None = None

The mission. Defaults to the one guessed from the path with guess_mission, taking the configured kernel roots into account.

official: bool = True
False marks a metakernel assembled locally rather than published by an archive.

Returns

dict
With the keys mk_path, filename, mission, n_entries, n_registered and missing, the entries whose file is not on disk.

Raises

FileNotFoundError
mk_path is not a file.