Category : numpydoc

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[0] 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 ..

Read more

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): ..

Read more