Skip to content

mecfs_bio.build_system.wf.base_wf

Classes:

  • WF

    An interface to the external world.

Functions:

  • make_wf

    Construct a WF, defaulting any capability not explicitly supplied.

WF

An interface to the external world.

To add a new capability, add an attribute here and a corresponding parameter to make_wf with an appropriate default.

Methods:

Attributes:

downloader instance-attribute

downloader: WFDownloader

synapse_downloader instance-attribute

synapse_downloader: SynapseDownloader

download_from_synapse

download_from_synapse(
    synid: str, dest_dir: Path, expected_name: str
) -> Path

Download the single file at synid into dest_dir and return its path.

Source code in mecfs_bio/build_system/wf/base_wf.py
def download_from_synapse(
    self, synid: str, dest_dir: Path, expected_name: str
) -> Path:
    """Download the single file at synid into dest_dir and return its path."""
    return self.synapse_downloader.download(synid, dest_dir, expected_name)

download_from_url

download_from_url(
    url: str, local_path: Path, md5_hash: str | None
) -> None
Source code in mecfs_bio/build_system/wf/base_wf.py
def download_from_url(
    self, url: str, local_path: Path, md5_hash: str | None
) -> None:
    self.downloader.download(url, local_path, md5_hash)

make_wf

make_wf(
    downloader: WFDownloader | None = None,
    synapse_downloader: SynapseDownloader | None = None,
) -> WF

Construct a WF, defaulting any capability not explicitly supplied.

Source code in mecfs_bio/build_system/wf/base_wf.py
def make_wf(
    downloader: WFDownloader | None = None,
    synapse_downloader: SynapseDownloader | None = None,
) -> WF:
    """Construct a WF, defaulting any capability not explicitly supplied."""
    return WF(
        downloader=downloader if downloader is not None else SimpleWFDownloader(),
        synapse_downloader=(
            synapse_downloader
            if synapse_downloader is not None
            else SharedClientSynapseDownloader()
        ),
    )