Commit 2f4d959
miranov25
PHASE 13.36.DF — user style kwargs override auto-cycle in group_by path
Closes BUG-013: marker='s', color='red', markersize=10 silently ignored
when group_by was active. The grouped rendering path (profile + hist) used
the per-group color/marker cycle unconditionally, discarding user style
kwargs.
Priority rule (architect 2026-05-20):
user kwarg > channel auto-cycle > style default
None = 'user did not pass' (matches matplotlib default-color semantics).
Profile fix (plots/profile.py):
_draw_profile_grouped() signature: add _user_marker, _user_markersize,
_user_color named params (default None).
draw_profile() captures _ud_user_marker, _ud_user_markersize, _ud_user_color
BEFORE the style fill-in at lines 311-321 (which replaces None with
style defaults). Without pre-fill-in capture, the sentinel arrives as
'o' even when user passed nothing → cycle override (CODER NOTE §5.1).
draw_profile() call to _draw_profile_grouped(): pass _user_marker=
_ud_user_marker etc. (the pre-fill-in captures).
REMOVED: marker=marker, markersize=markersize from the call.
REMOVED: profile_kwargs.pop('marker'/'markersize') (nothing left to pop).
Per-group loop: 'is None' check before palette/marker cycle.
UserWarning fires ONCE per call (i==0) when color= makes all groups uniform.
Hist fix (plots/histogram.py):
_draw_hist_grouped() signature: add _user_color named param (default None).
draw_hist() call to _draw_hist_grouped(): pass _user_color=color.
draw_hist() body (early, before routing): pop 'marker' from kwargs +
issue UserWarning. v1.2 spec said pop inside _draw_hist_grouped, but
that path is only reached for grouped hist — non-grouped/vector path
would crash ax.hist (AttributeError on marker). Single source of truth
at draw_hist top (CODER NOTE §5.2).
Per-group color: sentinel checked in BOTH stacked + overlaid branches.
FORWARDED_NAMES (drawer.py):
_PROFILE_FORWARDED_NAMES += marker, color, markersize (all 3 are explicit
params of draw_profile()).
_HIST_FORWARDED_NAMES += marker, color ONLY (NOT markersize — draw_hist()
has no markersize explicit param; adding it would crash ax.hist via
vector path. Sonet51 P1 from v1.2 review).
DFDraw method signatures + bodies (drawer.py):
DFDraw.profile() += color, marker, markersize params (R6 validator).
DFDraw.hist() += color, marker params (R6 validator).
Both bodies forward the params explicitly to draw_profile/draw_hist.
same=True auto-color injection refactored: (a) assign to local color var
not kwargs['color'] (collision); (b) skip auto-color when group_by is
active — preserves pre-13.36 behavior (auto-color was silently dropped
in grouped path) and prevents false-positive 'indistinguishable'
UserWarning (CODER NOTE §5.3).
linestyle: out of scope — already works (brainstorm + v0/v1 panel live
tests, 2026-05-20). §9.LS.1 locks current behavior.
Primary use case (TPC/ITS calibration overlay):
adf.draw('y:row', group_by='drift', group_by_bins=5)
adf.draw('y:row', group_by='drift', group_by_bins=5,
same=True, marker='s')
Spec history:
v1.0 (Sonet50): 3 P1s including 'color not forwarded to grouped path'.
v1.1 (Sonet50): attempted P1-A fix via profile_kwargs.pop, returns _UNSET
unconditionally (color/marker/markersize consumed by
explicit signature, not in **kwargs). Sonnet53_R2 [X],
Claude48Coder [X].
v1.2 (Claude48Coder, architect-greenlit takeover): Sonnet53_R2 Option A
— local variables, None sentinel.
v1.2 review: Sonet50 [OK], Sonet51 [!] P1 (markersize crash in hist
vector path — fixed at code time per architect 'no v1.3'
directive), Claude40 [✅ APPROVED].
Implementation deviations from v1.2 spec (mandatory disclosure):
- Edit 17 (NEW): pre-fill-in capture for _ud_user_* — caught at smoke
test, not anticipated in spec. §5.1.
- Edit 18: marker pop moved from _draw_hist_grouped to draw_hist top —
caught by full regression (96 vector hist failures). §5.2.
- Edit 15/16: same=True + group_by guard — caught at smoke test, false-
positive UserWarning. §5.3.
Tests: +10 §9 invariance (SO.1-5, SOH.1-2, LS.1, SC.1, VF.1)
Linux Py3.12 (this env): 810 / 1 / 33 / 1 — 1 failed + 33 skipped are
pre-existing per Phase 13.35.DF conversation summary.
Expected on architect's Mac Py3.9.6: 843 / 0 / 1.1 parent 3b910ae commit 2f4d959
4 files changed
Lines changed: 436 additions & 13 deletions
File tree
- UTILS/dfextensions/dfdraw
- plots
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
579 | 583 | | |
580 | 584 | | |
581 | 585 | | |
| |||
601 | 605 | | |
602 | 606 | | |
603 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
604 | 618 | | |
605 | 619 | | |
606 | 620 | | |
| |||
3190 | 3204 | | |
3191 | 3205 | | |
3192 | 3206 | | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
3193 | 3217 | | |
3194 | 3218 | | |
3195 | 3219 | | |
| |||
3315 | 3339 | | |
3316 | 3340 | | |
3317 | 3341 | | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
3318 | 3348 | | |
3319 | 3349 | | |
3320 | 3350 | | |
3321 | | - | |
3322 | | - | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
3323 | 3354 | | |
3324 | 3355 | | |
3325 | 3356 | | |
| |||
3408 | 3439 | | |
3409 | 3440 | | |
3410 | 3441 | | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
3411 | 3448 | | |
3412 | 3449 | | |
3413 | 3450 | | |
| |||
3771 | 3808 | | |
3772 | 3809 | | |
3773 | 3810 | | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
3774 | 3818 | | |
3775 | 3819 | | |
3776 | 3820 | | |
| |||
4119 | 4163 | | |
4120 | 4164 | | |
4121 | 4165 | | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
| 4169 | + | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
| 4173 | + | |
| 4174 | + | |
| 4175 | + | |
4122 | 4176 | | |
4123 | 4177 | | |
4124 | 4178 | | |
4125 | | - | |
4126 | | - | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
4127 | 4182 | | |
4128 | 4183 | | |
4129 | 4184 | | |
| |||
4218 | 4273 | | |
4219 | 4274 | | |
4220 | 4275 | | |
| 4276 | + | |
| 4277 | + | |
| 4278 | + | |
| 4279 | + | |
| 4280 | + | |
4221 | 4281 | | |
4222 | 4282 | | |
4223 | 4283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
292 | 311 | | |
293 | 312 | | |
294 | 313 | | |
| |||
469 | 488 | | |
470 | 489 | | |
471 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
472 | 497 | | |
473 | 498 | | |
474 | 499 | | |
| |||
530 | 555 | | |
531 | 556 | | |
532 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
533 | 562 | | |
534 | 563 | | |
535 | 564 | | |
536 | 565 | | |
537 | 566 | | |
| 567 | + | |
538 | 568 | | |
539 | 569 | | |
540 | 570 | | |
541 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
542 | 576 | | |
543 | 577 | | |
544 | 578 | | |
| |||
564 | 598 | | |
565 | 599 | | |
566 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
567 | 612 | | |
568 | 613 | | |
569 | 614 | | |
| |||
573 | 618 | | |
574 | 619 | | |
575 | 620 | | |
| 621 | + | |
| 622 | + | |
576 | 623 | | |
577 | 624 | | |
578 | 625 | | |
| |||
582 | 629 | | |
583 | 630 | | |
584 | 631 | | |
585 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
586 | 636 | | |
587 | 637 | | |
588 | 638 | | |
| |||
592 | 642 | | |
593 | 643 | | |
594 | 644 | | |
| 645 | + | |
595 | 646 | | |
596 | 647 | | |
597 | 648 | | |
598 | 649 | | |
599 | 650 | | |
600 | 651 | | |
601 | 652 | | |
| 653 | + | |
| 654 | + | |
602 | 655 | | |
603 | 656 | | |
604 | | - | |
| 657 | + | |
605 | 658 | | |
606 | 659 | | |
607 | 660 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
311 | 321 | | |
312 | 322 | | |
313 | 323 | | |
| |||
485 | 495 | | |
486 | 496 | | |
487 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
488 | 507 | | |
489 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
490 | 512 | | |
491 | 513 | | |
492 | 514 | | |
| |||
913 | 935 | | |
914 | 936 | | |
915 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
916 | 945 | | |
917 | 946 | | |
918 | 947 | | |
| |||
980 | 1009 | | |
981 | 1010 | | |
982 | 1011 | | |
983 | | - | |
984 | | - | |
985 | | - | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
986 | 1019 | | |
987 | 1020 | | |
988 | 1021 | | |
| |||
1028 | 1061 | | |
1029 | 1062 | | |
1030 | 1063 | | |
1031 | | - | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1032 | 1080 | | |
1033 | 1081 | | |
1034 | 1082 | | |
| |||
1073 | 1121 | | |
1074 | 1122 | | |
1075 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1076 | 1129 | | |
1077 | 1130 | | |
1078 | | - | |
| 1131 | + | |
1079 | 1132 | | |
| 1133 | + | |
1080 | 1134 | | |
1081 | 1135 | | |
1082 | 1136 | | |
| |||
0 commit comments