Plugin modules¶
Plugin base classes¶
Plugins package for stoner_measurement.
This package provides the abstract base class hierarchy for all measurement plugins, along with built-in demonstration plugins.
The plugin classes are organised into type-specific sub-packages:
stoner_measurement.plugins.trace— collects (x, y) data traces from instruments (TracePlugin).stoner_measurement.plugins.state— shared abstract ancestor for both state-scan and state-sweep plugin families (StatePlugin).stoner_measurement.plugins.state_scan— controls experimental state (field, temperature, motor position, etc.) via discrete-step scanning (StateScanPlugin).stoner_measurement.plugins.state_sweep— executes sub-sequences in a generator-driven sweep loop (StateSweepPlugin).stoner_measurement.plugins.monitor— passively records auxiliary quantities at regular intervals (MonitorPlugin).stoner_measurement.plugins.transform— performs pure-computation transforms or reductions on collected data (TransformPlugin).stoner_measurement.plugins.sequence— abstract mixin for plugins that may contain nested sub-steps in the sequence tree (SequencePlugin,TopLevelSequence).stoner_measurement.plugins.command— executes a single action in the sequence without instrument lifecycle steps (CommandPlugin,SaveCommand,PlotTraceCommand,DetailsCommand).
Built-in example plugins:
DummyPlugin— hardware-free RSJ I-V model (instoner_measurement.plugins.trace).CounterPlugin— hardware-free counter (instoner_measurement.plugins.state_scan).
Legacy aliases:
StateControlPlugin— alias forStateScanPlugin(instoner_measurement.plugins.state_control).
Classes¶
|
Abstract root class shared by all measurement plugins. |
|
Abstract base class for sequence-engine command plugins. |
|
A simple counter that tracks the current scan set-point as its state. |
|
Command plugin that records measurement metadata in the sequence script. |
|
Abstract base class for plugins that passively record experimental state. |
|
Command plugin that plots trace data to the main plot window. |
|
Command plugin that saves current trace or state-control data to disc. |
|
Abstract base class for plugins that act as containers in the sequence tree. |
|
|
|
Abstract base class shared by |
|
Abstract base class for plugins that control experimental state via discrete-step scanning. |
|
Base class for plugins that run a sub-sequence inside a continuous sweep loop. |
|
State-sweep plugin that sweeps elapsed time. |
|
Concrete root container for the entire measurement sequence. |
|
Container for a single measurement trace with optional error bars and metadata. |
|
Abstract base class for plugins that collect (x, y) data traces. |
|
Abstract base class for plugins that transform or reduce data. |
Class Inheritance Diagram¶

Abstract base class for all measurement plugins.
A plugin must:
Inherit from
BasePlugin.Override
nameto provide a unique string identifier.Optionally override
config_widget()to supply a configurationQWidgetthat will appear as a tab in the right-hand panel.Optionally override
config_tabs()to contribute multiple labelled tabs to the configuration panel.Optionally override
monitor_widget()to contribute a live-status widget to the left dock panel.
Concrete plugin behaviour is added by subclassing one of the six specialised
sub-types: TracePlugin,
StateControlPlugin,
MonitorPlugin,
TransformPlugin,
SequencePlugin, or
CommandPlugin.
Classes¶
|
Helper class that provides a standard way to create an ABC using inheritance. |
|
Metaclass for defining Abstract Base Classes (ABCs). |
|
Special type indicating an unconstrained type. |
|
Abstract root class shared by all measurement plugins. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Variables¶
|
bool(x) -> bool |
|
Class Inheritance Diagram¶

Trace plugins¶
Trace sub-package — plugins that collect (x, y) data traces from instruments.
Exports TracePlugin (abstract base), TraceData, and
TraceStatus from stoner_measurement.plugins.trace.base, and
DummyPlugin from stoner_measurement.plugins.trace.dummy.
The private helper classes _ScanTabContainer and _ScanPage
are also re-exported for internal use and testing.
Classes¶
|
A built-in demo plugin that generates RSJ model I-V data with optional noise. |
|
Container for a single measurement trace with optional error bars and metadata. |
|
Abstract base class for plugins that collect (x, y) data traces. |
|
Operational status of a |
|
Combined scan configuration page. |
|
Container that hosts the active scan generator's config widget. |
Class Inheritance Diagram¶

TracePlugin — abstract base class for plugins that collect (x, y) traces.
Trace plugins acquire a complete sequence of (x, y) data points from one or more instrument channels. Examples include current-voltage characteristics, frequency sweeps, and time-series captures.
All TracePlugin subclasses share a standard lifecycle API used by the sequence engine:
connect()— open instrument connections and verify the instrument identity.configure()— push plugin settings to the instrument.measure()— trigger and collect the complete multipoint trace, returning all(channel, x, y)points as a list.disconnect()— cleanly release all reserved resources.
Status during these operations is reported via the status
property and the status_changed signal using the
TraceStatus enum.
Classes¶
|
Special type indicating an unconstrained type. |
|
Scan generator that evaluates a user-defined |
|
Abstract root class shared by all measurement plugins. |
|
Abstract base class for all scan generators. |
|
Scan generator that produces values from a standard waveform function. |
|
|
|
|
|
Scan generator that visits an explicit list of target values. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scan generator that ramps from |
|
Scan generator that builds a sequence from a series of target–step stages. |
|
Container for a single measurement trace with optional error bars and metadata. |
|
Abstract base class for plugins that collect (x, y) data traces. |
|
Operational status of a |
|
types is normally a sequence of individual types. |
Variables¶
|
Special type construct to mark class variables. |
|
bool(x) -> bool |
|
Class Inheritance Diagram¶

Dummy plugin — ships with the package for demonstration and testing.
The DummyPlugin computes the DC I-V characteristic of a resistively
shunted Josephson junction (RSJ model). It requires no hardware and is useful
as a smoke-test and worked example.
Classes¶
|
Special type indicating an unconstrained type. |
|
A built-in demo plugin that generates RSJ model I-V data with optional noise. |
|
Scan generator that produces values from a standard waveform function. |
|
|
|
|
|
|
|
|
|
Abstract base class for plugins that collect (x, y) data traces. |
|
Operational status of a |
Variables¶
|
|
|
Convert a string or number to a floating-point number, if possible. |
|
Convert a string or number to a floating-point number, if possible. |
Class Inheritance Diagram¶

State plugins¶
State plugin package — shared abstract base for state-scan and state-sweep plugins.
Exports StatePlugin, the common ancestor for both
StateScanPlugin and
StateSweepPlugin.
Classes¶
|
Abstract base class shared by |
Class Inheritance Diagram¶

StatePlugin — abstract common ancestor for state-scan and state-sweep plugins.
Both StateScanPlugin and
StateSweepPlugin share a
common set of fields and methods that are defined here once and inherited by
both families:
iteration state (
ix,value,stage,meas_flag)data-collection settings and the collected
DataFramecollect()/clear_data()lifecycle helpersinstance_name_changedsignal with auto-update ofcollect_filterstate_changed,state_reached,state_errorprogress signalslimitsproperty (default: no limits)abstract
state_nameandunitspropertiesNOP instrument-lifecycle hooks (
connect,configure,disconnect)reported_values()helper
Classes¶
|
Special type indicating an unconstrained type. |
|
|
|
Abstract base class for plugins that act as containers in the sequence tree. |
|
Abstract base class shared by |
|
types is normally a sequence of individual types. |
Variables¶
|
Class Inheritance Diagram¶

State scan plugins¶
State-scan sub-package — plugins that command hardware to move to set-points.
Exports StateScanPlugin (abstract base) and CounterPlugin
(built-in example implementation).
Classes¶
|
A simple counter that tracks the current scan set-point as its state. |
|
Abstract base class for plugins that control experimental state via discrete-step scanning. |
Class Inheritance Diagram¶

