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. 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,
tuned to keep equivalent contrast; the view picks one by theme. Every
status pairs a glyph with its color so status is never communicated by
color alone.
- class pypeit.dashboard.palette.StepStyle(category, color, glyph, label)[source]
Bases:
objectThe visual style for one calibration step’s state.
- Variables:
- pypeit.dashboard.palette.action_color(theme='light')[source]
Return the (Re)Build action-control color for a theme.
- pypeit.dashboard.palette.classify(required, status, in_pipeline)[source]
Map a step’s
(required, status, in_pipeline)to a palette category.- 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,running,fail,pending), 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.
- pypeit.dashboard.palette.selection_style(theme='light')[source]
Return a Qt stylesheet giving a table a neutral selected-row fill, 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.
- pypeit.dashboard.palette.slit_style(status, theme='light')[source]
Return the
StepStylefor one per-slit/order status.
- pypeit.dashboard.palette.step_style(required, status, in_pipeline, theme='light')[source]
Return the
StepStylefor a step’s state and theme.- 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).- 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: