mafw.steering.builder

Editable steering configuration builder independent from the execution engine.

Author:

Bulgheroni Antonio

Description:

Provides helpers to construct steering metadata without running processors.

Classes

SteeringBuilder()

Editable domain model for building MAFw steering files.

ValidationLevel(*values)

Validation tiers that can be requested from the steering builder.

class mafw.steering.builder.SteeringBuilder[source]

Bases: object

Editable domain model for building MAFw steering files.

classmethod from_toml(path: Path | str) SteeringBuilder[source]

Create a builder from an existing steering file while keeping TOML metadata.

classmethod from_toml_text(text: str) SteeringBuilder[source]

Create a builder from TOML text while keeping TOML metadata.

add_group(name: str, processors: Iterable[str], description: str | None = None) None[source]

Register a processor group.

add_processor(base_name: str, replica: str | None = None) None[source]

Add a processor reference to the global processors_to_run list.

add_replica(base_name: str, replica: str) None[source]

Create a replica entry without touching the base configuration.

clear_parameters(processor_full_name: str) None[source]

Clear every parameter override for a processor.

disable_db_configuration() None[source]

Prevent the DBConfiguration section from being emitted.

enable_db_configuration() None[source]

Ensure the DBConfiguration section will be serialized.

get_group(name: str) GroupConfig[source]

Return the stored configuration for a group section.

get_processor_config(full_name: str) ProcessorConfig[source]

Return the stored configuration for a processor or replica.

is_db_configuration_enabled() bool[source]

Return whether the DBConfiguration section should be present.

list_groups() list[str][source]

Return every group section name currently configured.

list_processors() list[str][source]

Return every processor section name currently configured.

remove_filter(processor_full_name: str, model_name: str) None[source]

Remove a filter model definition.

remove_group(name: str) None[source]

Delete a group by name.

remove_parameter(processor_full_name: str, key: str) None[source]

Remove a processor parameter override if present.

remove_processor(full_name: str) None[source]

Remove a processor or replica from the run list.

set_analysis_description(description: str | None) None[source]

Set analysis_description.

set_analysis_name(name: str | None) None[source]

Set analysis_name.

set_create_standard_tables(value: bool | None) None[source]

Set create_standard_tables.

set_db_attribute(key: str, value: Any | None) None[source]

Store a generic key/value pair inside DBConfiguration.

set_db_pragmas(pragmas: dict[str, Any]) None[source]

Set database pragmas.

set_db_url(url: str | None) None[source]

Override the database URL.

set_default() None[source]

Initialize globals, database, and UI defaults for a fresh builder.

set_filter_conditionals(processor_full_name: str, model_name: str, conditionals: list[dict[str, Any]] | None) None[source]

Assign __conditional__ blocks to a filter model.

set_filter_config(processor_full_name: str, model_name: str, config: dict[str, Any]) None[source]

Replace the configuration for a given filter model.

set_filter_field(processor_full_name: str, model_name: str, field: str, value: Any) None[source]

Set or update a single field within a filter model.

set_filter_logic(processor_full_name: str, logic: str | None) None[source]

Set the global __logic__ string for the processor filters.

set_new_only(value: bool | None) None[source]

Set the top-level new_only flag.

set_parameter(processor_full_name: str, key: str, value: Any) None[source]

Set a processor parameter.

set_processor_filters(processor_full_name: str, filters: dict[str, list[FilterConfig]], logic: str | None) None[source]

Update the filters and logic for a given processor.

set_processor_new_only(processor_full_name: str, new_only: bool | None) None[source]

Explicitly set __new_only__ for a processor or replica.

set_processors_to_run(processors: Iterable[str]) None[source]

Overwrite the processors_to_run list.

set_replica_inheritance(replica_full_name: str, inheritance: bool | None) None[source]

Toggle the inheritance behaviour for a replica.

set_ui_interface(interface: str) None[source]

Pick the interface used by UserInterface.

to_config_dict() dict[str, Any][source]

Return a plain dictionary representing the steering configuration.

to_document(*, validation_level: ValidationLevel | None = None) TOMLDocument[source]

Serialize the builder state into a TOML document.

validate(validation_level: ValidationLevel = ValidationLevel.SEMANTIC) list[ValidationIssue][source]

Run steering validation at the requested level and report every issue.

write(path: Path | str, *, validation_level: ValidationLevel | None = None) None[source]

Dump the builder to disk.

property document: TOMLDocument | None

Return the parsed TOML document this builder originated from.

property extra_globals: dict[str, Any]

Return extra top-level globals preserved from the steering file.

class mafw.steering.builder.ValidationLevel(*values)[source]

Bases: Enum

Validation tiers that can be requested from the steering builder.