pdstools.utils.cdh_utils._misc¶
Miscellaneous helpers that don’t belong to a single concern.
Functions¶
|
Flatten one level of |
|
Orders legend colors alphabetically in order to provide pega color |
Module Contents¶
- safe_flatten_list(alist: list | None, extras: list | None = None) list | None¶
Flatten one level of
alist, dropNoneentries, and prependextras.The result is order-preserving and de-duplicated. Strings are treated as atoms (not iterated). Both
alistandextrasare read-only — the caller’s lists are never mutated. ReturnsNonewhen the result would be empty so callers can use the truthiness as a “no grouping” signal.
- legend_color_order(fig)¶
Orders legend colors alphabetically in order to provide pega color consistency among different categories