Skip to content

[WIP] Fix FT Service issue#344

Draft
artek0chumak wants to merge 1 commit intonextfrom
artekchumak/mosh-2342-metric-plots-in-the-client
Draft

[WIP] Fix FT Service issue#344
artek0chumak wants to merge 1 commit intonextfrom
artekchumak/mosh-2342-metric-plots-in-the-client

Conversation

@artek0chumak
Copy link
Copy Markdown
Contributor

No description provided.

@artek0chumak artek0chumak force-pushed the artekchumak/mosh-2342-metric-plots-in-the-client branch 2 times, most recently from 6667dc1 to 5f57c82 Compare April 29, 2026 09:09
…klines

Introduces a domain-agnostic ASCII chart and sparkline rendering engine
(src/together/lib/cli/utils/plots/_engine.py) and wires it into the
fine-tuning CLI so training metrics are displayed as terminal charts.

Engine highlights:
- Figure class: composable chart builder with add_trace/plot API
- sparklines: compact block-character sparkline rows per series
- Pure stdlib + rich; no numpy/matplotlib dependency

Bugs fixed during review:
- _interpolate: replace O(n²) list scan with bisect; fix misleading
  docstring; correct edge-case handling for before-first and after-last
- _x_labels: guard ZeroDivisionError when n_xticks < 2
- _uniform_grid: guard ZeroDivisionError when n <= 1
- _log_transform: remove stale placeholder initialisation
- Figure.render: raise ValueError when traces mix log/linear y-scales
- sparklines: compute independent y_grid per series to avoid mixing
  log-transformed and linear values on a shared scale

Readability improvements:
- Document the inverted coordinate system in _draw_lines
- Replace sorted()[0] with min(key=...) in _to_plot_rows
- Delegate Figure.plot to add_trace to eliminate duplicated body
- Replace enumerate+index with zip in _render_body
- Add module-level note on the two data representations
- Move bisect import to top-level block
@artek0chumak artek0chumak force-pushed the artekchumak/mosh-2342-metric-plots-in-the-client branch from 5f57c82 to 1c34308 Compare May 1, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant