Return a human-readable label for the provided column name.
(cls, column: str)
| 211 | |
| 212 | @classmethod |
| 213 | def _format_label(cls, column: str) -> str: |
| 214 | """Return a human-readable label for the provided column name.""" |
| 215 | if column is None: |
| 216 | return "" |
| 217 | |
| 218 | raw = str(column).strip() |
| 219 | if not raw: |
| 220 | return raw |
| 221 | |
| 222 | key = raw.lower() |
| 223 | |
| 224 | override = cls._LABEL_OVERRIDES.get(key) |
| 225 | if override: |
| 226 | return override |
| 227 | |
| 228 | if "." in key: |
| 229 | prefix, suffix = key.split(".", 1) |
| 230 | prefix_display = cls._PREFIX_DISPLAY.get(prefix, prefix.upper()) |
| 231 | |
| 232 | suffix_label = cls._LATENCY_SUFFIX_LABELS.get(suffix) |
| 233 | if suffix_label: |
| 234 | return f"{prefix_display} {suffix_label}" |
| 235 | |
| 236 | parts = suffix.split("_") |
| 237 | words = [] |
| 238 | unit: Optional[str] = None |
| 239 | |
| 240 | for part in parts: |
| 241 | if part in cls._UNIT_SUFFIXES: |
| 242 | unit = cls._UNIT_SUFFIXES[part] |
| 243 | continue |
| 244 | |
| 245 | if part.isalpha(): |
| 246 | words.append(part.capitalize()) |
| 247 | else: |
| 248 | words.append(part.upper()) |
| 249 | |
| 250 | if words and unit: |
| 251 | return f"{prefix_display} {' '.join(words)} ({unit})" |
| 252 | if words: |
| 253 | return f"{prefix_display} {' '.join(words)}" |
| 254 | if unit: |
| 255 | return f"{prefix_display} ({unit})" |
| 256 | return prefix_display |
| 257 | |
| 258 | return raw |
| 259 | |
| 260 | def reset(self, group_cols: Optional[List[str]] = None): |
| 261 | """Reset navigation to initial state""" |
no outgoing calls
no test coverage detected