stoner_measurement.plugins.sequence.base.TopLevelSequence¶
- class stoner_measurement.plugins.sequence.base.TopLevelSequence[source]¶
Bases:
SequencePluginConcrete root container for the entire measurement sequence.
TopLevelSequencerepresents the invisible top-level node in the sequence tree. Itsexecute_sequence()implementation simply calls each sub-step callable in order, making it a transparent pass-through.Unlike
StateControlPlugin, this class is pure Python — it does not inherit fromQObjectand therefore has no Qt signals or event-loop dependencies.The engine namespace is shared automatically because the
SequenceEnginemaintains a single flatdictfor the duration of a run.- Variables:
name (str) – Always
"Sequence".
Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> from stoner_measurement.plugins.sequence import TopLevelSequence >>> seq = TopLevelSequence() >>> seq.plugin_type 'sequence' >>> seq.name 'Sequence' >>> called = [] >>> seq.execute_sequence([lambda: called.append("a"), lambda: called.append("b")]) >>> called ['a', 'b']
- execute_sequence(sub_steps: list) None[source]¶
Call each sub-step callable in order.
- Parameters:
sub_steps (list) – Ordered list of zero-argument callables.
Examples
>>> from stoner_measurement.plugins.sequence import TopLevelSequence >>> seq = TopLevelSequence() >>> results = [] >>> seq.execute_sequence([lambda: results.append(1)]) >>> results [1]