Let’s consider the following example: class MyClass: def __init__(self): self._x = None @property def x(self) -> Union[float, np.ndarray]: if len(self._x) == 1: return self._x else: return self._x @x.setter def x(self, value: Union[float, list, np.ndarray]): self._x = np.atleast_1d(value) Any suggestion on how can I properly document the above code? I am using Sphinx and numpydoc. Thanks ..
There are a lot of questions here on SO asking how to avoid inheriting the docstring of the parent when building docs with sphinx. I have the opposite problem: I want my class-level docstring to be inherited, but that isn’t happening. I built a toy example to show the problem. The two relevant classes are ..
I have Python codes with NumPy docstrings. Manage to use Sphinx for the API documentation, however, classes in the __init__.py file not documented successfully. Example: xxx/__init__.py from __future__ import annotations import sys import re from typing import Iterator, … import pyparsing as p from zzz.base import Base __all__ = [‘Xxx’] class XxxData: """<docstring>""" def __init__(self): ..
I have a project with some functions documented in the napoleon numpy style. In the spirit of numpyness, I have a bunch of function arguments that are of the class array-like. Here is an example: def foo(x, y): """ Foo the arguments together to make a bar. Parameters ———- x : array-like This is an ..