spacr.qt.screens.parameter_sweep¶
Interactive regression parameter sweeps.
The screen runs a regression under multiple defensible settings combinations and compares the resulting hits and control ranks. Each trial writes to its own folder, and the results table is updated as trials finish so interrupted sweeps can be resumed.
Worker recommendations account for available memory and trials run at low
CPU and I/O priority. On systems that support systemd-run --user, each
trial also receives kernel-enforced resource limits. The Containment row
states whether those limits are active; memory-based scheduling alone cannot
guarantee containment.
Functions¶
Build the |
|
|
Whether a parameter sweep exists for |
Module Contents¶
- spacr.qt.screens.parameter_sweep.build_parameter_sweep_card(host)[source]¶
Build the
Parameter sweepcard + panel pair.Mirrors
spacr.qt.screens.hyperparam.build_hyperparam_card(): returns the pair without adding it to a layout, so the host puts it where it likes and starts it hidden behind the toggle.- Parameters:
host – the
AppScreenasking for the card.- Returns:
(panel, card).
- spacr.qt.screens.parameter_sweep.sweepable(app_key: str) bool[source]¶
Whether a parameter sweep exists for
app_key.Only the regression module for now: the sweep axes, the legality filters and the row-to-regression round trip are all specific to it.
- Parameters:
app_key – the module’s registry key; only
"regression"givesTrue.
Nested helpers¶
- _lazy_sweep_panel_class.LazySweepPanel.__init__(self, host)¶
Stand in for the panel without building it.
- Parameters:
host – the
AppScreenthe real panel is built for.
spacr/qt/screens/parameter_sweep.py:719
- _lazy_sweep_panel_class.LazySweepPanel.apply_settings(self, settings)¶
Seed the real panel when the user opens the sweep card.
spacr/qt/screens/parameter_sweep.py:762
- _lazy_sweep_panel_class.LazySweepPanel.built(self) bool¶
Whether the real panel exists yet. For tests and diagnostics.
spacr/qt/screens/parameter_sweep.py:738
- _lazy_sweep_panel_class.LazySweepPanel.count_data(self)¶
The real panel’s count-file list, built on first use.
spacr/qt/screens/parameter_sweep.py:748
- _lazy_sweep_panel_class.LazySweepPanel.destination(self)¶
The real panel’s output-folder editor, built on first use.
spacr/qt/screens/parameter_sweep.py:753
- _lazy_sweep_panel_class.LazySweepPanel.panel(self)¶
The real panel, built on the first ask.
spacr/qt/screens/parameter_sweep.py:731
- _lazy_sweep_panel_class.LazySweepPanel.score_data(self)¶
The real panel’s score-file list, built on first use.
spacr/qt/screens/parameter_sweep.py:743
- _lazy_sweep_panel_class.LazySweepPanel.showEvent(self, event)¶
Build the real panel the first time the screen is shown.
That is the whole point of the placeholder: the sweep panel is expensive and a user who never opens this screen never pays for it.
spacr/qt/screens/parameter_sweep.py:766
- _lazy_sweep_panel_class.LazySweepPanel.space(self)¶
The real panel’s sweep-space model, built on first use.
spacr/qt/screens/parameter_sweep.py:758
- _make_screen.ParameterSweepScreen.__init__(self, host=None)¶
Build the sweep screen.
hostis the window, not a Qt parent.spacr/qt/screens/parameter_sweep.py:87
- _make_screen.ParameterSweepScreen._on_row_activated(self, *_args)¶
Re-run the selected trial and show its figures, editable.
Off the GUI thread: this is a full regression, not a lookup. The row keeps its own settings, so what comes back is that trial and not a fresh one built from whatever the controls happen to say now – which is the point of being able to compare conditions.
spacr/qt/screens/parameter_sweep.py:501
- _make_screen.ParameterSweepScreen._on_row_activated.job()¶
Re-run one trial from the table. Called on a worker thread.
spacr/qt/screens/parameter_sweep.py:550
- _make_screen.ParameterSweepScreen._set_worker_note(self, budget)¶
Show the worker calculation through translatable templates.
spacr/qt/screens/parameter_sweep.py:386
- _make_screen.ParameterSweepScreen._show(self, frame)¶
Put the results in the table, useful columns first.
A VIEW AND NOT A FILTER: every column is still in the CSV. The order is settings, then what went in, then what came out – a hit count means little without the size of the design it came from, and two trials differing only by a filtration cutoff can fit completely different data.
spacr/qt/screens/parameter_sweep.py:593
- _make_screen.ParameterSweepScreen._sweep_finished(self, results)¶
Show the results and give the controls back.
spacr/qt/screens/parameter_sweep.py:474
- _make_screen.ParameterSweepScreen._trial_figures_ready(self, payload)¶
Put a re-run trial’s figures on screen. On the GUI thread.
spacr/qt/screens/parameter_sweep.py:557
- _make_screen.ParameterSweepScreen.apply_settings(self, settings)¶
Seed the sweep from the module’s settings panel.
Opening the sweep should not mean retyping the inputs that are already on screen. The score/count CSVs, the response column and the output folder come straight across; every swept axis is additionally PINNED to the value the user currently has, so an unticked axis reproduces their run rather than a default.
spacr/qt/screens/parameter_sweep.py:341
- _make_screen.ParameterSweepScreen.base_settings(self)¶
The settings every trial in the sweep starts from.
spacr/qt/screens/parameter_sweep.py:375
- _make_screen.ParameterSweepScreen.estimate(self)¶
Say how many trials the current space would run, without running them.
spacr/qt/screens/parameter_sweep.py:417
- _make_screen.ParameterSweepScreen.load_results(self)¶
Read the table from disk, so a running sweep can be watched.
spacr/qt/screens/parameter_sweep.py:488
- _make_screen.ParameterSweepScreen.space(self)¶
Build the sweep space from the ticked axes.
An unticked axis is not dropped – it is PINNED to its first value and applied to every trial, so the settings a sweep ran under are always fully recorded rather than left to defaults that might change.
spacr/qt/screens/parameter_sweep.py:307
- _make_screen.ParameterSweepScreen.space.parse(text)¶
Read one comma-separated field as a list of values.
spacr/qt/screens/parameter_sweep.py:317
- _make_screen.ParameterSweepScreen.start(self)¶
Refuse an incomplete design, else run the sweep off the GUI thread.
spacr/qt/screens/parameter_sweep.py:439
- _make_screen.ParameterSweepScreen.start.job()¶
Run the whole sweep. Called on a worker thread.
spacr/qt/screens/parameter_sweep.py:463