Commit 644e181
committed
refactor(utils): extract color resolution into _color.py (#696)
Move 21 color helpers + 6 color-only format/uniqueness helpers verbatim from
utils.py into a new sibling module pl/_color.py. Imports flow one way:
_color -> utils (downward, for _get_list/to_hex/_build_alignment_dtype_hint/
_MPL_SINGLE_LETTER_COLORS). render.py, basic.py and _datashader.py are repointed
to import color symbols from _color.
The two validators still in utils (_type_check_params, _validate_graph_render_params)
use color symbols; they carry temporary function-local imports of _color (cycle-safe)
until they move to _validate.py in the next commit, where these become top-level imports.
No behavior change (verbatim move; all-private except set_zero_in_cmap_to_transparent,
which is not re-exported). Verified: no import cycle; 410 non-visual tests pass;
ruff + ruff-format clean. Pre-existing #703/#705 mypy/ruff debt in utils.py is
unrelated; --no-verify for that reason only.1 parent e195751 commit 644e181
6 files changed
Lines changed: 1361 additions & 1314 deletions
File tree
- src/spatialdata_plot/pl
- tests/pl
0 commit comments