StateScanPlugin — abstract base class for discrete-step, ramp-to-target state control.
State-scan plugins command hardware to move to a target value and report when the hardware has settled. Examples include magnet power-supplies, temperature controllers, motorised stages, and programmable voltage sources.
A StateScanPlugin is the natural “axis” driven by a
BaseScanGenerator: the generator yields
successive set-point values that are forwarded to ramp_to().
Classes¶
|
Special type indicating an unconstrained type. |
|
Scan generator that evaluates a user-defined |
|
Abstract base class for all scan generators. |
|
|
|
Scan generator that produces values from a standard waveform function. |
|
Scan generator that visits an explicit list of target values. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scan generator that ramps from |
|
Abstract base class shared by |
|
Abstract base class for plugins that control experimental state via discrete-step scanning. |
|
Scan generator that builds a sequence from a series of target–step stages. |
|
types is normally a sequence of individual types. |
Variables¶
|
Special type construct to mark class variables. |
|
Class Inheritance Diagram¶

CounterPlugin — a simple example state-scan plugin that counts through a scan.
The CounterPlugin is a minimal, hardware-free implementation of
StateScanPlugin. It maintains
an internal integer counter whose value is set directly to each set-point
supplied by the scan generator. Because the state transition is instantaneous
there is no settling delay; is_at_target() always returns True.
This plugin is intended as a worked example showing how to implement a
StateScanPlugin from scratch.
Classes¶
|
A simple counter that tracks the current scan set-point as its state. |
|
Abstract base class for plugins that control experimental state via discrete-step scanning. |
Variables¶
|
Class Inheritance Diagram¶

State sweep plugins¶
State-sweep plugins.
Classes¶
|
Base class for plugins that run a sub-sequence inside a continuous sweep loop. |
|
State-sweep plugin that sweeps elapsed time. |
Class Inheritance Diagram¶

Base class for state-sweep plugins.
Classes¶
|
Special type indicating an unconstrained type. |
|
Abstract base class for generators used by state-sweep plugins. |
|
|
|
Set measure flags when monitored outputs change beyond configured thresholds. |
|
Sweep generator that ramps through target/rate segments. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Abstract base class shared by |
|
Base class for plugins that run a sub-sequence inside a continuous sweep loop. |
|
types is normally a sequence of individual types. |
Variables¶
|
Special type construct to mark class variables. |
|
Class Inheritance Diagram¶

Time-based state-sweep plugin.
Classes¶
|
Set measure flags when monitored outputs change beyond configured thresholds. |
|
Sweep generator that ramps through target/rate segments. |
|
Base class for plugins that run a sub-sequence inside a continuous sweep loop. |
|
State-sweep plugin that sweeps elapsed time. |
Variables¶
|
Class Inheritance Diagram¶

State control plugins¶
State-control sub-package — backward-compatibility shim.
state_control is kept as a compatibility alias for state_scan.
New code should import from stoner_measurement.plugins.state_scan
directly.
Exports StateScanPlugin under the legacy name
StateControlPlugin, and CounterPlugin.
Classes¶
|
A simple counter that tracks the current scan set-point as its state. |
|
Class Inheritance Diagram¶

Backward-compatibility shim — re-exports StateScanPlugin as StateControlPlugin.
New code should use stoner_measurement.plugins.state_scan directly.
Classes¶
|
Class Inheritance Diagram¶

Backward-compatibility shim — re-exports CounterPlugin from state_scan.
New code should use stoner_measurement.plugins.state_scan directly.
Classes¶
|
A simple counter that tracks the current scan set-point as its state. |
Class Inheritance Diagram¶

Monitor plugins¶
Monitor sub-package — plugins that passively record experimental state.
Exports MonitorPlugin (abstract base) from
stoner_measurement.plugins.monitor.base.
Classes¶
|
Abstract base class for plugins that passively record experimental state. |
Class Inheritance Diagram¶

