pypeit.dashboard.palette module
The Dashboard-wide status palette (Qt-free, plain data).
This module maps a calibration step’s (required, status, in_pipeline)
to a color + glyph + label, exactly as tabulated in
pypeit_dashboard_design.md (the Status color key / Calibrations
button table). It returns plain data (hex strings, a glyph, a label) so
it stays Qt-free and unit-testable; the view converts the hex to a
QColor. Both a light and a dark variant are provided (R10: keep
equivalent contrast); the view picks one by theme.
Generated by JXP and Claude.
- class pypeit.dashboard.palette.StepStyle(category, color, glyph, label)[source]
Bases:
objectThe visual style for one calibration step’s state.
Generated by JXP and Claude.
- Variables:
- pypeit.dashboard.palette.action_color(theme='light')[source]
Return the (Re)Build action-control color for a theme (design C10/X1).
Generated by JXP and Claude.
- pypeit.dashboard.palette.classify(required, status, in_pipeline)[source]
Map a step’s
(required, status, in_pipeline)to a palette category.Generated by JXP and Claude.
- Parameters:
required (
bool, optional) – Whether the step is required. May beNonewhen unknown (treated as not required).status (
str, optional) – The step status frompypeit.state(success,complete,running,fail,undone), or a not-present sentinel (e.g.absent/None).in_pipeline (
bool) – Whether the step is part of the active spectrograph’sdefault_steps().
- Returns:
The palette category key.
- Return type:
- pypeit.dashboard.palette.inspect_color(theme='light')[source]
Return the “Inspect output” control color for a theme.
Generated by JXP and Claude.
- pypeit.dashboard.palette.selection_style(theme='light')[source]
Return a Qt stylesheet giving a table a neutral selected-row fill (Stage 6 Round-1 #2), so a selected frame reads as “selected”, never as a failure. Applied to the selectable dashboard tables in place of the desktop theme’s (possibly red) Highlight color.
Generated by JXP and Claude.
- pypeit.dashboard.palette.slit_style(status, theme='light')[source]
Return the
StepStylefor one per-slit/order status.Generated by JXP and Claude.
- pypeit.dashboard.palette.step_style(required, status, in_pipeline, theme='light')[source]
Return the
StepStylefor a step’s state and theme.Generated by JXP and Claude.
- Parameters:
required (
bool, optional) – Whether the step is required (Nonetreated as not required).status (
str, optional) – The step status (seeclassify()).in_pipeline (
bool) – Whether the step is in the spectrograph’sdefault_steps().theme (
str, optional) –'light'(default) or'dark'.
- Returns:
The color + glyph + label for the step.
- Return type:
- pypeit.dashboard.palette.worst_category(categories)[source]
Return the most severe palette category in
categories.Used to color a navigator cell by the worst status among its steps (precedence
fail > running > required_undone > success;optionalandnot_usednever worsen an otherwise-successful cell).Generated by JXP and Claude.
- Parameters:
categories (iterable) – Palette category keys (e.g. from
classify()).- Returns:
The most severe category present, or
NOT_USEDif the input is empty.- Return type: