Skip to content

add chart in ResultFormatter#199

Merged
JaredforReal merged 2 commits intomainfrom
chart
Apr 16, 2026
Merged

add chart in ResultFormatter#199
JaredforReal merged 2 commits intomainfrom
chart

Conversation

@JaredforReal
Copy link
Copy Markdown
Collaborator

fix #196

Signed-off-by: JaredforReal <w13431838023@gmail.com>
Signed-off-by: JaredforReal <w13431838023@gmail.com>
Copilot AI review requested due to automatic review settings April 16, 2026 03:24
@JaredforReal JaredforReal merged commit 20ad544 into main Apr 16, 2026
4 checks passed
@JaredforReal JaredforReal deleted the chart branch April 16, 2026 03:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes #196 by ensuring layout regions labeled as "chart" (typically task_type: "skip") are treated like image regions in ResultFormatter.process(), so they are saved into image_files and embedded into markdown output instead of being silently dropped.

Changes:

  • Update ResultFormatter.process() to preserve and render any task_type == "skip" regions (not just label == "image") by carrying an internal _is_image flag through formatting.
  • Add a non-empty default label_visualization_mapping in ResultFormatterConfig (including "chart" under the "image" category) to align programmatic defaults with the packaged YAML config.
  • Add unit tests covering chart-region inclusion and a fallback case when label_visualization_mapping is explicitly empty.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
glmocr/postprocess/result_formatter.py Treats task_type: "skip" regions as image regions during filtering + markdown/image resolution.
glmocr/config.py Sets a default label_visualization_mapping that maps "chart""image" (and standardizes other label categories).
glmocr/tests/test_unit.py Adds regression tests ensuring chart regions produce image_files entries and markdown embeds (including empty-mapping fallback).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

ResultFormatter.process() only saves "image" regions to image_files, drops "chart" regions

2 participants