0

I'm using docstrings with sphinx for documenting a project. It's working generally fine but as you see in the below image, I'm losing a lot of space in the "parameters" section.

Is there a way to remove that "parameters" while keeping it in the class docstring? Or leaving a blank line and indenting each parameter to the left? I've tried several options but they don't seem to have effect on this style

GASearchCV

EDIT: This is what the docstring looks like:

class GASearchCV(ClassifierMixin, RegressorMixin):
    """
    Evolutionary optimization over hyperparameters.

    Long description..
    """

    def __init__(self,
                 estimator):
        """
        Parameters
        ----------
        estimator : estimator object, default=None
        estimator object implementing 'fit'
        The object to use to fit the data.
        """

Thanks!

Rodrigo A
  • 657
  • 7
  • 23
  • 3
    What does your current docstring look like? – 12944qwerty May 30 '21 at 16:43
  • Hi, I added a sample in the original question. Thanks – Rodrigo A May 30 '21 at 17:01
  • The code for the class is not syntactically correct. The docstring is not indented. Please provide the exact code used to create the output shown in the image. – mzjn May 30 '21 at 17:57
  • You are right, thanks, just pasted the exact code, just left 1 parameter because there are more than 10 – Rodrigo A May 30 '21 at 18:03
  • I cannot replicate the exact output shown in the question. I also don't understand what you mean by "losing a lot of space". You are not following the NumPy style conventions. The first line of a parameter description should be just `paramname : type`. See https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#google-vs-numpy – mzjn May 30 '21 at 18:16

0 Answers0