Make chart data generation reproducible - #54
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe change adds a documented Python workflow for generating the chart-analysis simulation CSV, updates ChangesChart reproduction workflow
Workflow checks
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant generate_published_results.py
participant CsvBatch
participant OutputCSV
participant vseCheck.R
User->>generate_published_results.py: Run with elections, seed, and output path
generate_published_results.py->>CsvBatch: Configure and execute batch
CsvBatch->>OutputCSV: Write simulation CSV
User->>vseCheck.R: Pass CSV path as one argument
vseCheck.R->>OutputCSV: Read supplied CSV
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideMake chart analysis data generation reproducible by adding a Python results generator script, wiring the R visualization to accept an explicit CSV path, and documenting the chart reproduction workflow. Sequence diagram for reproducible chart data generation and analysissequenceDiagram
actor User
participant PythonScript as generate_published_results.py
participant CsvBatch
participant RScript as vseCheck.R
participant fread as data.table_fread
User->>PythonScript: python scripts/generate_published_results.py --elections 15000 --output artifacts/published-results
PythonScript->>CsvBatch: CsvBatch(KSModel, allSystems, niter, baseName, seed)
CsvBatch-->>PythonScript: output_file
PythonScript-->>User: print(output_file)
User->>RScript: Rscript vseCheck.R PATH_TO_RESULTS.csv
RScript->>RScript: commandArgs(trailingOnly=TRUE)
RScript->>fread: fread(PATH_TO_RESULTS.csv)
fread-->>RScript: fvse data
RScript-->>User: charts from honestScenarios2
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
vseCheck.R, consider allowing additional arguments or using a named flag instead of enforcing exactly one positional argument, so future extensions to the script’s CLI don’t break the usage check. - In
generate_published_results.py, the--seedparameter defaults to a string liketarget15000; clarifying in the help text how this seed is interpreted (and how to choose alternative seeds) would make reproducibility behavior more transparent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `vseCheck.R`, consider allowing additional arguments or using a named flag instead of enforcing exactly one positional argument, so future extensions to the script’s CLI don’t break the usage check.
- In `generate_published_results.py`, the `--seed` parameter defaults to a string like `target15000`; clarifying in the help text how this seed is interpreted (and how to choose alternative seeds) would make reproducibility behavior more transparent.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
vseCheck.R (1)
142-142: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAddress the truncated comment.
This comment appears to end abruptly ("but it's a)"). Consider completing the sentence or removing it if the thought is no longer relevant.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@vseCheck.R` at line 142, Update the truncated comment near the strategy-refinement note so it forms a complete, clear sentence, or remove it if the thought is no longer relevant; do not leave the unfinished “but it’s a)” text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@vseCheck.R`:
- Line 142: Update the truncated comment near the strategy-refinement note so it
forms a complete, clear sentence, or remove it if the thought is no longer
relevant; do not leave the unfinished “but it’s a)” text.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f499fea2-1661-46cb-a943-b75b3d21b657
📒 Files selected for processing (4)
README.mddocs/chart-reproduction.mdscripts/generate_published_results.pyvseCheck.R
Co-authored-by: Cursor <cursoragent@cursor.com>
Closes #20.
Adds a documented full-results generator for the chart analysis and changes
vseCheck.Rto accept the generated CSV path explicitly. Generated simulation output remains untracked.Validation:
uv run python scripts/generate_published_results.py --elections 1 --output /tmp/vse-published-smokeuv run python -m pytest -qSummary by Sourcery
Make chart analysis data generation reproducible by introducing a scripted CSV generator and updating the R analysis to consume an explicit results file path.
New Features:
Enhancements:
Documentation:
Summary by CodeRabbit