spacr.qt.widgets.gate_settings

Settings for the Gate Editor, in tabs.

Split by what the setting is ABOUT, not by which widget reads it:

General

How much data is loaded and how the cloud is drawn. The sampling setting lives here because it is the answer to the module being laggy on a real dataset – a screen of a million objects is slow to draw, slow to hit-test, and no more informative than a fifth of them.

2D

Gating on a scatter: the tools, the shapes, and the clustering that proposes shapes for you.

3D

Gating in a volume. The settings are here; the workspace they drive is the next piece of work.

Every setting is a field on GateEditorSettings, which is a plain frozen dataclass – no Qt – so what the editor does with a setting can be tested without building a dialog, and so the whole set can be written to disk as one thing later.

Sampling is a display concern only. A gate drawn on 20% of the objects is still a statement about all of them; the export re-reads the full table and applies the gate there (spacr.filters.gate_mask_over_table()). Nothing downstream of the plot ever sees the sample.

Classes

GateEditorSettings

Everything the Gate Editor is configured by.

GateSettingsDialog

The tabbed settings window.

Module Contents

class spacr.qt.widgets.gate_settings.GateEditorSettings[source]

Everything the Gate Editor is configured by.

Frozen: settings are replaced wholesale rather than mutated, so a screen can compare what it has against what it is given and re-read the table only when something that actually costs a read has changed.

costs_a_reload(other: GateEditorSettings) bool[source]

Whether moving to other means re-reading the table.

Only two settings do. Everything else is drawing, and re-reading a large table because the user changed a colour map is exactly the kind of lag this dialog exists to remove.

replaced(**changes) GateEditorSettings[source]

A copy with changes applied.

scale_for(axis: str) str[source]

The scale for “x” or “y”, honouring the retired log flags.

class spacr.qt.widgets.gate_settings.GateSettingsDialog(settings: GateEditorSettings, parent=None, *, columns: Tuple[str, ...] = ())[source]

Bases: PySide6.QtWidgets.QDialog

The tabbed settings window.

Emits settings_changed as the user edits, so the settings that CAN be applied live are, without waiting for OK. The ones that cannot – sampling, which means re-reading the table – are applied by the screen when it sees them change, which is why the signal carries the whole settings object rather than one field.

Parameters:
  • settings – the settings to edit. Held, not copied – the dialog is live and emits settings_changed as controls move, so a caller wanting cancel-to-revert keeps its own copy.

  • parent – parent widget.

  • columns – the columns currently loaded, for the aggregation table. Empty is legitimate and means the screen has no data yet.

Build the settings dialog over a gate-editor settings record.

Parameters:
  • settings – the settings to edit; every change is emitted rather than applied on close, so the scatter follows the dialog live.

  • parent – parent widget, or None.

  • columns – the loaded table’s measurements, offered wherever a setting names one.

set_mode(mode: str) None[source]

Show a mode chosen elsewhere, without re-emitting it.

The 2D/3D/xD buttons and this dropdown are two views of one setting. Echoing the change back would be a loop; showing it is what keeps the window honest about the state the editor is actually in.

settings() GateEditorSettings[source]

The gate settings the user chose.

Returns:

the settings dict.