Skip to content

Commit cb9dcf1

Browse files
author
miranov25
committed
Phase 13.17.DF v1.0: documentation refresh
- docs/README.md: full rewrite (883 lines, was 710) reflecting Phase 13.12-13.16 features. New sections: 'What's New in Phase 13.16.DF', 'Multi-Plot Overlays (same=True)', 'Vector Expressions', 'Auto-Title'. Mode 2 (AliasDataFrame) rewritten per ADF team Q&A with aDF.draw() as primary API and vector form recommended for multi-series. Mode 3 (RDataFrameDSL) revised to prefer vector syntax for multi-series overlays. Toolkit architecture table updated with RootInteractive status per architect Q&A. Expression Syntax table extended with bracket-vector rows. API table includes vector_style, group_style, auto_title, same parameters. Test file list updated (19 files, all verified against git ls-files). Test count 310 -> 451. Dead references removed (dfdraw_README.md, dfdraw_api_summary.md, test_facet.py). - examples/generate_gallery.py: full rewrite (600 lines) with 10 ALICE-flavored examples covering the full feature set. Per-example reproducible seeds. Example 08 is the vector-expression ITS centerpiece — two-panel figure showing the AD-37 bug reproduction (left: scalar loop with fresh DFDraw per call, 2 colors for 6 layers) alongside the Phase 13.16.DF fix (right: vector expression in a single call, 6 distinct colors). ALICE data generators (TPC tracks, ITS residuals, pulls) with physically-plausible distributions. Executed cleanly in production environment (10/10 figures generated). - examples/dfdraw_gallery.ipynb: new Jupyter notebook (27 cells) mirroring generate_gallery.py 1:1 with markdown commentary per example. Self-contained cells for experimentation. CI-testable via pytest-nbmake or nbconvert. Example 08 has extra markdown explaining the expected AD-37 before/after visual. Architect-confirmed to execute cleanly. - docs/dfdraw_PLOTTING_LIBRARY_COMPARISON.md: light refresh (342 lines, was 301). Added Phase 13.12-13.16 feature capabilities to ROOT TTree::Draw 'What to Keep' table (auto-title, same=True, vector expressions, batch QA). Added new rows to Plot Types comparison matrix. Phase 2 renamed, Phase 2b added for Interactive Features (Phase 13.12-13.16.DF) with 8 sub-items. Phase 3 Backend Abstraction and Phase 4 RootInteractive Integration checklists updated per architect Q&A (HistoNdCDS done, HTML export done in RootInteractive but not wired to dfdraw, bridge module not started). Current Status Summary updated (451 tests, 43 features, 21 invariance). Revision history entry 1.2. Strategic/architectural content preserved verbatim from v1.1. - docs/examples/*.png: 10 generated ALICE-flavored gallery figures (source of truth is generate_gallery.py). Repository hygiene: - Removed root-level dfdraw_Technical_Summary.md (duplicate of docs/ version; current canonical location is docs/dfdraw_Technical_Summary.md as of Phase 13.16.DF). - Moved dfdraw_PLOTTING_LIBRARY_COMPARISON.md into docs/ (was at project root). Governance: - First application of 'doc-only phase' lightweight gate pattern per Org v1.25 § Phase Lifecycle (justified in proposal §5.2: content derived from already- reviewed authoritative Phase 13.16.DF docs + ADF/RootInteractive team Q&A). - Single reviewer: Claude40 (author self-check). Independent cross-check: Claude42 (non-author, per proposal review Group F). Architect visual confirmation pre-review: gallery figures verified, notebook execution verified, text reasonableness confirmed. - Q&A-driven cross-team content: ADF team Q&A served as source-of-truth for README Mode 2 content with per-question traceability. RootInteractive team Q&A informed toolkit architecture table and PLOTTING_LIBRARY_COMPARISON Phase 4 status. Deferred to follow-up (not blocking): - docs/API_REFERENCE.md: 8 small clarity patches (4 GPT5 P1 items from Phase 13.16.DF documentation review + 4 Claude42 D-P2 items from Phase 13.16.DF documentation review). Tracked as Phase 13.17.1.DF or rolled into next doc-touch phase. - ADF-side persistent DFDraw cache for scalar same=True loops (architect is considering; suggested future phase: Phase 13.13.ADF v1.0). - MTTU codification of doc-only phase lightweight gate pattern. Approved by: - PHASE_13_17_DF_v1_0_Proposal_DocumentationRefresh.md (5 of 5 reviewers) - PHASE_13_17_DF_v1_0_PROPOSAL_REVIEW_SUMMARY.md - PHASE_13_17_DF_v1_0_CODE_REVIEW_REQUEST.md (this document) Prior phase: PHASE_13_16_DF_v1_0_END
1 parent 361d007 commit cb9dcf1

