Skip to content

Latest commit

 

History

History
131 lines (100 loc) · 5.58 KB

File metadata and controls

131 lines (100 loc) · 5.58 KB
title plot-cli v0.5.0 — Scatter Support & Quality Audit
version_from 0.4.1
version_to 0.5.0
branch wip
commit_prefix WIP:
co_author Co-Authored-By: Oz <oz-agent@warp.dev>
project_root .
package_dir src/plot_cli
test_command uv run pytest
smoke_test_scatter uv run plot /tmp/data.csv --scatter -x x -y y
smoke_test_line uv run plot /tmp/data.csv --line -x x -y y

plot-cli v0.5.0 — Scatter Support & Quality Audit

Summary

Wire the existing Figure.scatter() method into the CLI as --scatter, add a --marker option, fix quality issues (pandas deprecation warning, stale README), expand test coverage for plot types, and bump to v0.5.0.

Key Context

  • Figure.scatter() already exists in src/plot_cli/plot.py (wraps tplot.Figure.scatter). It accepts x, y, marker, color, label. Added in commit 612d028.
  • The CLI plot-type system uses a mutually exclusive argparse group: --plot-type, --line, --hist. We add --scatter following this same pattern.
  • _render_plot() in __init__.py branches on self.plot_type ('line' or 'hist'). We add a 'scatter' branch (NaN filtering same as line, plus self.marker).
  • sacct-plot (../../purduercac/sacct-plot/) imports plot_cli.plot.TimeSeriesFigure as a library. It currently calls .line(). Once v0.5.0 is released it can call .scatter() the same way.
  • Test suite: 48 tests pass, but 9 emit Pandas4Warning about deprecated 'epoch' date format in _output_json().

Phase 1 — Scatter CLI Integration

Files: src/plot_cli/__init__.py

  • Add 'scatter' to --plot-type choices in plot_type_interface
  • Add --scatter as store_const alias (same pattern as --line/--hist)
  • Add --marker argument (string, default '•') for scatter marker character
  • Update APP_USAGE to include --scatter in the usage line
  • Update APP_HELP to document --scatter and --marker options
  • Add 'scatter' branch in _render_plot(): filter NaN (same as line), call self.figure.scatter() with self.marker
  • Commit: WIP: wire scatter and marker into CLI

Phase 2 — Quality Fixes

Pandas deprecation warning

File: src/plot_cli/__init__.py

  • In _output_json(), change to_json(orient='records', indent=2) to to_json(orient='records', indent=2, date_format='iso')
  • Commit: WIP: fix pandas date_format deprecation warning

README updates

File: README.md

  • Change install command to uv tool install git+https://github.com/glentner/plot-cli (remove version pin)
  • Add --scatter to the usage synopsis line
  • Add scatter and marker rows to the Options Reference table
  • Add a brief scatter usage example section
  • Mention scatter support in the project description paragraph
  • Commit: WIP: update README for scatter, marker, and install command

Phase 3 — Test Coverage

Files: tests/test_app.py, tests/test_cli.py

  • test_app.py: add unit test that --scatter is accepted (e.g., PlotApp.main([csv, '--scatter', '--json']) does not error)
  • test_cli.py: add TestPlotTypeOptions class with integration tests:
    • test_scatter_json_output — verifies --scatter + --json produces valid JSON
    • test_line_json_output — verifies --line + --json produces valid JSON (parity)
    • test_scatter_csv_output — verifies --scatter + --csv produces valid CSV
  • Commit: WIP: add scatter and plot-type test coverage

Phase 4 — Version Bump & Validation

  • Bump pyproject.toml version from 0.4.1 to 0.5.0
  • Run uv run pytest — all tests pass, zero warnings
  • Smoke test: uv run plot /tmp/data.csv --scatter -x x -y y renders scatter
  • Smoke test: uv run plot /tmp/data.csv --scatter --marker x -x x -y y renders with x marker
  • Smoke test: uv run plot /tmp/data.csv --line -x x -y y still works
  • Final commit: WIP: bump version to 0.5.0

Continuation Prompt

Read ROADMAP.md and AGENTS.md in this project. These documents contain the
full implementation plan and project conventions for plot-cli v0.5.0.

Execute the following procedure:

1. Read the YAML frontmatter in ROADMAP.md. Extract:
   - branch (work must happen on this branch)
   - commit_prefix (prepend to all commit messages)
   - co_author (append to all commit messages on its own line)
   - test_command (run after making changes)
   - smoke_test_scatter and smoke_test_line (run during Phase 4 only)

2. Scan the phase checklists (Phase 1 through Phase 4) and identify the
   first phase that contains any unchecked item (- [ ]). This is the
   current phase. Phases with all items checked (- [x]) are already done
   — do not redo them.

3. Execute ONLY the current phase:
   a. Implement all unchecked items in that phase.
   b. Run the test_command (`uv run pytest`) and confirm all tests pass.
      If Phase 4, also run the smoke test commands.
   c. If tests fail, fix the issue before proceeding.

4. After the phase is fully implemented and tests pass:
   a. Update ROADMAP.md: change each completed item from `- [ ]` to `- [x]`.
   b. Stage all changes and commit on the wip branch using the commit
      message specified in that phase's final checklist item (the one that
      starts with "Commit:"). Use the commit_prefix and co_author line.
   c. If the phase has multiple commit items, make separate commits for
      each logical group as indicated.

5. STOP. Report what was completed in this phase and wait for further
   instructions. Do NOT proceed to the next phase automatically.

If all phases are already checked off, report that the roadmap is complete.