FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

TST: Add tests for Affine2D by QuLogic · Pull Request #27511 · matplotlib/matplotlib · GitHub

Repository navigation

TST: Add tests for Affine2D - #27511

Merged
oscargus merged 1 commit into
matplotlib:mainfrom
QuLogic:affine-tests
Dec 14, 2023
Merged

oscargus merged 1 commit into
matplotlib:mainfrom
QuLogic:affine-tests

Conversation

QuLogic commented Dec 13, 2023 •
edited
Loading

Copy link
Copy Markdown
Member

PR summary

This is implicitly tested via all plots and layout. However, this makes it difficult to work on the transform stack directly (cf #22191), which these tests rectify.

I deliberately chose points/angles that were easy to work out in my head, so hopefully there are not any edge cases that were missed here. (Except for skew, for which I don't have an inherent idea of what that transform looks like, so I admit to just copy-pasting the existing output there.)

PR checklist

Comment thread lib/matplotlib/tests/test_transforms.py Outdated
Comment on lines +104 to +105
trans_rad = Affine2D().skew(np.pi / 12, np.pi / 12)
trans_deg = Affine2D().skew_deg(15, 15)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thinking a bit more, this should probably skew different angles for x and y.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Talked with @ksunden and decided to use a couple of back-calculated values that produce a reasonable set of results.

This is implicitly tested via all plots and layout. However, this makes
it difficult to work on the transform stack directly, which these tests
rectify.

oscargus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

One may consider using match for the error tests, but that was not present in the earlier code anyway, so no point in requiring it here.

oscargus merged commit e90058d into matplotlib:main Dec 14, 2023
QuLogic deleted the affine-tests branch December 14, 2023 08:20
QuLogic added this to the v3.9.0 milestone Dec 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL