|
94 | 94 | # once https://github.com/scverse/spatialdata/pull/689/ is in a release |
95 | 95 | ColorLike = tuple[float, ...] | list[float] | str |
96 | 96 |
|
| 97 | +_GROUPS_IGNORED_WARNING = "Parameter 'groups' is ignored when 'color' is a literal color, not a column name." |
| 98 | + |
97 | 99 |
|
98 | 100 | def _extract_scalar_value(value: Any, default: float = 0.0) -> float: |
99 | 101 | """ |
@@ -2474,7 +2476,7 @@ def _validate_label_render_params( |
2474 | 2476 | has_col = element_params[el]["col_for_color"] is not None |
2475 | 2477 | element_params[el]["palette"] = param_dict["palette"] if has_col else None |
2476 | 2478 | if not has_col and param_dict["groups"] is not None: |
2477 | | - logger.warning("Parameter 'groups' is ignored when 'color' is a literal color, not a column name.") |
| 2479 | + logger.warning(_GROUPS_IGNORED_WARNING) |
2478 | 2480 | element_params[el]["groups"] = param_dict["groups"] if has_col else None |
2479 | 2481 | element_params[el]["colorbar"] = param_dict["colorbar"] |
2480 | 2482 | element_params[el]["colorbar_params"] = param_dict["colorbar_params"] |
@@ -2544,7 +2546,7 @@ def _validate_points_render_params( |
2544 | 2546 |
|
2545 | 2547 | element_params[el]["palette"] = param_dict["palette"] if param_dict["col_for_color"] is not None else None |
2546 | 2548 | if param_dict["col_for_color"] is None and param_dict["groups"] is not None: |
2547 | | - logger.warning("Parameter 'groups' is ignored when 'color' is a literal color, not a column name.") |
| 2549 | + logger.warning(_GROUPS_IGNORED_WARNING) |
2548 | 2550 | element_params[el]["groups"] = param_dict["groups"] if param_dict["col_for_color"] is not None else None |
2549 | 2551 | element_params[el]["ds_reduction"] = param_dict["ds_reduction"] |
2550 | 2552 | element_params[el]["colorbar"] = param_dict["colorbar"] |
@@ -2630,7 +2632,7 @@ def _validate_shape_render_params( |
2630 | 2632 |
|
2631 | 2633 | element_params[el]["palette"] = param_dict["palette"] if param_dict["col_for_color"] is not None else None |
2632 | 2634 | if param_dict["col_for_color"] is None and param_dict["groups"] is not None: |
2633 | | - logger.warning("Parameter 'groups' is ignored when 'color' is a literal color, not a column name.") |
| 2635 | + logger.warning(_GROUPS_IGNORED_WARNING) |
2634 | 2636 | element_params[el]["groups"] = param_dict["groups"] if param_dict["col_for_color"] is not None else None |
2635 | 2637 | element_params[el]["method"] = param_dict["method"] |
2636 | 2638 | element_params[el]["ds_reduction"] = param_dict["ds_reduction"] |
|
0 commit comments