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:
objectStatic 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:
objectContainer 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:
objectContainer 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: Any, default: Any, help: str | None, is_list: bool, is_dict: bool)[source]
Bases:
objectStatic metadata describing a single processor parameter.
- Parameters:
name – Symbolic name used in steering files.
annotation – Optional type hint supplied by the processor definition. It may be a plain
type, aAnnotatedform (carrying, for example, aPathRolemarker), or a parameterised generic such aslist[int].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, description: str | None = None)[source]
Bases:
objectStatic metadata describing a processor.
- Parameters:
parameters – List of parameter schemas.
filter – Optional filter schema.
description – First-line processor documentation for human-readable steering files.
Changed in version v2.4: Added the processor description used in steering file comments.
- get_parameter(parameter_name: str) ParameterSchema[source]
Return the parameter schema for the given parameter name.
Modules
Static metadata describing the models available for filtering. |
|
Loop payload dataclasses for parallel processors. |
|
Schemas describing processor parameters. |
|
Schemas describing a processor. |