MonitorPlugin — abstract base class for passive experimental-state recorders.
Monitor plugins poll hardware at regular intervals and record auxiliary
experimental quantities such as temperature, ambient pressure, elapsed time,
or lock-in phase. They run independently from trace acquisition and are
managed by an internal QTimer.
Classes¶
|
Abstract root class shared by all measurement plugins. |
|
|
|
Abstract base class for plugins that passively record experimental state. |
|
|
|
|
|
types is normally a sequence of individual types. |
Variables¶
|
Class Inheritance Diagram¶

Sequence plugins¶
Sequence sub-package — container plugins for the measurement sequence tree.
Exports SequencePlugin (abstract base) and TopLevelSequence
(concrete root container) from stoner_measurement.plugins.sequence.base.
Classes¶
|
Abstract base class for plugins that act as containers in the sequence tree. |
|
Concrete root container for the entire measurement sequence. |
Class Inheritance Diagram¶

SequencePlugin — abstract base class for plugins that contain sub-sequences.
Any plugin that should be able to act as a container in the sequence tree —
i.e. accept other steps nested beneath it — must inherit from
SequencePlugin. StateControlPlugin
uses this base class so that multi-dimensional scans can be expressed as
arbitrarily deep trees.
The module also provides TopLevelSequence, a concrete non-Qt
implementation that acts as the root container for the whole measurement
sequence. It shares the engine namespace with all nested plugins because the
SequenceEngine uses a single
flat dict as the execution namespace throughout a run.
Classes¶
|
Abstract root class shared by all measurement plugins. |
|
|
|
Abstract base class for plugins that act as containers in the sequence tree. |
|
Concrete root container for the entire measurement sequence. |
Variables¶
|
Class Inheritance Diagram¶

Transform plugins¶
Transform sub-package — plugins that perform data transforms or reductions.
Exports TransformPlugin (abstract base) from
stoner_measurement.plugins.transform.base and concrete transform
implementations.
Classes¶
|
Curve-fitting transform plugin using scipy.optimize.curve_fit. |
|
Abstract base class for plugins that transform or reduce data. |
Class Inheritance Diagram¶

TransformPlugin — abstract base class for data-transformation plugins.
Transform plugins perform pure computation on collected data without accessing hardware. Examples include resistance calculations from (V, I) traces, background subtraction, smoothing, FFT analysis, and unit conversion.
A TransformPlugin is chained after trace acquisition: the sequence
engine passes the collected data dict through the transform pipeline and stores
the resulting outputs alongside the raw traces.
Classes¶
|
Special type indicating an unconstrained type. |
|
Abstract root class shared by all measurement plugins. |
|
|
|
|
|
|
|
|
|
|
|
Abstract base class for plugins that transform or reduce data. |
|
types is normally a sequence of individual types. |
Variables¶
|
Class Inheritance Diagram¶

CurveFitPlugin — transform plugin that fits data to a user-defined function.
Performs scipy.optimize.curve_fit on a selected data trace using a fitting function supplied as Python source code. Parameter names, bounds, and initial values are configured via the UI. Fitted parameter values and their uncertainties (sqrt of covariance matrix diagonal) are reported as plugin outputs.
- Notes:
The fit-function code entered by the user is executed with Python’s built-in
exec(). Only load and run configuration files from trusted sources.
Classes¶
|
Special type indicating an unconstrained type. |
|
Curve-fitting transform plugin using scipy.optimize.curve_fit. |
|
Plain-text editor with Python syntax highlighting and line numbers. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Container for a single measurement trace with optional error bars and metadata. |
|
Abstract base class for plugins that transform or reduce data. |
|
types is normally a sequence of individual types. |
Variables¶
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
bool(x) -> bool |
|
Class Inheritance Diagram¶

