diff --git a/ethicml/preprocessing/adjust_labels.py b/ethicml/preprocessing/adjust_labels.py index de501c14..5b000c29 100644 --- a/ethicml/preprocessing/adjust_labels.py +++ b/ethicml/preprocessing/adjust_labels.py @@ -18,9 +18,8 @@ def assert_binary_labels(data_tuple: DataTuple) -> None: class LabelBinarizer: """If a dataset has labels [-1,1], then this will make it so the labels = [0,1].""" - def __init__(self) -> None: - self.min_val: int - self.max_val: int + min_val: int + max_val: int def adjust(self, dataset: DataTuple) -> DataTuple: """Take a datatuple and make the labels [0,1].""" diff --git a/pyproject.toml b/pyproject.toml index cd0dc4d6..5e002c3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -170,3 +170,17 @@ convention = "pep257" add_ignore = ["D105", "D107", "D401"] ignore_decorators = "implements|overload" match = "(?!(test_|__init__)).*\\.py" + +[tool.pyright] +typeCheckingMode = "strict" +pythonVersion = "3.8" +reportMissingTypeArgument = "none" +reportCallInDefaultInitializer = "warning" +reportPropertyTypeMismatch = "warning" +reportUninitializedInstanceVariable = "warning" +reportUnusedCallResult = "warning" +# these errors are a bit annoying +reportUnknownMemberType = "none" +reportUnknownVariableType = "none" +reportUnknownParameterType = "none" +reportUnknownArgumentType = "none" diff --git a/pyrightconfig.json b/pyrightconfig.json deleted file mode 100644 index 96c8da94..00000000 --- a/pyrightconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "pythonVersion": "3.8", - "reportMissingTypeStubs": "none", - "reportUnknownParameterType": "none", - "reportUnknownArgumentType": "none", - "reportUnknownLambdaType": "none", - "reportUnknownVariableType": "none", - "reportUnknownMemberType": "none", - "reportMissingTypeArgument": "none" -}