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

Deprecate passing Type1Font effects as dict#15896

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

Conversation

timhoffm
Copy link
Member

PR Summary

https://matplotlib.org/devdocs/api/type1font.html#matplotlib.type1font.Type1Font.transform has a peculiar API of passing two optional parameters as dict.

This PR deprecates that behavior and instead introduces two regular keyword arguments with default values.

PR Checklist

  • Code isFlake 8 compliant
  • Documentation is sphinx and numpydoc compliant
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@timhoffmtimhoffmforce-pushed thedeprecate-type1font-transform-param branch from77a6dee to75ed591CompareDecember 10, 2019 00:46
@timhoffmtimhoffmforce-pushed thedeprecate-type1font-transform-param branch from75ed591 to572e4ebCompareDecember 10, 2019 00:49
Copy link
Contributor

@anntzeranntzer left a comment

Choose a reason for hiding this comment

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

Actually I think the old API makes sense,effects is really just a lightweight object/namedtuple. If you track the callers you will see that ultimatelyeffects comes from reading pdftex.map, which contain entries speficying font slant and extend, which always come as a single pair, not as separate things.

@timhoffm
Copy link
MemberAuthor

Then the usage example athttps://matplotlib.org/api/type1font.html#module-matplotlib.type1font is misleading because it's not actual a use case? It explicitly creates single-item tuples and passes them to the function.

@anntzer
Copy link
Contributor

Sorry, I guess my comment was slightly misleading. The entries in pdftex.map don't necessarily specify both sland and extend, the idea is more that the two of them (or only one of them, if only one of them exists) are carried together as a dict through multiple functions and it doesn't make sense to split them at the last minute.

@timhoffm
Copy link
MemberAuthor

Will decide later if I want to follow up on this.

@anntzer
Copy link
Contributor

at least the (independent) docstring cleanups are fine by themselves.

@timhoffmtimhoffm mentioned this pull requestDec 15, 2019
@anntzer
Copy link
Contributor

(I guess one could introduce a namedtuple to represent the slant/extend pair, but that feels a bit overengineered to me -- there's some level at which dicts are just fine...)

@timhoffm
Copy link
MemberAuthor

Not going to fight over this.

@timhoffmtimhoffm deleted the deprecate-type1font-transform-param branchDecember 19, 2019 07:18
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@timhoffm@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp