Commit 67d125e
miranov25
PHASE 13.40.DF — Cumulative histogram (cumulative=True/-1)
Adds cumulative: Union[bool, int] = False to hist(). Three values:
True → ascending cumulative (each bin = count ≤ right edge)
False → regular histogram (default, byte-identical backward compat)
-1 → survival function/CCDF (ROOT convention)
Implementation: ~40 LOC source across 5 forwarding sites (CP1-2 recursive
+ CRR §2.3 NEW faceted dispatch layer):
Layer 1: DFDraw.hist(cumulative=False) — named param
Layer 2: draw_hist(cumulative=False) — named param
Layer 3: _draw_hist_grouped(cumulative=False) — named param (NEW)
Layer 4a: ax.hist(cumulative=cumulative) ungrouped — site 1/4 (line 591)
Layer 4b: ax.hist(cumulative=cumulative) stacked — site 2/4 (line 803, CP1-1)
Layer 4c: ax.hist(cumulative=cumulative) overlaid LS — site 3/4 (line 878, NEW)
Layer 4d: ax.hist(cumulative=cumulative) overlaid def — site 4/4 (line 888, NEW)
Side: _dispatch_faceted_render(cumulative=cumulative) — faceted layer (CRR §2.3)
Every layer forwards explicitly (cumulative=cumulative), NEVER via **kwargs
or kwargs.get — recursively applies Phase 13.39 §2.2 lesson at every
internal layer + faceted side branch (5 forwarding sites total).
Correctness guard (M5):
hist_errors=True + cumulative=True → NotImplementedError
(Poisson per-bin errors are independent; cumulative counts have
correlated uncertainty — silently passing through would render
statistically wrong error bars on the ECDF.)
CP1-3: drawer.py:3085 docstring fix — drops stale norm='cumulative'
(actual line was 3085, not 3002 as v1.2 spec said; drift from Phase
13.36-13.39 additions).
Compositions locked (10 tests):
CH.1 monotone non-decreasing + total-N
CH.2 norm='probability' + cumulative=True → ECDF (max=1.0)
CH.3 cumulative=-1 + norm='probability' → survival (max=1.0)
CH.4 cumulative=False byte-identical (backward compat)
CH.5 group_by + cumulative + hist_norm → per-group ECDFs
CH.6 hist_errors + cumulative → NotImplementedError (M5)
CH.7 [x,y] vector + cumulative → both polygons saturate
CH.8 facet_by + cumulative → per-facet cumulative (CRR §2.3 fix)
CH.9 histtype='step' + cumulative → Polygon-safe vertex probe
CH.10 group_by + stacked + cumulative → CP2-1 regression lock
Fix-at-code-time disclosures (CRR §2):
§2.1: 4 ax.hist() call sites (not 3) — Phase 13.37 split overlaid
into linestyle_cycle + default branches
§2.2: Polygon-safe probes in ALL tests (default histtype='stepfilled'
produces Polygon, not Rectangle — CP1-4 broader than spec)
§2.3: _dispatch_faceted_render needs explicit cumulative= forward
(5th forwarding site, not in v1.2 spec)
§2.4: docstring line drift 3002 → 3085 (caught by §8 protocol)
Tests: 913 → 923 (+10 §9 invariance: CH.1-10).
QRC v1.32 carry-forward AliceO2Group#6 (NEW, recursive forwarding rule):
'Named param ≠ kwarg after FORWARDED_NAMES promotion applies recursively
at EVERY forwarding layer including faceted/vector dispatch side
branches. All N internal call sites must forward explicitly.'
Pre-existing failure (not Phase 13.40):
test_vector_draw_kwarg_surface_enumeration fails on Linux Py3.12
(pandas StringDtype in _process_color — Phase 13.39 §2.5 carry-forward).
Mac Py3.9.6 unaffected.1 parent 46b7adf commit 67d125e
6 files changed
Lines changed: 439 additions & 10 deletions
File tree
- UTILS/dfextensions/dfdraw
- docs
- plots
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
| 655 | + | |
| 656 | + | |
655 | 657 | | |
656 | 658 | | |
657 | 659 | | |
| |||
3082 | 3084 | | |
3083 | 3085 | | |
3084 | 3086 | | |
3085 | | - | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
3086 | 3090 | | |
3087 | 3091 | | |
3088 | 3092 | | |
| |||
3273 | 3277 | | |
3274 | 3278 | | |
3275 | 3279 | | |
| 3280 | + | |
| 3281 | + | |
3276 | 3282 | | |
3277 | 3283 | | |
3278 | 3284 | | |
| |||
3509 | 3515 | | |
3510 | 3516 | | |
3511 | 3517 | | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
3512 | 3522 | | |
3513 | 3523 | | |
3514 | 3524 | | |
| |||
3551 | 3561 | | |
3552 | 3562 | | |
3553 | 3563 | | |
| 3564 | + | |
| 3565 | + | |
3554 | 3566 | | |
3555 | 3567 | | |
3556 | 3568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
243 | 248 | | |
244 | 249 | | |
245 | 250 | | |
| |||
353 | 358 | | |
354 | 359 | | |
355 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
356 | 375 | | |
357 | 376 | | |
358 | 377 | | |
| |||
558 | 577 | | |
559 | 578 | | |
560 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
561 | 585 | | |
562 | 586 | | |
563 | 587 | | |
| |||
567 | 591 | | |
568 | 592 | | |
569 | 593 | | |
570 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
571 | 598 | | |
572 | 599 | | |
573 | 600 | | |
| |||
694 | 721 | | |
695 | 722 | | |
696 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
697 | 728 | | |
698 | 729 | | |
699 | 730 | | |
| |||
802 | 833 | | |
803 | 834 | | |
804 | 835 | | |
805 | | - | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
806 | 842 | | |
807 | 843 | | |
808 | 844 | | |
| |||
847 | 883 | | |
848 | 884 | | |
849 | 885 | | |
850 | | - | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
851 | 892 | | |
852 | 893 | | |
853 | 894 | | |
854 | 895 | | |
855 | 896 | | |
856 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
857 | 902 | | |
858 | 903 | | |
859 | 904 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1312 | 1312 | | |
1313 | 1313 | | |
1314 | 1314 | | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1315 | 1333 | | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
315 | 327 | | |
316 | 328 | | |
0 commit comments