Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed as not planned
Closed as not planned
Milestone
Description
Problem
The sphinx links toCapStyle
andJoinStyle
in v3.4.0 are relative to the file, so a subclass ofmatplotlib.patches.Patch
in a package with numpydoc xref (https://numpydoc.readthedocs.io/en/latest/install.html) turned on cannot link to the objects and errors with.WARNING: py:obj reference target not found: CapStyle
WARNING: py:obj reference target not found: JoinStyle
https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch.set_capstyle
https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch.set_joinstyle
@docstring.interpd def set_capstyle(self, s): """ Set the `.CapStyle`. Parameters ---------- s : `.CapStyle` or %(CapStyle)s """ cs = CapStyle(s) self._capstyle = cs self.stale = True
Edit:
The problem also appears to involvePatches.__init__
. I can monkey-patch a fix with
Polygon.__init__.__doc__ = Polygon.__init__.__doc__.replace( "`.CapStyle`", "``matplotlib._enums.CapStyle``")Polygon.__init__.__doc__ = Polygon.__init__.__doc__.replace( "`.JoinStyle`", "``matplotlib._enums.JoinStyle``")Polygon.set_capstyle.__doc__ = Polygon.set_capstyle.__doc__.replace( "`.CapStyle`", "``matplotlib._enums.CapStyle``")Polygon.set_joinstyle.__doc__ = Polygon.set_joinstyle.__doc__.replace( "`.JoinStyle`", "``matplotlib._enums.JoinStyle``")
Suggested Improvement
- This line could be be changed to say
@docstring.interpd def set_capstyle(self, s): """ Set the `~matplotlib._enums.CapStyle`. Parameters ---------- s : `~matplotlib._enums.CapStyle` or %(CapStyle)s """ cs = CapStyle(s) self._capstyle = cs self.stale = True
Matplotlib version
- Operating system: Big Sur & Ubuntu
- Matplotlib version 3.4.0
- Matplotlib documentation version (is listed under the logo): 3.4.0