doot.workflow.structs.action_spec

Classes

ActionSpec

When an action isn't a full blown class, it gets wrapped in this,

Module Contents

class doot.workflow.structs.action_spec.ActionSpec(/, **data: Any)[source]

Bases: pydantic.BaseModel, jgdv._abstract.protocols.general.Buildable_p

When an action isn’t a full blown class, it gets wrapped in this, which passes the action spec to the callable.

TODO: recogise arg prefixs and convert to correct type. eg: path:a/relative/path -> Path(./a/relative/path) path:/usr/bin/python -> Path(/usr/bin/python)

Parameters:

data (Any)

do: jgdv.Maybe[jgdv.structs.strang.CodeReference] = None
args: list[Any] = None
kwargs: jgdv.structs.chainguard.ChainGuard = None
fun: jgdv.Maybe[jgdv.Func] = None
classmethod build(
data: dict | list | jgdv.structs.chainguard.ChainGuard | ActionSpec,
*,
fun: jgdv.Maybe[collections.abc.Callable] = None,
) ActionSpec[source]
Parameters:
Return type:

ActionSpec

_validate_do(
val: jgdv.Maybe[str | jgdv.structs.strang.CodeReference | collections.abc.Callable],
) jgdv.Maybe[jgdv.structs.strang.CodeReference][source]
Parameters:

val (jgdv.Maybe[str | jgdv.structs.strang.CodeReference | collections.abc.Callable])

Return type:

jgdv.Maybe[jgdv.structs.strang.CodeReference]

property params: jgdv.structs.chainguard.ChainGuard[source]
Return type:

jgdv.structs.chainguard.ChainGuard

set_function(
*,
fun: jgdv.Maybe[doot.workflow._interface.Action_p | jgdv.Func | type | ImportError] = None,
) None[source]

Sets the function of the action spec. if given a class, the class is built, if given a callable, that is used directly.

Parameters:

fun (jgdv.Maybe[doot.workflow._interface.Action_p | jgdv.Func | type | ImportError])

Return type:

None

abstractmethod verify(
state: dict,
*,
fields: jgdv.Maybe[list[str]] = None,
) None[source]
Parameters:
Return type:

None

verify_out(state: dict) None[source]
Parameters:

state (dict)

Return type:

None