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

Problem when merging with flake8 #47

Open
bcm-at-zama opened this issue May 3, 2022 · 1 comment
Open

Problem when merging with flake8 #47

bcm-at-zama opened this issue May 3, 2022 · 1 comment

Comments

@bcm-at-zama
Copy link

I don't know if this is more of an issue to do to flake8, but I try.

Still with the .py from #46:

"""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)

When you flake8 it with flake8 src/concrete/ml/sklearn/d.py --config flake8_src.cfg with

[flake8]
max-line-length = 100
per-file-ignores = __init__.py:F401
extend-ignore = E203

I get

src/concrete/ml/sklearn/d.py:18:1: DAR101 Missing parameter(s) in Docstring: - X
src/concrete/ml/sklearn/d.py:18:1: DAR101 Missing parameter(s) in Docstring: - check_input
src/concrete/ml/sklearn/d.py:22:1: DAR202 Excess "Returns" in Docstring: + return

Then, I have to add a # noqa: DAR101 in the docstring, to make flake8 happy. But it is a bit ugly in the html then:

Capture d’écran 2022-05-03 à 15 14 25

@bcm-at-zama
Copy link
Author

So maybe, you could filter out lines in "noqa:"?

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