Problem
Our standard way to handle missing references is our missing_references extension, which specifies explicit error messages including line numbers inside missing_references.json.
This is cumbersome because docstring edits can change the line numbers, requiring to adapt the missing_references.json.
Suggested improvement
I just found out, that one can suppress references by prefixing with an exclamation mark. This seems undocumented but is used inside the sphinx docs, e.g. :class:`!MyClass` . I've opened an issue on that: sphinx-doc/sphinx#12940.
If this is intended as a public feature on the sphinx side, I propose to switch to it and dump our missing references. This has several advantages:
- The missing info is inlined, so that we can see in the sources whether the link will works or not.
- We don't have problems with line number changes anymore.
- When references vanish, e.g. by removal after deprecation, we don't have to change old references, e.g. in changelog to a literal role, but can simply prefix them with the exclamation mark.
- It's still straight forward to get an overview of missing references by searching for
`!
Sprint task
For the following references, add a ! in front, e.g. :class:`MyClass` -> :class:`!MyClass`
When the reference is inside a method docstring, the method is listed in parenthesis, e.g. :class:`MyClass` (method)
To avoid merge conflicts, please choose 1 file to work on at a time and note it here
doc/tutorials/
doc/users/
#29086
doc/api/
lib/matplotlib/
lib/mpl_toolkits/
Problem
Our standard way to handle missing references is our
missing_referencesextension, which specifies explicit error messages including line numbers insidemissing_references.json.This is cumbersome because docstring edits can change the line numbers, requiring to adapt the
missing_references.json.Suggested improvement
I just found out, that one can suppress references by prefixing with an exclamation mark. This seems undocumented but is used inside the sphinx docs, e.g.
:class:`!MyClass`. I've opened an issue on that: sphinx-doc/sphinx#12940.If this is intended as a public feature on the sphinx side, I propose to switch to it and dump our missing references. This has several advantages:
`!Sprint task
For the following references, add a ! in front, e.g.
:class:`MyClass`->:class:`!MyClass`When the reference is inside a method docstring, the method is listed in parenthesis, e.g.
:class:`MyClass`(method)To avoid merge conflicts, please choose 1 file to work on at a time and note it here
doc/tutorials/
galleries/tutorials/artists.pyfile in response to issue #28920 #29080matplotlib.axes.Axes.patchmatplotlib.figure.Figure.patchmatplotlib.backend_bases.FigureCanvasmatplotlib.backend_bases.Renderermatplotlib.figure.Figure.transFigurematplotlib.axes.Axes.patchesmatplotlib.axes.Axes.xaxismatplotlib.axes.Axes.yaxisdoc/users/
#29086
Rectangle.containsLine2D.pickipykernel.pylab.backend_inlineArtist.stale_callbackFigure.stale_callbackIPython.terminal.interactiveshell.TerminalInteractiveShell.inputhookdoc/api/
mpl_toolkits.axisartist.Axesmpl_toolkits.mplot3d.axis3d._axinfolib/matplotlib/
matplotlib.collections._CollectionWithSizes.set_sizes(matplotlib.axes._axes.Axes.barbs)ax.transAxes(matplotlib.axes._axes.Axes.inset_axes)matplotlib.collections._MeshData.set_array(matplotlib.axes._axes.Axes.pcolormesh)kde.factor(matplotlib.axes._axes.Axes.violinplot)fmt_xdata(matplotlib.axes._base._AxesBase.format_xdata)fmt_ydata(matplotlib.axes._base._AxesBase.format_ydata)Timer(matplotlib.backend_bases.FigureCanvasBase.new_timer)_iter_collection_raw_paths(matplotlib.backend_bases.RendererBase.draw_path_collection)_iter_collection(matplotlib.backend_bases.RendererBase.draw_path_collection)matplotlib.backend_bases._Backend(matplotlib.backend_bases.ShowBase)ToolContainer(matplotlib.backend_bases.ToolContainerBase.remove_toolitem)toggled(matplotlib.backend_tools.AxisScaleBase.disable)draw_image(matplotlib.backends.backend_agg.RendererAgg.option_scale_image)option_scale_image(matplotlib.backends.backend_cairo.RendererCairo.draw_image)matplotlib.backends._backend_pdf_ps.RendererPDFPSBase(matplotlib.backends.backend_pdf.RendererPdf)matplotlib.backends._backend_tk.FigureCanvasTk(matplotlib.backends.backend_tkagg.FigureCanvasTkAgg)lines(matplotlib.colorbar.Colorbar.add_lines)_read(matplotlib.dviread.Vf)can_composite(matplotlib.image.composite_images)make_image(matplotlib.image.composite_images)kde.covariance_factor(matplotlib.mlab.GaussianKDE)matplotlib.patches._Style(matplotlib.patches.ArrowStyle)matplotlib.patches.ArrowStyle._Curve(matplotlib.patches.ArrowStyle.BarAB)matplotlib.patches.ArrowStyle._Base(matplotlib.patches.ArrowStyle.Fancy)matplotlib.patches.ConnectionStyle._Base(matplotlib.patches.ConnectionStyle.Angle3)AbstractPathEffect._update_gc(matplotlib.patheffects.SimpleLineShadow)matplotlib.projections.geo._GeoTransform(matplotlib.projections.geo.AitoffAxes.AitoffTransform)input_dims(matplotlib.projections.geo.AitoffAxes.AitoffTransform.transform_non_affine)output_dims(matplotlib.projections.geo.AitoffAxes.AitoffTransform.transform_non_affine)Image(matplotlib.pyplot.gci)_find_tails(matplotlib.quiver.Barbs)_make_barbs(matplotlib.quiver.Barbs)name(matplotlib.scale.ScaleBase)converter(matplotlib.testing.compare.compare_images)height(matplotlib.transforms.Bbox.bounds)width(matplotlib.transforms.Bbox.bounds)min(matplotlib.transforms.Bbox.p0)max(matplotlib.transforms.Bbox.p1)xmin(matplotlib.transforms.Bbox.x0)xmax(matplotlib.transforms.Bbox.x1)ymin(matplotlib.transforms.Bbox.y0)ymax(matplotlib.transforms.Bbox.y1)matplotlib.transforms._BlendedMixin(matplotlib.transforms.BlendedAffine2D)triangulation(matplotlib.tri._trirefine.UniformTriRefiner.refine_triangulation)active(matplotlib.widgets.AxesWidget)eventson(matplotlib.widgets.CheckButtons.set_active)matplotlib.widgets._SelectorWidget(matplotlib.widgets.LassoSelector)lib/mpl_toolkits/
matplotlib.axes.Axes.transData(mpl_toolkits.axes_grid1.anchored_artists.AnchoredAuxTransformBox)matplotlib.axes.Axes.transAxes(mpl_toolkits.axes_grid1.anchored_artists.AnchoredDirectionArrows)cbar_axes(mpl_toolkits.axes_grid1.axes_grid.ImageGrid)Size.from_any(mpl_toolkits.axes_grid1.axes_grid.ImageGrid)get_size(mpl_toolkits.axes_grid1.axes_size)mpl_toolkits.axes_grid1.axes_size._Base(mpl_toolkits.axes_grid1.axes_size.Add)mpl_toolkits.axislines.Axes(mpl_toolkits.axisartist.axis_artist)mpl_toolkits.axisartist.axisline_style.AxislineStyle._Base(mpl_toolkits.axisartist.axisline_style.AxislineStyle.SimpleArrow)fmt_zdata(mpl_toolkits.mplot3d.axes3d.Axes3D.format_zdata)