Command plugins¶
Command sub-package — single-action plugins for the sequence engine.
Exports CommandPlugin (abstract base) from
stoner_measurement.plugins.command.base, SaveCommand
(built-in concrete implementation) from
stoner_measurement.plugins.command.save,
PlotTraceCommand from
stoner_measurement.plugins.command.plot_trace,
PlotPointsCommand from
stoner_measurement.plugins.command.plot_points,
PlotClearCommand from
stoner_measurement.plugins.command.plot_clear,
WaitCommand from stoner_measurement.plugins.command.wait,
StatusCommand from stoner_measurement.plugins.command.status,
AlertCommand from stoner_measurement.plugins.command.alert,
and DetailsCommand from
stoner_measurement.plugins.command.details.
Classes¶
|
Command plugin that displays a modal alert dialog during sequence execution. |
|
Abstract base class for sequence-engine command plugins. |
|
Command plugin that records measurement metadata in the sequence script. |
|
Command plugin that clears all traces from the main plot window. |
|
Command plugin that appends live scatter-plot points to the main plot. |
|
Command plugin that plots trace data to the main plot window. |
|
Command plugin that saves current trace or state-control data to disc. |
|
Command plugin that sends a string message to the application status bar. |
|
Command plugin that pauses sequence execution for a specified duration. |
Class Inheritance Diagram¶

CommandPlugin — abstract base class for single-action sequence commands.
Command plugins execute a single action during a measurement sequence without any instrument lifecycle steps (no connect, configure, or disconnect calls). Examples include saving collected data to disc, sending trace data to a plot window, or emitting a point to a live scatter graph.
A CommandPlugin has access to the full sequence engine namespace
(including all registered plugin instances and numpy functions) but produces
no output data of its own.
Unlike the instrument-oriented plugin sub-types, command plugins do not require a scan generator and are always leaf nodes in the sequence tree.
Concrete implementations must subclass CommandPlugin and implement
execute(). The SaveCommand class provided in
stoner_measurement.plugins.command.save serves as a worked example.
Classes¶
|
Abstract root class shared by all measurement plugins. |
|
|
|
Abstract base class for sequence-engine command plugins. |
|
|
|
|
|
|
|
|
|
types is normally a sequence of individual types. |
Variables¶
|
Class Inheritance Diagram¶

AlertCommand — built-in command plugin for displaying an alert dialog.
AlertCommand is a concrete CommandPlugin that evaluates a
Python expression to obtain a message string and then displays a modal
QMessageBox with an OK button in the main thread,
blocking sequence execution until the user dismisses it.
Classes¶
|
Command plugin that displays a modal alert dialog during sequence execution. |
|
Special type indicating an unconstrained type. |
|
Abstract base class for sequence-engine command plugins. |
|
|
|
|
|
|
|
|
|
|
|
|
|
types is normally a sequence of individual types. |
Variables¶
|
Class Inheritance Diagram¶

DetailsCommand — built-in command plugin for recording measurement metadata.
DetailsCommand is a concrete CommandPlugin that stores
metadata about a measurement run (operator, sample, project, and free-form
notes). Rather than emitting a {instance_name}() call, the generated
sequence code consists of attribute-assignment statements that attach the
configured values directly to the plugin instance in the engine namespace,
making them accessible to downstream sequence steps and data-saving plugins.
The project combo box is pre-populated with the top-level subdirectories of
the application default data directory, as configured in the application
settings (app/default_data_directory). Falls back to the user’s home
directory if no setting has been saved yet.
Classes¶
|
Special type indicating an unconstrained type. |
|
|
|
Abstract base class for sequence-engine command plugins. |
|
Command plugin that records measurement metadata in the sequence script. |
|
PurePath subclass that can make system calls. |
|
|
|
|
|
|
|
|
|
Variables¶
|
Class Inheritance Diagram¶

PlotClearCommand — built-in command plugin that clears all plot traces.
PlotClearCommand is a concrete CommandPlugin that removes
all currently displayed traces from the main plot window by emitting a
plot_clear signal connected to
clear_all().
Classes¶
|
Special type indicating an unconstrained type. |
|
Abstract base class for sequence-engine command plugins. |
|
Command plugin that clears all traces from the main plot window. |
|
|
|
|
|
types is normally a sequence of individual types. |
Variables¶
|
bool(x) -> bool |
|
Class Inheritance Diagram¶

