doot.workflow.structs.artifact

Classes

TaskArtifact

A Location, but specialized to represent artifacts/files

Module Contents

class doot.workflow.structs.artifact.TaskArtifact(*args: Any, **kwargs: Any)[source]

Bases: jgdv.structs.locator.Location

A Location, but specialized to represent artifacts/files

An concrete or abstract artifact a task can produce or consume.

Tasks can depend on both concrete and abstract: depends_on=[‘file:>/a/file.txt’, ‘file:>*.txt’, ‘file:>?.txt’] and can be a requirement for concrete or solo abstract artifacts: required_for=[‘file:>a/file.txt’, ‘file:>?.txt’]

Parameters:
  • args (Any)

  • kwargs (Any)

priority: int
property parent: pathlib.Path[source]
Return type:

pathlib.Path

is_stale(
*,
delta: jgdv.Maybe[jgdv.TimeDelta] = None,
) bool[source]

whether the artifact itself is stale delta defaults to 1 day

Parameters:

delta (jgdv.Maybe[jgdv.TimeDelta])

Return type:

bool

reify(
other: pathlib.Path | jgdv.structs.locator.Location,
) jgdv.Maybe[TaskArtifact][source]

Apply a more concrete path onto this location

Parameters:

other (pathlib.Path | jgdv.structs.locator.Location)

Return type:

jgdv.Maybe[TaskArtifact]

exists() bool[source]
Return type:

bool

is_concrete() bool[source]
Return type:

bool

get_status() doot.workflow._interface.ArtifactStatus_e[source]

Get the status of the artifact, To start, either declared, or exists. TODO: add a stale check TODO: add a to-clean check

Return type:

doot.workflow._interface.ArtifactStatus_e