Pinion

class caliber.Pinion(name: str | None = None)[source]

A Pinion which can run workflows.

Parameters:

name (str) – The name of the pinion.

listen(project_id: str | None = None, model_name: str | None = None, wait_for: int = 1, attempts: int = 10) None[source]

Start listening for relevant workloads.

If a local workflow queue is set up, the Pinion looks for workflows in ‘.caliberwfqueue’. If a remote workflow queue is set up, the Pinion looks for workflows at the selected Speckle project. See also WorkflowQueue.

Parameters:
  • project_id (Optional[str]) – The ID of the project to listen to.

  • model_name (Optional[str]) – The name of the model to search through. The default name is ‘caliber’.

  • wait_for (int) – The number of seconds to wait between each attempt.

  • attempts (int) – The number of attempts the Pinion will make before stopping.

run(workload: Workload) Tuple[bool, Results | None, str | None][source]

Run a workload. Note that the workload is usually passed directly by the pinion itself after receiving it from the workflow queue.

Parameters:

workload (Workload) – The Caliber Workload which describes the workflow and relevant metadata for the pinion to handle.