PlotPointsCommand — built-in command plugin for live scatter-plot updates.
PlotPointsCommand is a concrete CommandPlugin that appends
a single (x, y) data point to one or more named plot traces each time it is
executed. This is intended for use inside a state-control loop to provide a
live view of measured data points as a function of a swept parameter.
The x value is taken from a single entry in the sequence engine’s _values
catalogue and any number of y values may be added, each mapped to a
separately named plot trace. Each y series may be given a custom label
(which becomes the trace name in the plot legend), a y-axis name to control
which axis the series is plotted against, and a default label is derived from
the value’s human-readable name and units.
If a y-axis name that does not yet exist on the plot widget is specified for a
series, it is created automatically (on the right-hand side) when
execute() runs.
Classes¶
|
Special type indicating an unconstrained type. |
|
Abstract base class for sequence-engine command plugins. |
|
Command plugin that appends live scatter-plot points to the main plot. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
types is normally a sequence of individual types. |
Variables¶
|
bool(x) -> bool |
|
Class Inheritance Diagram¶

PlotTraceCommand — built-in command plugin for plotting trace data.
PlotTraceCommand is a concrete CommandPlugin that retrieves
trace data from the sequence engine namespace and sends it to the main plot
window via a Qt signal.
Two operating modes are supported:
Simple mode — the user selects a single named trace from the sequence’s trace catalogue. Both axes are taken from the
TraceDataobject that the expression in the catalogue evaluates to.Advanced mode — the user independently selects the x data, y data, and plot title using Python expressions. The expressions are evaluated against the live engine namespace via
eval(), allowing data from different trace channels to be mixed on a single plot.
Classes¶
|
Special type indicating an unconstrained type. |
|
Abstract base class for sequence-engine command plugins. |
|
Command plugin that plots trace data to the main plot window. |
|
|
|
|
|
|
|
|
|
|
|
|
|
types is normally a sequence of individual types. |
Variables¶
|
bool(x) -> bool |
|
Class Inheritance Diagram¶

SaveCommand — built-in command plugin for writing data to disc.
SaveCommand is a concrete CommandPlugin that evaluates a
Python expression to obtain a file path and then writes data to a TDI Format 2.0
tab-delimited text file. Two save modes are supported:
Traces — writes all (or a selected subset of) trace channels from the
_tracescatalogue in the sequence engine namespace.Data — writes the accumulated
DataFramefrom a namedStatePlugininstance (either a state-scan or state-sweep plugin).
Classes¶
|
Special type indicating an unconstrained type. |
|
Abstract base class for sequence-engine command plugins. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Command plugin that saves current trace or state-control data to disc. |
Variables¶
|
Class Inheritance Diagram¶

StatusCommand — built-in command plugin for updating the application status bar.
StatusCommand is a concrete CommandPlugin that evaluates a
Python expression to obtain a status string and emits it to the sequence
engine’s status_changed signal, which is wired to the application status
bar.
Classes¶
|
Special type indicating an unconstrained type. |
|
Abstract base class for sequence-engine command plugins. |
|
|
|
|
|
|
|
|
|
Command plugin that sends a string message to the application status bar. |
|
types is normally a sequence of individual types. |
Variables¶
|
bool(x) -> bool |
|
Class Inheritance Diagram¶

WaitCommand — built-in command plugin for pausing sequence execution.
WaitCommand is a concrete CommandPlugin that evaluates a
Python expression to obtain a delay in seconds and then sleeps the sequence
execution for that duration.
Classes¶
|
Special type indicating an unconstrained type. |
|
Abstract base class for sequence-engine command plugins. |
|
|
|
|
|
|
|
|
|
Command plugin that pauses sequence execution for a specified duration. |
Variables¶
|
Class Inheritance Diagram¶
