mafw.models

Model helpers shared across MAFw.

class mafw.models.FilterSchema(root_model: type[~mafw.db.db_model.MAFwBaseModel], allowed_models: tuple[type[~mafw.db.db_model.MAFwBaseModel], ...] = <factory>)[source]

Bases: object

Static descriptor of the models available to the GUI filter builder.

Parameters:
  • root_model – Model that controls the primary query entry point.

  • allowed_models – Supplementary models that can be joined during filtering.

class mafw.models.LoopItem(i_item: int, n_item: int, payload: Any)[source]

Bases: object

Container for a loop item and its position.

i_item: int

Index of the item within the loop.

n_item: int

Total number of items in the loop.

payload: Any

The item payload.

class mafw.models.LoopResult(i_item: int, n_item: int, looping_status: LoopingStatus, payload: Any, duration: float)[source]

Bases: object

Container for a loop result and its status.

duration: float

Wall clock duration of the item processing.

i_item: int

Index of the item within the loop.

looping_status: LoopingStatus

Looping status produced while processing the item.

n_item: int

Total number of items in the loop.

payload: Any

Optional result payload returned by the processor.

class mafw.models.ParameterSchema(name: str, annotation: type | None, default: Any, help: str | None, is_list: bool, is_dict: bool)[source]

Bases: object

Static metadata describing a single processor parameter.

Parameters:
  • name – Symbolic name used in steering files.

  • annotation – Optional type hint supplied by the processor definition.

  • default – The default value declared on the descriptor.

  • help – Documentation text that should be surfaced to the user.

  • is_list – True if the parameter expects a list-like value.

  • is_dict – True if the parameter expects a dict-like value.

class mafw.models.ProcessorSchema(parameters: List[ParameterSchema], filter: FilterSchema | None)[source]

Bases: object

Static metadata describing a processor.

Parameters:
  • parameters – List of parameter schemas.

  • filter – Optional filter schema.

get_parameter(parameter_name: str) ParameterSchema[source]

Return the parameter schema for the given parameter name.

get_parameter_names() list[str][source]

Return the list of parameter names.

Modules

filter_schema

Static metadata describing the models available for filtering.

loop_payloads

Loop payload dataclasses for parallel processors.

parameter_schema

Schemas describing processor parameters.

processor_schema

Schemas describing a processor.