phenotypic.gui.builder._validation.validate#
- phenotypic.gui.builder._validation.validate(state: _DagBuilderState) List[Issue][source]#
Run all validation rules across every scope reachable from the root.
Returns issues with
scope_pathpopulated so the UI can pan/zoom across container boundaries when an issue badge is clicked.- Parameters:
state (_DagBuilderState) – The current
BuilderState. Only thestate.rootscope (and its transitively nested scopes viaBlockNode.nested) is inspected;selected_block_id,breadcrumb,toast_queueetc. are ignored.- Returns:
rules emit in the order
missing_input/duplicate_input→fork→stub→required_aux/unknown_class→cycle→container_mode→stage_order_hint, and nested-scope issues are appended after the parent scope’s issues. The ordering is stable for snapshot-style tests.- Return type:
A flat list of
Issuerecords in deterministic order
Examples
An empty scope (only the auto-seeded
InputImageblock) passes every rule and returns an empty issue list. The synth-yeast fixture is loaded only to anchor the example in the project’s microbiology context — validation does not touch image data:>>> from phenotypic.data import load_synth_yeast_plate >>> from phenotypic.gui.builder._state import ( ... BuilderScope, BuilderState, ... ) >>> from phenotypic.gui.builder._validation import validate >>> state = BuilderState(root=BuilderScope()) >>> validate(state) [] >>> _ = load_synth_yeast_plate() # microbiology context anchor