flint.containers

Helper utility functions to download and otherwise manage containers required for flint

Attributes

Classes

FlintContainer

Item representing a Flint container

Functions

_pull_and_check_container(→ pathlib.Path)

Pull a container and check that it was downloaded correctly

_sanity_check_containers(→ None)

Do some quick validation checks on the set of loaded containers. Make sure there are no

cli(→ None)

download_known_containers(→ tuple[pathlib.Path, Ellipsis])

Download known containers for use throughout flint. This

download_known_containers_coro(→ tuple[pathlib.Path, ...)

Download known containers for use throughout flint.

get_known_container_path(→ pathlib.Path)

Return the path to a flint known container. These are containers that

get_parser(→ argparse.ArgumentParser)

Create the CLI argument parser

log_known_containers(→ None)

Log the known containers. This simply prints the set of known containers.

verify_known_containers(→ bool)

Inspect the provided container_directory to examine that the set of

Module Contents

class flint.containers.FlintContainer(/, **data: Any)[source]

Bases: flint.options.BaseOptions

Item representing a Flint container

description: str | None = None[source]

Short description on the purpose of the container

file_name: str[source]

The expected file name of the container. This will be appended to the container directory path.

name: str[source]

Name of the container

tag: str = 'v1.0'[source]

Tag of the container, if applicable

uri: str[source]

latest

Type:

URL of the container that can be used to pull with apptainer, e.g. docker

Type:

//alecthomson/aoflagger

async flint.containers._pull_and_check_container(container_directory: pathlib.Path, known_container: FlintContainer, expected_output_path: pathlib.Path) pathlib.Path[source]

Pull a container and check that it was downloaded correctly

Parameters:
  • container_directory (Path) – Output directory to store containers. Will be created if necessary.

  • known_container (FlintContainer) – Container to download

  • expected_output_path (Path) – Expected output path

Returns:

The expected path of the container

Return type:

Path

flint.containers._sanity_check_containers(container_list: list[FlintContainer] | tuple[FlintContainer, Ellipsis]) None[source]

Do some quick validation checks on the set of loaded containers. Make sure there are no duplicated names or file names

flint.containers.cli() None[source]
flint.containers.download_known_containers(container_directory: pathlib.Path | str, new_tag: str | None = None) tuple[pathlib.Path, Ellipsis][source]

Download known containers for use throughout flint. This calls the async enabled download function and blocks until results are gathered.

Parameters:
  • container_directory (Path | str) – Output directory to store containers. Will be created if necessary.

  • new_tag (str, optional) – The tag associated with the containers to download. If None the latest image will be downloaded. Defaults to None.

Returns:

Paths to all containers downloaded

Return type:

tuple[Path, …]

async flint.containers.download_known_containers_coro(container_directory: pathlib.Path | str, new_tag: str | None = None) tuple[pathlib.Path, Ellipsis][source]

Download known containers for use throughout flint.

Parameters:
  • container_directory (Path | str) – Output directory to store containers. Will be created if necessary.

  • new_tag (str, optional) – The tag associated with the containers to download. If None the latest image will be downloaded. Defaults to None.

Returns:

Paths to all containers downloaded

Return type:

tuple[Path, …]

flint.containers.get_known_container_path(container_directory: pathlib.Path | str, name: str) pathlib.Path[source]

Return the path to a flint known container. These are containers that are downloaded through the download_known_containers function.

Parameters:
  • container_directory (Path | str) – Path to directory containing downloaded containers

  • name (str) – Name of the container. Note that this is not the file name.

Raises:

ValueError – Raised when the name is not known

Returns:

Path to the requested

Return type:

Path

flint.containers.get_parser() argparse.ArgumentParser[source]

Create the CLI argument parser

Returns:

Constructed argument parser

Return type:

ArgumentParser

flint.containers.log_known_containers() None[source]

Log the known containers. This simply prints the set of known containers.

flint.containers.verify_known_containers(container_directory: pathlib.Path | str) bool[source]

Inspect the provided container_directory to examine that the set of containers that are expected to exist are present.

Parameters:

container_directory (Path | str) – Directory to search that should have containers

Returns:

True is all containers are available. False otherwise.

Return type:

bool

flint.containers.KNOWN_CONTAINER_LOOKUP: dict[str, FlintContainer][source]
flint.containers.LIST_OF_KNOWN_CONTAINERS[source]
flint.containers.aegean_contaer[source]
flint.containers.aoflagger_contaer[source]
flint.containers.askapsoft_contaer[source]
flint.containers.calibrate_container[source]
flint.containers.casa_container[source]
flint.containers.potato_container[source]
flint.containers.wsclean_container[source]