Skip to content

MNT: Deprecate cbook.maxdict #22299

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

greglucas
Copy link
Contributor

PR Summary

It was used in one place in the library and there is now a standard library lru_cache that we can take advantage of instead. This adds a new private method that is called after the key is created.

Closes #22278

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

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

It was used in one place in the library and there is now
a standard library lru_cache that we can take advantage of instead.
Comment on lines +299 to +300
@functools.lru_cache(maxsize=50)
def _get_layout_cache(self, key, renderer):
Copy link
Member

Choose a reason for hiding this comment

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

This is broken from what @anntzer mentioned, because it's caching on self.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🐑 Doh! Should have read that closer. I'll move to draft for now and wait until #22271 goes in to have another look at this.

Copy link
Member

Choose a reason for hiding this comment

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

FYI #22271 is in.

@greglucas greglucas marked this pull request as draft January 25, 2022 15:11
@greglucas
Copy link
Contributor Author

Closing in favor of #22323

@greglucas greglucas closed this Jan 26, 2022
@greglucas greglucas deleted the rm-max-dict branch January 26, 2022 15:05
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.

Deprecate/remove maxdict
3 participants