Skip to content

Conversation

@tmustier
Copy link
Owner

Summary

Complete the remaining chart-engine typing cleanup by removing all file-level pyright suppression headers and replacing dynamic access with explicit typed coercion/wrappers.

This continues the incremental overlay/refactor series and finishes the suppression-reduction pass across chart-engine core modules.

Commits in this PR

  1. refactor(chart-engine): type chart style and template helpers
  2. refactor(chart-engine): tighten typing for chart builder orchestration
  3. refactor(chart-engine): tighten typing for chart payload builders
  4. refactor(chart-engine): tighten typing for annotation helpers
  5. test(charts): narrow payload style mapping types in assertions
  6. docs(chart-engine): update typing cleanup roadmap

Main changes

  • Removed remaining broad pyright suppression headers from:

    • clean_slides/chart_engine/style.py
    • clean_slides/chart_engine/text_templates.py
    • clean_slides/chart_engine/template_ops.py
    • clean_slides/chart_engine/overlays.py
    • clean_slides/chart_engine/builder.py
    • clean_slides/chart_engine/payloads.py
    • clean_slides/chart_engine/annotations.py
  • Added typed coercion/normalization helpers where needed (mapping/list/number/color/base_dir parsing) to avoid unknown-type propagation while preserving behavior.

  • Introduced typed callable boundaries in builder.py for dynamic module entrypoints (add_waterfall_title, payload builders).

  • Kept existing chart behavior while tightening internals:

    • chart template relinking,
    • plot/axis/style application,
    • builder slide/template orchestration,
    • bar/waterfall payload generation,
    • annotation + line/shape textbox handling.
  • Updated tests to narrow payload-style mapping access under strict pyright.

  • Updated clean_slides/chart_engine/README.md roadmap text now that suppression cleanup is complete.

Validation

  • .venv/bin/pyright
  • .venv/bin/pytest -q
  • .venv/bin/pre-commit run --all-files

@tmustier tmustier merged commit 9b0b46d into main Feb 12, 2026
7 checks passed
@tmustier tmustier deleted the refactor/chart-engine-typing-complete branch February 12, 2026 02:18
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09215957b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

labels.font.size = font_size
else:
labels.font.size = Pt(float(font_size))
labels.font.size = Pt(float(_int(font_size, int(DEFAULT_BAR_DATA_LABEL_FONT_SIZE))))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use point default when coercing data-label font size

apply_data_label_style now falls back via Pt(float(_int(font_size, int(DEFAULT_BAR_DATA_LABEL_FONT_SIZE)))), but int(DEFAULT_BAR_DATA_LABEL_FONT_SIZE) is an EMU value, not points. When data_labels.font_size is present but not an Pt instance (for example a quoted numeric like "14"), this path produces a massive point size instead of the intended default/parsed size, which can make labels overflow or render unusably large.

Useful? React with 👍 / 👎.

if series_selector:
series_names = [series.name for series in chart.series]

if series_selector is not None:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat empty series selectors as unset for data labels

The selector gate changed from a truthy check to is not None, so configs like data_labels: {series_indices: []} no longer fall back to plot-level labels and instead apply labels to zero series. This is a behavior regression from the previous implementation and can silently drop all data labels when templating emits an empty selector list.

Useful? React with 👍 / 👎.

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