Skip to content

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 13, 2022

PR Summary

  • Turn _mathtext.ship into a plain function.

Making it a plain function with two nested mutually recursive functions,
instead of a singleton object with methods, makes ship() thread-safe at
no cost (otherwise, two threads calling ship() at the same time would
overwrite each other's instance variables).

  • Remove unused recursion depth tracking in ship.

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).

@oscargus
Copy link
Member

Just some minor doubts to possible consider, but I also found this line that probably should be changed:

# Shipping pages out (Ship class)

@anntzer
Copy link
Contributor Author

anntzer commented Feb 17, 2022

Edit: I also made clamp shorter.

Making it a plain function with two nested mutually recursive functions,
instead of a singleton object with methods, makes ship() thread-safe at
no cost (otherwise, two threads calling ship() at the same time would
overwrite each other's instance variables).
@QuLogic QuLogic merged commit 3c6efec into matplotlib:main Feb 18, 2022
@QuLogic QuLogic added this to the v3.6.0 milestone Feb 18, 2022
@anntzer anntzer deleted the ship branch February 18, 2022 23:35
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.

4 participants