13 files changed

Lines changed: 1459 additions & 175 deletions

UTILS/dfextensions/dfdraw/dfdraw_PLOTTING_LIBRARY_COMPARISON.md renamed to UTILS/dfextensions/dfdraw/docs/dfdraw_PLOTTING_LIBRARY_COMPARISON.md

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# Plotting Library Comparison for dfdraw Wrapper Design
22

3-
**Date:** 2026-01-29 (Updated)
4-
**Purpose:** Inform wrapper design for dfdraw with potential RootInteractive backend
5-
**Author:** Claude2-dfdraw (Coder)
3+
**Date:** 2026-04-09 (Phase 13.17.DF refresh)
4+
**Original:** 2026-01-29 (Phase 13.6.G.DF initial version)
5+
**Purpose:** Inform wrapper design for dfdraw with potential RootInteractive backend
6+
**Author:** Claude2-dfdraw (original), Claude40 (Phase 13.17.DF status refresh)
67

78
---
89

910
## Executive Summary
1011

1112
This document compares dfdraw with other Python plotting libraries and ROOT to inform the design of a unified wrapper interface. The goal is to preserve ROOT's best features (one-liner syntax, rich statistics) while leveraging Python's ecosystem and avoiding ROOT's pain points.
1213

13-
**Update (Phase 13.6.G.DF):** Statistics enhancements now complete. dfdraw has full ROOT parity for statistics features.
14+
**Update (Phase 13.6.G.DF, 2026-01-29):** Statistics enhancements complete. dfdraw has full ROOT parity for statistics features.
15+
16+
**Update (Phase 13.16.DF, 2026-04-09):** Vector expression interface complete. Bracket-vector syntax (`"[y1,y2,y3]:x"`) provides single-call multi-series overlay, resolving the AD-37 AliasDataFrame color-cycling bug via architectural fix. 7 strong A≡B invariance tests establish the new testing quality bar.
17+
18+
**Update (Phase 13.17.DF, 2026-04-09):** This document refreshed to reflect Phase 13.12–13.16 capability additions. Status tables updated; backend abstraction section annotated with current RootInteractive integration status. No structural changes; strategic/architectural framing preserved from original.
1419

1520
---
1621

@@ -62,6 +67,10 @@ This document compares dfdraw with other Python plotting libraries and ROOT to i
6267
| **2D histograms** | `tree->Draw("y:x", "", "colz")` | `drawer.draw("y:x", type="hist2d")` | Density visualization |
6368
| **Population std** | ddof=0 | ddof=0 (Phase 13.6.G.DF) | ROOT compatibility |
6469
| **Range-aware stats** | Within range only | range_x, range_y (Phase 13.6.G.DF) | Filtered statistics |
70+
| **Auto-title from expression** | Auto | `auto_title=True` (Phase 13.12.DF) | QA plot caption automation |
71+
| **Multi-plot overlay on same axes** | `"same"` option | `same=True` (Phase 13.13.DF) | Superposition without manual axes |
72+
| **Multi-series from column list** | `tree->Draw("y1:x"); tree->Draw("y2:x","","same")` (loop) | `drawer.draw("[y1,y2,y3]:x")` (Phase 13.16.DF) | Single-call vector expression; fixes ADF color-cycling (AD-37) |
73+
| **Batch QA dashboards** | Canvas + Divide loop | `draw_batch(specs)` with group format (Phase 13.14.DF) | YAML/JSON spec-driven QA |
6574

6675
### ❌ Bad Parts (Avoid in Wrapper)
6776

@@ -108,6 +117,9 @@ This document compares dfdraw with other Python plotting libraries and ROOT to i
108117
| Hexbin | - | `hexbin()` | - | `hexbin()` ||
109118
| Facet/Grid | - | `subplots` | `FacetGrid` | `facet=True` | Layout system |
110119
| Group overlay | - | Manual | `hue=` | `group_by=` ||
120+
| **Same-axes superposition** | **`"same"` option** | **Manual `ax=`** | **Manual** | **`same=True` (13.13.DF)** | **figureArray** |
121+
| **Vector expression (multi-series)** | **Loop + "same"** | **Manual loop** | **`melt()` + `hue=`** | **`"[y1,y2]:x"` (13.16.DF)** | **figureArray** |
122+
| **Batch QA dashboard** | **Canvas + Divide** | **Manual subplots** | **FacetGrid** | **`draw_batch` group format (13.14.DF)** | **widgetArray + figureArray** |
111123

