spacr.qt.widgets

Reusable custom widgets for the spacr Qt GUI.

DataFilterPanel is imported LAZILY, through the __getattr__ below. It is the one widget here that imports pandas, and this package’s eager imports meant every other widget paid for it. Measured with python -X importtime -c "import spacr.qt.app":

670 ms spacr.qt.app 396 ms spacr.qt.widgets (via one 40-line label module) 333 ms spacr.qt.widgets.data_filter_panel 238 ms pandas

All of that lands before the first window is drawn, causing a visible startup stutter. from spacr.qt.widgets import DataFilterPanel still works and still returns the same class; it just costs pandas at the moment something actually asks for it, which is when a data screen opens and pandas is needed anyway.

Submodules