Sphinx parent class in another package: how to disable single backtick reference warnings

77 Views Asked by At

I am working on implementing a Python package that inherits from networkx. Networkx seems to use numpydoc, but also wraps certain parts of their docstrings in single backtick characters: `. This normally in rst files denotes italics, but in numpydoc this attempts to create a reference.

So when I have a file like the following where I use autodoc's autosummary directive:

.. currentmodule:: pywhy_graphs.classes.timeseries

.. autosummary:: 
   :toctree: generated/
   
   TimeSeriesGraph
   TimeSeriesDiGraph
   TimeSeriesMixedEdgeGraph 

I get the following errors (I copy-pasted only 3 examples for the sake of space):

/Users/adam2392/Documents/pywhy-graphs/pywhy_graphs/classes/timeseries/timeseries.py:docstring of networkx.classes.graph.Graph.to_undirected:33: WARNING: py:obj reference target not found: G = nx.DiGraph(D)
/Users/adam2392/Documents/pywhy-graphs/pywhy_graphs/classes/timeseries/timeseries.py:docstring of networkx.classes.graph.Graph.update:25: WARNING: py:obj reference target not found: edges is None
/Users/adam2392/Documents/pywhy-graphs/pywhy_graphs/classes/timeseries/timeseries.py:docstring of networkx.classes.graph.Graph.update:25: WARNING: py:obj reference target not found: nodes is None

These come for example from docstrings like: https://github.com/networkx/networkx/blob/83948b6dc61f507adb4cd1a71561eac9ed3b72ec/networkx/classes/graph.py#L1183.

Questions

  1. If I am using numpydoc, why am I getting this error, but networkx does not when building docs with sphinx?
  2. How do I disable, or workaround this error?
  3. I don't understand what is going on. If someone can help elaborate what I should do and why, that would be very helpful in learning Sphinx/numpydoc.
0

There are 0 best solutions below