Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging a google docstring with a numpy docstring #46

Open
bcm-at-zama opened this issue May 3, 2022 · 0 comments
Open

Merging a google docstring with a numpy docstring #46

bcm-at-zama opened this issue May 3, 2022 · 0 comments

Comments

@bcm-at-zama
Copy link

Hey. Great tool, thanks a lot!

I was wondering if we can merge docstring of different kinds.

"""This is a test."""
import sklearn
import numpy
from typing import Optional
from custom_inherit import doc_inherit


class MyDecisionTreeClassifier(sklearn.tree.DecisionTreeClassifier):
    @doc_inherit(sklearn.tree.DecisionTreeClassifier.predict_proba, style="google_with_merge")
    def predict_proba(
        self,
        X: numpy.ndarray,
        check_input: Optional[bool] = True,
        my_option: Optional[bool] = False,
    ) -> numpy.ndarray:
        """Predict class probabilities of the input samples X.

        Args:
            my_option: If True, this is happening. If False, this other thing is happening and I
                need two lines to explain this option.

        Returns:
            numpy.ndarray: the result

        """
        print(my_option)
        super.predict_proba(X, check_input=check_input)

Here, I'd like to merge scikit docstring (which is numpy) with mine (which is google). It more or less works already:

Capture d’écran 2022-05-03 à 15 02 35

but you can see that there is a bad thing happening because my_option explanation is too long. More precisely, it cuts the line in two, and writes "option. (need two lines to explain this) –" as a fake new option.

I wonder if it can be fixed easily. If not, it is already a great tool thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant