OutputField#

class rapidtools.gui.OutputField(name: str, kind: str = 'category', options: list[str] = <factory>, minimum: float | None = None, maximum: float | None = None, description: str = '')[source]#

Bases: object

One line of the REQUIRED OUTPUT FORMAT block.

Variables:
  • name (str) – Field label as the model should write it ('CHS Level').

  • kind (str) – 'category' (choose one of options), 'number' (within minimum..``maximum``), 'text' or 'boolean'.

  • options (list[str]) – Allowed values for a categorical field.

  • minimum (float | None) – Lower bound of a numeric field, if any.

  • maximum (float | None) – Upper bound of a numeric field, if any.

  • description (str) – How to fill the field ('2-3 sentences citing ...').

Example

>>> OutputField('Confidence', kind='number', minimum=1, maximum=3).format_line()
'Confidence: [number from 1 to 3]'

Methods

format_line

Render the Name: [hint] line of the plain-text output format.

json_hint

Render the value shown in the JSON schema variant of the output.

placeholder

The bracketed hint written after the field name.

property key: str#

The snake_case attribute key the analyzer will produce.

placeholder() → str[source]#

The bracketed hint written after the field name.

format_line() → str[source]#

Render the Name: [hint] line of the plain-text output format.

json_hint() → Any[source]#

Render the value shown in the JSON schema variant of the output.