tomato package

tomato.set_loglevel(loglevel: int)
tomato.parse_args(parser, verbose, is_tomato=False)
tomato.run_tomato()
tomato.run_ketchup()
tomato.run_passata()

Subpackages

Submodules

tomato.drivers: Shim interfacing with tomato driver packages

Code author: Peter Kraus

tomato.drivers.driver_to_interface(drivername: str) None | ModelInterface

tomato.models: Pydantic models for internal tomato use

Code author: Peter Kraus

pydantic model tomato.models.Task

Bases: BaseModel

The Task is a driver/device-independent abstraction describing the measurement steps. The driver-specific information for the Task can be provided via the technique_name and task_params parameters.

Show JSON schema
{
   "title": "Task",
   "description": "The :class:`Task` is a driver/device-independent abstraction describing the\nmeasurement steps. The driver-specific information for the :class:`Task` can be\nprovided via the :obj:`technique_name` and :obj:`task_params` parameters.",
   "type": "object",
   "properties": {
      "component_role": {
         "title": "Component Role",
         "type": "string"
      },
      "max_duration": {
         "title": "Max Duration",
         "type": "number"
      },
      "sampling_interval": {
         "title": "Sampling Interval",
         "type": "number"
      },
      "polling_interval": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Polling Interval"
      },
      "technique_name": {
         "title": "Technique Name",
         "type": "string"
      },
      "task_name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Task Name"
      },
      "task_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Task Params"
      },
      "start_with_task_name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Start With Task Name"
      },
      "stop_with_task_name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Stop With Task Name"
      }
   },
   "additionalProperties": false,
   "required": [
      "component_role",
      "max_duration",
      "sampling_interval",
      "technique_name"
   ]
}

Config:
  • extra: str = forbid

Validators:
field component_role: str [Required]

role of the pipeline component on which this Task should run

Validated by:
field max_duration: float [Required]

the maximum duration of this Task, in seconds

Validated by:
field sampling_interval: float [Required]

the interval between measurements, in seconds

Validated by:
field polling_interval: float | None = None

the interval between polling for data by the tomato-job process, in seconds; defaults to the value in driver settings

Validated by:
field technique_name: str [Required]

the name of the technique; has to match one of the capabilities of the component on which this Task will be executed

Validated by:
field task_name: str | None = None

the (optional) name of the current Task; can be used for triggering other Task in parallel to this one via start_with_task_name

Validated by:
field task_params: Dict[str, Any] | None [Optional]

a dict of any additional parameters required to specify the experimental technique; the key-value pairs of this dict will be used as attr-val pairs by the set_attr() method of the component executing this Task

Validated by:
field start_with_task_name: str | None = None

the task_name of the Task that this Task should be started in parallel with; when set, this Task will wait for execution until a Task with the matching task_name is started

Validated by:
field stop_with_task_name: str | None = None

the task_name of the Task that, when started, will stop the execution of this Task; when set, this Task will execute normally, but if a a Task with the matching task_name is started, this Task will be stopped

Validated by:
validator task_names_cannot_be_same  »  all fields
validator convert_str_to_seconds  »  max_duration, sampling_interval, polling_interval