Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move the debug-mode TransformNode.write_graphviz out. #14725

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

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 9, 2019

It was only accessible by modifying the source of transforms.py to set
DEBUG to True (before the module is imported), and anyways broken
because transforms are not hashable in Py3 (so the call to hash()
fails).

Instead move it to a private module.

Example use:

from matplotlib._internal_utils import graphviz_dump_transform
graphviz_dump_transform(plt.gca().transAxes, "/tmp/test.png")

Also, stop tracking transform node children even in debug mode, as it
was only used when dumping the transform but that's not even necessary
-- one can just inspect vars(node) to look for children.

Also fix AffineBase.__eq__ to check that the "other" object has a
get_matrix method, to not raise an AttributeError when comparing with
Bboxes (which don't).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer force-pushed the graphviz_dump_transform branch from cc14f4e to 172baa1 Compare July 9, 2019 12:17
@anntzer anntzer force-pushed the graphviz_dump_transform branch from 172baa1 to d96c985 Compare July 9, 2019 16:13
It was only accessible by modifying the source of transforms.py to set
DEBUG to True (before the module is imported), and anyways broken
because transforms are not hashable in Py3 (so the call to hash()
fails).

Instead move it to a private module.

Example use:
```
from matplotlib._internal_utils import graphviz_dump_transform
graphviz_dump_transform(plt.gca().transAxes, "/tmp/test.png")
```

Also, stop tracking transform node children even in debug mode, as it
was only used when dumping the transform but that's not even necessary
-- one can just inspect `vars(node)` to look for children.
@anntzer anntzer force-pushed the graphviz_dump_transform branch from fd48e30 to 007ee07 Compare March 24, 2020 09:36
@QuLogic QuLogic merged commit 6143565 into matplotlib:master Mar 24, 2020
@anntzer anntzer deleted the graphviz_dump_transform branch March 24, 2020 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants