sda.analysis.columns#

Shared column-name registries and row-value helpers for SDA analysis scripts.

Centralises the heterogeneous column-name lists that appear across multiple test files, so that any analysis script can import a single source of truth rather than maintaining its own copy.

Attributes#

Functions#

first_value(row, df_cols, candidates)

Return the first non-null string value from an ordered list of column candidates.

concat_notes(row, df_cols[, note_cols, keyword_filter])

Concatenate all non-null note/comment fields for hover tooltips.

Module Contents#

sda.analysis.columns.ENERGY_COLS: list[str] = ['Energie par pulse (mJ)', 'Energie par pulse mesuré (mJ)', 'Energie déposée par pulse (mJ)',...#
sda.analysis.columns.VOLTAGE_COLS: list[str] = ['Voltage input (kV)', 'Voltage (kV)', 'Input voltage [kV]', 'Tension (kV)']#
sda.analysis.columns.FREQ_COLS: list[str] = ['Fréquence (kHz)', 'Frequency (kHz)', 'Input frequency [kHz]']#
sda.analysis.columns.NOTE_COLS: list[str] = ['Notes', 'Notes2', 'Remarks', 'Commentaires', 'Remarques', 'Justification_Zone', 'Objectifs']#
sda.analysis.columns.GAP_COLS: list[str] = ['Gap (mm)']#
sda.analysis.columns.GEN_COL_PRIORITY: list[str] = ['Generator', 'Générateur', 'Generateur']#
sda.analysis.columns.GEN_GENERIC: frozenset[str]#
sda.analysis.columns.GENERATOR_NAMES: list[str] = ['SOLO2', 'SOLO3', 'SOLO4', 'SOLO5', 'LOCA', 'ROCO', 'NRP', 'DC', 'HYBRIDE']#
sda.analysis.columns.first_value(row, df_cols, candidates)#

Return the first non-null string value from an ordered list of column candidates.

Parameters:
  • row (A single DataFrame row (pd.Series).)

  • df_cols (List of column names present in the DataFrame.)

  • candidates (Ordered list of column names to try.)

Return type:

The stripped string value of the first populated column, or None.

sda.analysis.columns.concat_notes(row, df_cols, note_cols=None, *, keyword_filter=None)#

Concatenate all non-null note/comment fields for hover tooltips.

Parameters:
  • row (A single DataFrame row.)

  • df_cols (Column names present in the DataFrame.)

  • note_cols (Ordered list of note column names.  Defaults to) – NOTE_COLS.

  • keyword_filter (If given (e.g. ````”pdc”:py:class:`)`, only include a field when that) – keyword appears in the text (case-insensitive). Pass None to include all non-empty fields.

Return type:

:py:class:``”field1 | field2 | …”:py:class:`` or None when nothing was found.