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:
objectOne line of the
REQUIRED OUTPUT FORMATblock.- Variables:
name (str) – Field label as the model should write it (
'CHS Level').kind (str) –
'category'(choose one ofoptions),'number'(withinminimum..``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
Render the
Name: [hint]line of the plain-text output format.Render the value shown in the JSON schema variant of the output.
The bracketed hint written after the field name.