Task

class of dascore.workflow.task
inherits from: DascoreBaseModel, pydantic.main.BaseModel
source

Task()-> None

Base class for a fingerprintable, serializable operation.

Subclasses declare their parameters as fields and implement run. Every instance is frozen, so a task can be shared, cached and reused; changing one means making another with update.

What run takes is what the task is given when it runs, positionally and in the order its parameters are declared; everything the task was configured with is a field. Inputs go by position rather than by name because the order they are given in is part of what the task did.

An array given as a parameter is marked read-only in place, as a patch’s data is, so that the fingerprint cannot come to describe values the task no longer holds. Nothing is copied, so the array marked is the caller’s own: pass a copy of a buffer which is still being written to.

Methods

Name Description
fingerprint_at Return the fingerprint this task has at a stated version.
from_dict Return the task a document describes.
load Return the task a file holds; see
new Create new instance with some attributed updated.
run Execute the task. Subclasses must implement this.
save Write this task to a file, and return where it was written.
to_dict Return a document which describes this task.
update Return a new task with some parameters changed.