-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecation warning when building API doc for Polygon subclass #19850
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
Comments
Please see #19839 |
This is a different issue than #19839. |
I think there is nothing we can do about this on the Matplotlib side. With the You could filter out Alternatively, if you are sure that nobody accesses these attributes in your subclass, you can overwrite them
The deprecated properties will be removed in matplotlib 3.6. Once that gets your minimum dependency, you can remove the workaround again. |
Thanks for the response. I did try to not inherit the docstring but to no avail. I'll try your suggestion when you get the chance, though right now RTD isn't complaining, but maybe it will again when the monkeypatch in #19839 is reverted. 🤷 |
This does not directly have to do with docstrings. The warning will occur if you access the property. - Whether your sphinx extension does that or not somewhat depending on the docstring I cannot tell. The monkey-patch should not affect the deprecation warning. I'll leave this closed as I don't think it's actionable from our side. But you are welcome to report back if the issue comes back again. |
That makes sense, I am okay with closing this issue. To wrap things up, unfortunately #19850 (comment) does not work for us. I guess there is no reason for |
@pllim Sorry I'm late to the party, but it may make sense to silence specifically DeprecationWarning's coming specifically from whatever extension module is throwing these errors. For example, for sphinx-autodoc, the following filter works: # make sure to ignore warnings that stem from simply inspecting deprecated
# class-level attributes
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='sphinx.util.inspect') This is basically a perfect storm in terms of Python warning semantics. There really is no reasonable way for sphinx (or any other "autodoc" style code) to parse the docstrings of all attributes of a class without a
I would say to the contrary, if I were you I would just silence the warnings at the |
We started seeing deprecation warning while building doc and unfortunately we have set ReadTheDocs build to fail on warnings. After some investigation, it turned out that this is the perfect storm of the following conditions:
matplotlib.patches.Polygon
.validCap
andvalidJoin
here:matplotlib/lib/matplotlib/patches.py
Lines 42 to 52 in 7f9d84a
I am not sure what is the best fix. I can maybe overwrite the docstring of those two methods in subclasses but it is not elegant. Advise is appreciated. Thanks!
xref astropy/astropy#11458 and astropy/sphinx-automodapi#125
The text was updated successfully, but these errors were encountered: