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

Replace sole use of maxdict by lru_cache.#22323

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

Merged
timhoffm merged 2 commits intomatplotlib:mainfromanntzer:unmaxdict
Jan 27, 2022

Conversation

anntzer
Copy link
Contributor

... and expand the cache size, while we're at it.

Actual deprecation of maxdict can be done in#22299.

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@greglucas
Copy link
Contributor

:) You can bring the deprecation over here if you want, happy to close the other PR. While you're at it, do you want to add a test here to make sure we are hitting the cache as expected since I made the mistake on the other one that would only cache on each text instance?

timhoffm reacted with thumbs up emoji

@anntzer
Copy link
ContributorAuthor

Done (^2)

Copy link
Contributor

@greglucasgreglucas left a comment

Choose a reason for hiding this comment

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

All failures appear to be CI related.

@@ -0,0 +1,4 @@
``matplotlib.cbook.maxdict`` is deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

Change name of file?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

sure

@greglucasgreglucas mentioned this pull requestJan 26, 2022
6 tasks
@anntzeranntzerforce-pushed theunmaxdict branch 3 times, most recently fromda764ff to44d21acCompareJanuary 26, 2022 15:55
@anntzer
Copy link
ContributorAuthor

Edit: modified the implementation to not use pickle but instead key off an internally generated copy of fontprop (which the caller cannot access and thus cannot mutate).

Copy link
Member

@timhoffmtimhoffm left a comment
edited
Loading

Choose a reason for hiding this comment

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

Modulo one comment improvement. May self-merge after adressing.

Ah, and rebase should fix the CI failure (#22326).

Comment on lines 96 to 97
# the passed-in argument do not mess up the cache. dpi is not used, but
# participates in cache invalidation (via the renderer).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# the passed-in argument do not mess up the cache. dpi is not used, but
# participates in cache invalidation (via the renderer).
# the passed-in argument do not mess up the cache.

Move that note down, becausedpi is only passed on here. Clever tools will show unused in the function below and people might be tempted to remove it without consulting the context of the call site.

@tacaswelltacaswell added this to thev3.6.0 milestoneJan 26, 2022
anntzerand others added2 commitsJanuary 27, 2022 10:58
... and expand the cache size, while we're at it.
It was used in one place in the library and there is nowa standard library lru_cache that we can take advantage of instead.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@timhoffmtimhoffmtimhoffm approved these changes

@greglucasgreglucasgreglucas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

5 participants
@anntzer@greglucas@QuLogic@timhoffm@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp