spacr.qt

PySide6 (Qt 6) desktop interface for spaCR.

Launch the application with spacr, spacr-qt, python -m spacr.qt or python -m spacr. The last command also accepts subcommands such as mask and measure to open a specific application tab.

The interface uses theme.py for its palette and QSS stylesheet, widgets/ for reusable widgets, screens/ for application screens, and app.py for the main window and QApplication bootstrap.

Submodules

Functions

register_self_registering_modules(→ tuple[str, ...])

Register every app in SELF_REGISTERING_MODULES.

run(→ int)

Launch the Qt GUI. Public entry point used by both spacr-qt and

Package Contents

spacr.qt.register_self_registering_modules() → tuple[str, ...][source]

Register every app in SELF_REGISTERING_MODULES.

A row whose registration is pure metadata is taken from spacr.qt.app_catalog.DECLARED_APPS and its module is NOT imported: the registry learns the key, the name, the sentence, the section and the stage from the table, and the screen’s own code — with pandas, scipy and sklearn behind it — waits until somebody opens the app. Only a module that does real work at registration is imported here, which is the handful that wrap other screens’ factories or reassess what is already registered.

Idempotent — every register() is written to be safe to call twice, so a second launch in one process (the test suite does this) does not raise on a duplicate app key.

One module’s failure costs that module’s app and nothing else: an optional panel must never stop the GUI from starting.

Returns:

the module names that registered without raising, declared and imported alike. A declared row that was already in the registry counts as registered — the caller asked for the app to exist, and it does.

spacr.qt.run(argv: list[str] | None = None) → int[source]

Launch the Qt GUI. Public entry point used by both spacr-qt and python -m spacr.qt.

Parameters:

argv – Optional CLI arguments. The first positional element, if present, opens directly into that app screen key (e.g. spacr-qt mask).

Returns:

The exit code returned by QApplication.exec(), or 1 when the required Qt dependency cannot be imported.

Nested helpers

_install_quiet_qt_logging.handler(mode, context, message)

Drop Qt’s known-noisy messages and pass the rest through.

spacr/qt/__init__.py:133