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: object

The visual style for one calibration step’s state.

Generated by JXP and Claude.

Variables:
  • category (str) – One of the palette category keys (e.g. success, fail).

  • color (str) – Hex color string (e.g. #2E7D32) for the chosen theme.

  • glyph (str) – A single-character status glyph (paired with color, R10).

  • label (str) – A short text label for the status.

category: str = <dataclasses._MISSING_TYPE object>
color: str = <dataclasses._MISSING_TYPE object>
glyph: str = <dataclasses._MISSING_TYPE object>
label: str = <dataclasses._MISSING_TYPE object>
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.

Parameters:

theme (str, optional) – 'light' (default) or 'dark'.

Returns:

The action hex color (a blue, distinct from any status color).

Return type:

str

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 be None when unknown (treated as not required).

  • status (str, optional) – The step status from pypeit.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’s default_steps().

Returns:

The palette category key.

Return type:

str

pypeit.dashboard.palette.inspect_color(theme='light')[source]

Return the “Inspect output” control color for a theme.

Generated by JXP and Claude.

Parameters:

theme (str, optional) – 'light' (default) or 'dark'.

Returns:

The inspect hex color (a teal, distinct from the action blue and any status color).

Return type:

str

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.

Parameters:

theme (str, optional) – 'light' (default) or 'dark'.

Returns:

A QTableWidget/QListWidget ::item:selected stylesheet.

Return type:

str

pypeit.dashboard.palette.slit_style(status, theme='light')[source]

Return the StepStyle for one per-slit/order status.

Generated by JXP and Claude.

Parameters:
  • status (str) – The per-slit status (success/complete/running/ fail/skip/undone).

  • theme (str, optional) – 'light' (default) or 'dark'.

Returns:

The color + glyph + label for the slit.

Return type:

StepStyle

pypeit.dashboard.palette.step_style(required, status, in_pipeline, theme='light')[source]

Return the StepStyle for a step’s state and theme.

Generated by JXP and Claude.

Parameters:
  • required (bool, optional) – Whether the step is required (None treated as not required).

  • status (str, optional) – The step status (see classify()).

  • in_pipeline (bool) – Whether the step is in the spectrograph’s default_steps().

  • theme (str, optional) – 'light' (default) or 'dark'.

Returns:

The color + glyph + label for the step.

Return type:

StepStyle

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; optional and not_used never 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_USED if the input is empty.

Return type:

str