Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: Add option to relpace text with boxes in image_comparision test#29871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

timhoffm
Copy link
Member

@timhoffmtimhoffm commentedApr 5, 2025
edited
Loading

This should be the right level of simplification when text is relevant in image comparision tests but the exact characters do not matter. The drawn bboxes only rely on font metrics and thus give accurate sizes, while being insensitive to rendering details.

Alternative to#29833.

This is a minimal proof-of-concept. Exact implementation may be improved:

  • How should boxes be rendered? Is one or the other better in terms of png compression?
    • only outline with transparent face (current choice)
    • fully filled?
  • Is a true/false flag sufficient or should this be configurable?
    • styling options
    • option to draw text and box (possibly mainly good for debug purposes)
  • for a start, the global replacement at draw time should be sufficident. One could refine for selective replacement if needed later.

This should be the right level of simplification when text is relevantin image comparision tests but the exact characters do not matter. Thedrawn bboxes only rely on font metrics and thus give accurate sizes,while being insensitive to rendering details.This is a minimal proof-of-concept. Exact implementation may be improved.
@QuLogic
Copy link
Member

Looks like we crossed with#29872.

The drawn bboxes only rely on font metrics and thus give accurate sizes, while being insensitive to rendering details.

Unfortunately, relying on font metrics is not safe to avoid changes in test images. For example, if you change the hinting settings inmatplotlib.testing.set_font_settings_for_testing (one of the things I want to do in#29816), then the tests here fail.

@timhoffmtimhoffm mentioned this pull requestApr 5, 2025
5 tasks
@timhoffm
Copy link
MemberAuthor

Superseeded by#29872.

@timhoffmtimhoffm reopened thisApr 5, 2025
@timhoffmtimhoffm requested a review fromCopilotApril 5, 2025 09:23
Copy link

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

"""
A helper flag to replace texts by a bounding box. This is primarily
intended for use in figure comparison tests.
For sipmlicity, the flag is evaluated at draw time and thus applies
Copy link
Preview

CopilotAIApr 5, 2025

Choose a reason for hiding this comment

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

There is a spelling error in the word 'sipmlicity'; consider correcting it to 'simplicity'.

Suggested change
Forsipmlicity,theflagisevaluatedatdrawtimeandthusapplies
Forsimplicity,theflagisevaluatedatdrawtimeandthusapplies

Copilot uses AI. Check for mistakes.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ok, just wanted to try what copilot review suggested.

rcomer reacted with eyes emoji
Copy link
Member

Choose a reason for hiding this comment

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

It didn't even manage to catch the typos in the PR title...

rcomer reacted with laugh emoji
@timhoffmtimhoffm deleted the image-comparison-text-box branchApril 5, 2025 09:25
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

Copilot code reviewCopilotCopilot left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@timhoffm@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp