Input / Output#

These nodes allow getting data in and out of workflows via parameters.

General purpose tasks for data input / output.

class maize.steps.io.Dummy(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

A dummy node to connect to unused but optional input ports.

out: Output[Any]

Dummy output with type Any, nothing will be sent

class maize.steps.io.LoadData(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

Provides data passed as a parameter to an output channel.

data: Parameter[T]

Data to be sent to the output verbatim

out: Output[T]

Data output

class maize.steps.io.LoadFile(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

Provides a file specified as a parameter on an output.

file: FileParameter[P]

Path to the input file

out: Output[P]

File output

class maize.steps.io.LoadFiles(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

Provides multiple files specified as a parameter on an output channel.

files: Parameter[list[P]]

Paths to the input files

out: Output[list[P]]

File output channel

class maize.steps.io.Log(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

Logs any received data and sends it on

inp: Input[T]

Data input

out: Output[T]

Data output

class maize.steps.io.LogResult(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

Receives data and logs it.

inp: Input[Any]

Data input

class maize.steps.io.Return(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

Return a value from the input to a specialized queue to be captured by the main process.

Examples

>>> save = graph.add(Return[float])
>>> # Define your workflow as normal...
>>> graph.execute()
>>> save.get()
3.14159

Note that get() will pop the item from the internal queue, this means the item will be lost if not assigned to a variable.

get() T | None[source]

Returns the passed value

class maize.steps.io.SaveFile(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

Receives a file and saves it to a specified location.

You must parameterise the node with the appropriate filetype, or just Path. If the destination doesn’t exist, a folder will be created.

destination: FileParameter[P]

The destination file or folder

inp: Input[P]

File input

overwrite: Parameter[bool]

If True will overwrite any previously existing file in the destination

class maize.steps.io.SaveFiles(parent: Graph | None = None, name: str | None = None, description: str | None = None, fail_ok: bool = False, n_attempts: int = 1, level: int | str | None = None, cleanup_temp: bool = True, resume: bool = False, logfile: Path | None = None, max_cpus: int | None = None, max_gpus: int | None = None, loop: bool | None = None, max_loops: int = -1, initial_status: Status = Status.NOT_READY)[source]

Receives multiple files and saves them to a specified location.

You must parameterise the node with the appropriate filetype, or just Path.

destination: FileParameter[P]

The destination folder

inp: Input[list[P]]

Files input

overwrite: Parameter[bool]

If True will overwrite any previously existing file in the destination

class maize.steps.io.Void(max_loops: int = -1, initial_status: Status = Status.NOT_READY, **kwargs: Any)[source]

A node that swallows whatever input it receives.

inp: Input[Any]

Void input, a bit like /dev/null