112124
---
113125

@@ -204,10 +216,10 @@ drawer.draw_batch(specs, backend='rootinteractive', save_dir='dashboards/')
204216

205217
## Feature Parity Checklist
206218

207-
### Phase 1: Core Parity (Current dfdraw) ✅ COMPLETE
219+
### Phase 1: Core Parity (Phase 13.5 and earlier) ✅ COMPLETE
208220
- [x] 1D/2D histograms
209221
- [x] Scatter plots
210-
- [x] Profile plots
222+
- [x] Profile plots
211223
- [x] Hexbin plots
212224
- [x] Grouping/overlay
213225
- [x] Faceting
@@ -222,33 +234,58 @@ drawer.draw_batch(specs, backend='rootinteractive', save_dir='dashboards/')
222234
- [x] Population std (ddof=0) for ROOT match
223235
- [x] 2D n counts both-valid pairs
224236

225-
### Phase 3: Backend Abstraction (Future)
226-
- [ ] PlotSpec intermediate representation
227-
- [ ] Matplotlib backend (refactor)
228-
- [ ] Bokeh backend
229-
- [ ] RootInteractive backend
230-
- [ ] Plotly backend (optional)
237+
### Phase 2b: Interactive Features (Phase 13.12–13.16.DF) ✅ COMPLETE
238+
- [x] **Auto-title from expression** (Phase 13.12.DF v1.2) — `auto_title=True` / style key
239+
- [x] **Profile enhancements** (Phase 13.12.DF) — `return_data`, `min_entries`, `group_by_bins`, `group_by_quantiles`, `sort_groups`, `weights`
240+
- [x] **Same-axes superposition** (Phase 13.13.DF) — `same=True` for all draw methods, auto-color, auto-label
241+
- [x] **Batch group format** (Phase 13.14.DF) — `draw_batch` with defaults cascade, subplot grids, `verbose=2` debug
242+
- [x] **Test infrastructure** (Phase 13.15.DF) — feature taxonomy (43 features), capability matrix, `run_tests.sh`, reviewer.zip packaging
243+
- [x] **Vector expression interface** (Phase 13.16.DF) — bracket syntax `"[y1,y2,y3]:x"`, `"y:[x1,x2]"`, `"[y1,y2]:[x1,x2]"`, paren-aware split, `vector_style`/`group_style` channels
244+
- [x] **Strong A≡B invariance testing** (Phase 13.16.DF) — 7 byte-identical axis + per-pair stats comparisons
245+
- [x] **AD-37 architectural fix** (Phase 13.16.DF) — single-instance vector path bypasses AliasDataFrame color-cycling bug
246+
247+
### Phase 3: Backend Abstraction (Partially Complete)
248+
249+
Status updated 2026-04-09 per architect Q&A (PHASE_END_PHASE-0.2.A):
250+
251+
- [ ] **PlotSpec intermediate representation** — Not started
252+
- [x] **Matplotlib backend (refactor)** — Current production backend, in use
253+
- [ ] **Bokeh backend** — Not started
254+
- [ ] **RootInteractive backend** — Bridging module proposed but not implemented; architecture direction (e.g., `dfdraw.backends.rootinteractive`) is architect decision pending
255+
- [ ] **Plotly backend (optional)** — Not started
256+
257+
**Summary:** Backend abstraction as a formal architectural layer has not been built. dfdraw continues to use matplotlib directly. The RootInteractive foundation work (see Phase 4 below) is proceeding in the RootInteractive repository; the dfdraw-facing bridge remains proposal/prototype stage.
258+
259+
### Phase 4: RootInteractive Integration (Partially Complete)
260+
261+
Status updated 2026-04-09 per RootInteractive team Q&A (PHASE_END_PHASE-0.2.A):
262+
263+
- [x] **N-dimensional histogram export** — Done in RootInteractive (`HistoNdCDS` exists and is validated)
264+
- [ ] **Dashboard layout specification** — Not started (no dfdraw-facing spec)
265+
- [x] **HTML export** — Done in RootInteractive itself via `bokehDrawSA.fromArray()`, but not wired to dfdraw
266+
- [ ] **Live aggregation mode** — Not started
267+
268+
**Summary:** RootInteractive foundation capabilities (compression, histograms, ONNX, joins) are advancing in phases 0.1.B–0.2.A of the RootInteractive repository. There is currently no implemented dfdraw→RootInteractive integration layer — none of the API patterns proposed in the [Proposed Wrapper Architecture](#proposed-wrapper-architecture) section above are functional today. When the bridging work begins, the RootInteractive team will communicate the phase ID, API shape, and stability level.
231269

232-
### Phase 4: RootInteractive Integration (Future)
233-
- [ ] N-dimensional histogram export
234-
- [ ] Dashboard layout specification
235-
- [ ] HTML export
236-
- [ ] Live aggregation mode
270+
**For dfdraw users today:** use matplotlib backend (the default and only working backend). For interactive multi-dimensional exploration of ALICE data, use RootInteractive directly at https://github.com/miranov25/RootInteractive.
237271

238272
---
239273

240274
## Current Status Summary
241275

242-
### dfdraw Capabilities (Phase 13.6.G.DF)
276+
### dfdraw Capabilities (Phase 13.16.DF, refreshed Phase 13.17.DF)
243277

244278
| Category | Status | Details |
245279
|----------|--------|---------|
246280
| **Plot Types** | ✅ Complete | 5 types: hist, scatter, profile, hist2d, hexbin |
247-
| **Statistics** | ✅ Complete | Full ROOT parity including robust stats |
281+
| **Statistics** | ✅ Complete | Full ROOT parity including robust stats (Phase 13.6.G.DF) |
282+
| **Multi-series overlay** | ✅ Complete | Vector expressions + `same=True` chaining (Phases 13.13.DF, 13.16.DF) |
283+
| **Batch QA** | ✅ Complete | Group format, subplot grid, defaults cascade (Phase 13.14.DF) |
284+
| **Auto-title** | ✅ Complete | Expression-derived titles (Phase 13.12.DF v1.2) |
248285
| **Styling** | ✅ Complete | Global + per-plot + matplotlib pass-through |
249286
| **Integration** | ✅ Complete | AliasDataFrame, PyArrow, batch mode |
250-
| **Testing** | ✅ Complete | 310 tests, 100% passing |
251-
| **Documentation** | ✅ Complete | README, API_REFERENCE, PHASE_HISTORY |
287+
| **Testing** | ✅ Complete | 451 tests, 43 features, 21 invariance tests, 100% passing |
288+
| **Documentation** | ✅ Complete | README (refreshed Phase 13.17.DF), API_REFERENCE, PHASE_HISTORY, Technical Summary, Capability Matrix |
252289

253290
### ROOT Compatibility Achieved
254291

@@ -259,6 +296,9 @@ drawer.draw_batch(specs, backend='rootinteractive', save_dir='dashboards/')
259296
| 2D both-valid n | Yes | Yes | ✅ Match |
260297
| Auto stats fields | Yes | Yes | ✅ Match |
261298
| Robust stats | Yes | Yes | ✅ Match |
299+
| Multi-series overlay | `"same"` option | `same=True` / vector `"[y1,y2]:x"` | ✅ Match (two paths) |
300+
| Auto-title | Auto | `auto_title=True` | ✅ Match |
301+
| Batch QA dashboard | Canvas + Divide | `draw_batch` group format | ✅ Match |
262302

263303
---
264304

@@ -299,3 +339,4 @@ drawer.draw_batch(specs, backend='rootinteractive', save_dir='dashboards/')
299339
|---------|------|---------|
300340
| 1.0 | 2026-01-29 | Initial comparison document |
301341
| 1.1 | 2026-01-29 | Updated for Phase 13.6.G.DF completion: statistics enhancements complete, ROOT parity achieved |
342+
| 1.2 | 2026-04-09 | Phase 13.17.DF refresh: added Phase 13.12–13.16 feature capabilities (auto-title, same=True, draw_batch groups, vector expressions, strong invariance testing, AD-37 architectural fix); updated Plot Types and ROOT TTree::Draw "What to Keep" matrices with new multi-series / vector / batch rows; updated Phase 3 Backend Abstraction and Phase 4 RootInteractive Integration checklists with current status per architect Q&A (2026-02-22); test count 310 → 451, feature count → 43, added invariance test count 21; Current Status Summary updated with new capability categories. Strategic/architectural framing preserved verbatim from v1.1; no structural changes.
23.9 KB
Loading
36.9 KB
Loading
240 KB
Loading
283 KB
Loading
265 KB
Loading
43.4 KB
Loading
50.3 KB
Loading
299 KB
Loading
120 KB
Loading

0 commit comments

Comments
 (0)