-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
MAINT: dviread refactoring #5177
Conversation
Available in Python 2.6 and up.
so files get closed automatically Available in Python 2.5 and up
This should exercise the most important parts.
Replace the massive if-elif block with a list of functions indexed by opcode. Use a decorator (new in Python 2.4) to register the functions in the dispatch table and to factor out the repeated checks for correct parser state and argument reading.
Hide the dispatch table from sphinx, and improve the docstring for Dvi.
Definite improvement. Nice to have some lower-level unit tests on this stuff, too. Are there any |
I don't think there are usetex tests in lib/matplotlib/tests except for some for the PS backend. |
@jkseppan We build the examples as part of the automatic docs build but there is no verification of output so they only act as smoke tests |
This passes on the current master as well as this branch. For whatever reason, the svg backend has trouble rendering the test case.
Use some more modern Python idioms such as context managers and named tuples. Replace the big if-elif block with a table of function objects, adding a little bit of complexity in the form of a decorator but removing a lot of repeated code along with the elifs. Make the code PEP8 compliant.