yasmin_editor.editor_gui.model_parameters module

Helpers for editor-facing parameter declarations and overwrite mappings.

These helpers keep the parameter editing rules out of the Qt mixins so the conversion and update logic can be tested directly. The editor still owns when those helpers are called, but this module owns how parameter declarations and child overwrite mappings are normalized.

yasmin_editor.editor_gui.model_parameters.apply_parameter_overwrites(container_model: StateMachine | Concurrence, child_model: State, overwrites: list[dict[str, Any]]) None

Apply one child overwrite table back into the container and child models.

The container keeps only declarations that remain referenced by at least one child after the update. Declaration order is preserved for existing entries, while newly introduced names are appended.

yasmin_editor.editor_gui.model_parameters.dicts_to_parameters(parameters: list[dict[str, Any]]) list[Parameter]

Normalize editor-table dictionaries back into parameter models.

yasmin_editor.editor_gui.model_parameters.get_parameter_overwrites_for_child(container_model: StateMachine | Concurrence, child_model: State) list[dict[str, Any]]

Return child overwrite rows enriched with declared parent metadata.

yasmin_editor.editor_gui.model_parameters.iter_declared_parameters(overwrites: list[dict[str, Any]]) list[Parameter]

Return normalized parent parameter declarations from overwrite rows.

yasmin_editor.editor_gui.model_parameters.iter_valid_overwrite_pairs(overwrites: list[dict[str, Any]]) list[tuple[str, str]]

Return valid child-to-parent overwrite pairs from editor rows.

yasmin_editor.editor_gui.model_parameters.normalize_parameter_name(value: Any) str

Return a stripped string representation for user-entered names.

yasmin_editor.editor_gui.model_parameters.parameters_to_dicts(parameters: list[Parameter]) list[dict[str, Any]]

Convert declared parameters into editor-table dictionaries.