mafw.steering.models
Domain models for steering metadata construction.
- Author:
Bulgheroni Antonio
- Description:
Simple dataclasses that hold editable steering metadata without execution logic.
Classes
|
A single filter condition. |
|
Conditional filter applied to a model. |
|
Database section content mirrored from the steering file. |
|
Filter applied to a single field of a specific model. |
|
Metadata about a model field. |
|
Base configuration for a filter. |
|
The kind of filter configuration. |
|
Top-level globals that appear outside any processor or group table. |
|
Configuration for a logical processor group section. |
|
Filter applied to a specific database model. |
|
Metadata about a database model. |
|
Configuration and status for a single processor parameter. |
|
Schema reconciliation status for a processor parameter. |
|
Origin of a processor parameter value in the GUI pipeline. |
|
Configuration store for an individual processor or replica section. |
|
Reference to a processor entry used in processors_to_run lists. |
|
Schema reconciliation status for a processor. |
|
User-interface section content mirrored from the steering file. |
- class mafw.steering.models.Condition(operator: str | LogicalOp, value: Any, is_implicit: bool = True, is_valid: bool = True)[source]
Bases:
objectA single filter condition.
- class mafw.steering.models.ConditionalFilterConfig(name: str, enabled: bool = True, model: str = '', condition: Condition | None = None, then_clause: Condition | None = None, else_clause: Condition | None = None, condition_field: str = '', then_field: str = '', else_field: str | None = None, auto_named: bool = False)[source]
Bases:
FilterConfigConditional filter applied to a model.
- Semantics:
IF condition THEN then_clause ELSE else_clause
- class mafw.steering.models.DBConfiguration(url: str | None = None, pragmas: ~typing.Dict[str, ~typing.Any] = <factory>, attributes: ~typing.Dict[str, ~typing.Any] = <factory>, enabled: bool = True)[source]
Bases:
objectDatabase section content mirrored from the steering file.
- Parameters:
url – Optional database URL connection string.
pragmas – SQLite pragma settings to apply on connection.
attributes – Additional arbitrary attributes for the database configuration.
enabled – Whether
DBConfigurationshould be serialized.
- class mafw.steering.models.FieldFilterConfig(name: str, enabled: bool = True, model: str = '', field_name: str = '', conditions: Dict[str, Condition] = <factory>, logic_str_original: Optional[str] = None, logic_buffer: Optional[str] = None, logic_ast: Optional[ExprNode] = None, logic_dirty: bool = False, logic_is_valid: bool = True)[source]
Bases:
FilterConfigFilter applied to a single field of a specific model.
Conditions are AND’ed by default unless a custom logical expression is defined via logic.
- property logic: str | None
Backward compatibility for logic string.
- class mafw.steering.models.FieldInfo(name: str, type: type, help_text: str | None = None)[source]
Bases:
objectMetadata about a model field.
- class mafw.steering.models.FilterConfig(name: str, enabled: bool = True, model: str = '')[source]
Bases:
ABCBase configuration for a filter.
- class mafw.steering.models.FilterKind(*values)[source]
Bases:
StrEnumThe kind of filter configuration.
- static _generate_next_value_(name, start, count, last_values)
Return the lower-cased version of the member name.
- class mafw.steering.models.GlobalSettings(processors_to_run: ~typing.List[str] = <factory>, analysis_name: str | None = None, analysis_description: str | None = None, new_only: bool | None = None, create_standard_tables: bool | None = None)[source]
Bases:
objectTop-level globals that appear outside any processor or group table.
- Parameters:
processors_to_run – Ordered list of processor or group names to execute.
analysis_name – Optional name for the analysis.
analysis_description – Optional description for the analysis.
new_only – Optional flag to process only new data.
create_standard_tables – Optional flag to create standard output tables.
- class mafw.steering.models.GroupConfig(name: str, processors: ~typing.List[str], description: str | None = None, attributes: ~typing.Dict[str, ~typing.Any] = <factory>)[source]
Bases:
objectConfiguration for a logical processor group section.
- Parameters:
name – Section name used to reference the group in
processors_to_run.processors – Ordered list of processor names and/or nested group names.
description – Optional documentation string for the group.
attributes – Additional arbitrary attributes for the group.
- class mafw.steering.models.ModelFilterConfig(name: str, enabled: bool = True, model: str = '', conditions: Dict[str, Condition] = <factory>, logic_str_original: Optional[str] = None, logic_buffer: Optional[str] = None, logic_ast: Optional[ExprNode] = None, logic_dirty: bool = False, logic_is_valid: bool = True)[source]
Bases:
FilterConfigFilter applied to a specific database model.
Each field condition is AND’ed by default unless a custom logical expression is provided via logic.
- property logic: str | None
Backward compatibility for logic string.
- class mafw.steering.models.ModelInfo(field_info: ~typing.Dict[str, ~mafw.steering.models.FieldInfo] = <factory>)[source]
Bases:
objectMetadata about a database model.
- class mafw.steering.models.ParameterConfig(name: str, value: Any = None, default: Any = None, source: ParameterSource = ParameterSource.CONFIG, status: ParameterSchemaStatus = ParameterSchemaStatus.OK, help: str | None = None, active_override: bool = False, type: Any = None)[source]
Bases:
objectConfiguration and status for a single processor parameter.
- Parameters:
name – The name of the parameter.
value – The current value of the parameter.
default – The default value of the parameter.
source – The source of the parameter value.
status – The schema reconciliation status of the parameter.
help – Documentation text for the parameter.
type – The type hint for the parameter.
- class mafw.steering.models.ParameterSchemaStatus(*values)[source]
Bases:
StrEnumSchema reconciliation status for a processor parameter.
- static _generate_next_value_(name, start, count, last_values)
Return the lower-cased version of the member name.
- class mafw.steering.models.ParameterSource(*values)[source]
Bases:
StrEnumOrigin of a processor parameter value in the GUI pipeline.
- static _generate_next_value_(name, start, count, last_values)
Return the lower-cased version of the member name.
- class mafw.steering.models.ProcessorConfig(name: str, parameters: Dict[str, ParameterConfig] = <factory>, processor_status: ProcessorSchemaStatus = ProcessorSchemaStatus.OK, filters: Dict[str, List[FilterConfig]] = <factory>, logic_str_original: Optional[str] = None, logic_buffer: Optional[str] = None, logic_ast: Optional[ExprNode] = None, logic_dirty: bool = False, logic_is_valid: bool = True, new_only: Optional[bool] = None, inheritance: Optional[bool] = None, has_filter_root: bool = True, schema_filter_models: List[str] = <factory>)[source]
Bases:
objectConfiguration store for an individual processor or replica section.
- Parameters:
name – Replica-aware section name (
ProcessororProcessor#Replica).parameters – Parameter configurations and status.
processor_status – Schema reconciliation status for the processor.
filters – Mapping from model name to list of filter configuration objects.
logic_str_original – Optional
__logic__string stored in the per-filter table.new_only – Optional
__new_only__override.inheritance – Optional
__inheritance__flag for replicas.has_filter_root – Whether the filter table includes a root entry.
- property filter_logic: str | None
Backward compatibility for filter_logic string.
- class mafw.steering.models.ProcessorRef(base_name: str, replica: str | None = None)[source]
Bases:
objectReference to a processor entry used in processors_to_run lists.
- Parameters:
base_name – The canonical name of the processor without replica suffix.
replica – Optional replica identifier appended to the base name with
#.
- property full_name: str
Return the replica-aware full identifier for this reference.
- class mafw.steering.models.ProcessorSchemaStatus(*values)[source]
Bases:
StrEnumSchema reconciliation status for a processor.
- static _generate_next_value_(name, start, count, last_values)
Return the lower-cased version of the member name.
- class mafw.steering.models.UIConfiguration(interface: str = 'rich')[source]
Bases:
objectUser-interface section content mirrored from the steering file.
- Parameters:
interface – The interface type to use (e.g.,
rich).
- mafw.steering.models._field_type_from_peewee(field_obj: Any) type[source]
Extract a primitive type from the given Peewee field definition.
- mafw.steering.models._normalize_field_type(field_type: Any) type[source]
Normalize a field descriptor to a supported Python primitive.
- mafw.steering.models._FIELD_TYPE_STRINGS: dict[str, type] = {'AUTO': <class 'int'>, 'BIGINT': <class 'int'>, 'BOOL': <class 'bool'>, 'BOOLEAN': <class 'bool'>, 'CHAR': <class 'str'>, 'DATE': <class 'str'>, 'DATETIME': <class 'str'>, 'DECIMAL': <class 'float'>, 'DOUBLE': <class 'float'>, 'FLOAT': <class 'float'>, 'INT': <class 'int'>, 'INTEGER': <class 'int'>, 'NUMERIC': <class 'float'>, 'REAL': <class 'float'>, 'SMALLINT': <class 'int'>, 'STRING': <class 'str'>, 'TEXT': <class 'str'>, 'TIME': <class 'str'>, 'TINYINT': <class 'int'>, 'VARCHAR': <class 'str'>}
Mapping from Peewee field_type strings to Python primitives.