-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecated classes and functions in dviread #22127
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
Conversation
dcbb138
to
fa02afd
Compare
I think we can move the whole modules Things to do:
Same for |
fa02afd
to
b151a85
Compare
OK! Great! Much easier that to try to resolve the cyclic import issues, I've been playing around with. :-) |
I am not entirely convinced that dviread should be made private, because it is more or less effectively required to implement usetex in third-party backends (e.g., mplcairo), and API changes have not been particularly onerous on that submodule. But I could change my mind, depending on the arguments... |
OK! I'll hold my horses then. I checked mplcairo and it seems to rely on @lru_cache(1)
def get_tex_font_map():
return dviread.PsfontsMap(dviread.find_tex_file("pdftex.map")) in the public interface? (gr and wxmplot doesn't seem to use neither (I can easily provide a PR for |
be2945f
to
3420852
Compare
I still made the changes while I remembered them. No deprecation yet though and no api-change-info so no one will merge by mistake... (I will also add documentation for Edit: I will also rename |
3420852
to
4674c4f
Compare
Thanks for taking backcompat seriously :) wxmplot is not (AFAIK) a backend in itself, but rather a set of tools built around the wx/wxagg backend. Synchronizing the releases across backends is another issue with this kind of changes, but I think that's reasonably doable; the number of truly independent third-party backends that reimplement the rendering themselves (not just the GUI integration) is probably not that big and we can try to reach all of them. My point was really more the need for required functionality to stay available. |
@anntzer or should one add a second flag, I think I'll go with that for now and can easily change it, if the original suggestion seems better. |
4674c4f
to
1aa6422
Compare
Is the |
1aa6422
to
b7cf163
Compare
Btw, this is now recreated so that |
Am I correct in assuming that the moved private methods does not have to be mentioned not deprecated? |
b7cf163
to
1c6e116
Compare
d345e26
to
01576eb
Compare
01576eb
to
92ac8f6
Compare
I think I would keep dviread as a single file and just add a leading underscore to whatever APIs we want to privatize. Splitting over two files just makes things more confusing. (I know, I did split mathtext into two files for the privatization of most of the API, but perhaps I shouldn't have?) As for texmanager, the TexManager class effectively remains public (via get_texmanager()) so I don't think it makes much sense to make the module private (you can think of it as "how would you document the return type of get_texmanage()"?); I think the more relevant point would be to make some of TexManager's methods private -- we can probably get away with just keeping |
OK! I basically went with #16181, so I do not have any strong opinions myself. I'll leave this as is for now and maybe @timhoffm can provide some feedback as well (and possibly remove I'd be OK with privatizing the parts of (I think splitting can be a good thing, especially if the files are really long, which is maybe not the case here.) |
I'll close this for now, but can start over if there is a consensus about what should be deprecated. |
PR Summary
Related to #16181
Moved all subclasses and helper functions from
dviread.py
to_dviread.py
. I have not yet re-added the moved classes and functions with deprecations as I wanted some feedback to which I should add and if I should moveDvi
as well?Am I right in assuming that only non-private classes and methods should be re-added? For example,
_mul2012
does not have to be deprecated (and can be moved directly)?Also, as the branch name hints, I was planning to do the same for
texmanager.py
. However, there is one class and one function in it. Should I move both? The function only? Link for quick access: https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/texmanager.pyPR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/api/next_api_changes/
(follow instructions in README.rst there).