new_job

Contents

new_job#

rapidtools.jobs.new_job(steps: Sequence[StepSpec | Mapping[str, Any]], output_dir: str | Path, name: str = '', created_by: Mapping[str, Any] | None = None, metadata: Mapping[str, Any] | None = None, base_dir: str | Path | None = None) → Job[source]#

Build a job in memory, ready to be saved or run.

Parameters:
  • steps (Sequence[StepSpec | Mapping[str, Any]]) – The steps, as StepSpec objects or step dictionaries.

  • output_dir (str | Path) – Folder every step writes into.

  • name (str) – Human-readable name. Defaults to the generated ID.

  • created_by (Mapping[str, Any] | None) – Who is writing the job.

  • metadata (Mapping[str, Any] | None) – Free-form notes.

  • base_dir (str | Path | None) – Folder relative paths are resolved against until the job is saved. Defaults to the working directory.

Returns:

Job – The validated job.

Example

>>> job = new_job(
...     [{'type': 'detect.aerial', 'inputs': {'raster': 'scene.tiff'},
...       'params': {'assets': ['building']}}],
...     output_dir='out', name='Detection')
>>> job.steps[0].id, job.name
('s1', 'Detection')