Conversation Summary (Restart Context)
Project: time-plot (/home/myles/time-plot)
Goal:
- Build a plugin-based time-series plotting CLI that parses CSV files, supports expressions, aligns datasets on a common x-grid, and outputs self-contained offline HTML plots using uPlot.
What Was Implemented
- Plugin system
- Deterministic plugin discovery from
plugins/(sorted order). - Seed plugin renamed/implemented as
voltage-vs-time-csvinplugins/voltage_vs_time_csv. - Recognizes
.csvfiles with headers liketime(ns),voltage(v)and ignores units in header matching. - Parses units from parentheticals and converts to base SI (
s,v).
- Units and scaling
- Added
time_plot/units.py. - Input units are parsed and normalized to base SI.
- Plotting auto-selects readable SI prefixes for display (ASCII prefixes like
u).
- Sample/example data
- Added generation for
sample_data/sine.csvandsample_data/cosine.csv. - Headers use unit parentheticals (for example
time(ns),voltage(mv)). - Added CLI command
sample-files. - Added script
scripts/generate_example_data.py.
- CLI
- Click-based CLI implemented.
- Supports:
- files
- named files (
name:path) - expressions (
expr[...]andname:expr[...]) - default names
fN
main.pyentrypoint remains a dev fallback.
- Multi-file processing
- Added x-axis alignment/interpolation onto a common deterministic grid.
- Validates strictly increasing x.
- Uses smallest timestep across inputs as global timestep.
- Includes exact
x_maxendpoint even if off-grid. - No extrapolation outside source ranges (
NaN).
- Expressions
- Safe AST-based evaluator in processing path.
- Supported operators:
+,-,*,/ - Supported functions:
sin(),cos(),ddt() - Supports chained expressions and references to named inputs/expressions.
- Detects circular references, unknown references, duplicate dataset names.
ddt()sets first output sample equal to second sample when available.
- Plotting / HTML output
- uPlot HTML output supports multi-trace plotting.
- Dual y-axis support (up to 2 y-axis types).
- HTML is self-contained and offline:
- uPlot JS/CSS vendored and embedded inline
- no CDN dependency
- SVG fallback renderer remains in place if uPlot is unavailable.
- Build/sync tooling
- Added local PEP 517 backend (
local_build_backend.py) to support offlineuv build. - Implemented editable install hooks so
uv syncanduv run pytestwork properly with live workspace code.
Tests Added
tests/test_units.pytests/test_voltage_time_csv_plugin.pytests/test_sample_data.pytests/test_cli_parsing.pytests/test_processing.pytests/test_plotting.pytests/test_cli_integration.py
Recent validations passed, including:
uv sync --group dev --reinstall-package time-plotuv run pytest ...(integration/processing/plotting suites all passing)
Commits Made
092fb54Initial plugin-based time plot prototype6a1b0ceAdd seed plugin utility data workflow and CLI parsing groundwork4487b40Add multi-file alignment and combined plottingafc1960Add expression evaluation for aligned datasets097b12bHarden alignment grid and expression naming checks1c2e01cStore global timestep and fix editable installs
AGENTS.md Work
- User iteratively updated
AGENTS.md. - I reviewed and implemented corresponding code changes multiple times.
- Latest pass was a cleanup/rewrite of
AGENTS.mdonly (no code changes), adding:Current Implemented FeaturesKnown Limitations (Current)MVP Scope (Next Work)Project Goals (Target Behavior)- clearer naming/terminology
- expression semantics clarifications
- plotting/data-model clarifications
- validation checklist
Current Repo State
- Codebase is in a working state with committed implementation through expression/alignment/plotting features.
AGENTS.mdhad uncommitted changes after the last session (cleanup/rewrite was applied but not committed).
Likely Next Steps
- Extend expression function set beyond
sin,cos,ddt. - Improve unit semantics for expression outputs (stricter composed-unit handling).
- Add more plugins / second y-axis data type examples to exercise dual-axis behavior end-to-end.
- Refine legend precedence and UX edge cases if needed.
If you want, I can also format this as a shorter “new-session bootstrap prompt” version.