From 18f879d6ee1c1f83fc01908270ba5ea5664f6ab3 Mon Sep 17 00:00:00 2001
From: PGijsbers
Date: Wed, 28 Aug 2024 21:06:58 +0200
Subject: [PATCH 1/2] Fix broken type hints
---
amlb/results.py | 4 ++--
amlb/utils/config.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/amlb/results.py b/amlb/results.py
index 4ce41a1a9..4cef9498e 100644
--- a/amlb/results.py
+++ b/amlb/results.py
@@ -12,7 +12,7 @@
import os
import re
import statistics
-from typing import Union
+from typing import Union, cast
import numpy as np
from numpy import nan, sort
@@ -297,7 +297,7 @@ def save_predictions(dataset: Dataset, output_file: str,
if isinstance(predictions, S):
predictions = predictions.values
if scipy.sparse.issparse(truth) and truth.shape[1] == 1:
- truth = pd.DataFrame(truth.todense())
+ truth = pd.DataFrame(cast(scipy.sparse.sparray, truth).todense())
if isinstance(truth, DF):
truth = truth.squeeze()
if isinstance(truth, S):
diff --git a/amlb/utils/config.py b/amlb/utils/config.py
index 5bf80412e..56bdcb53a 100644
--- a/amlb/utils/config.py
+++ b/amlb/utils/config.py
@@ -42,7 +42,7 @@ def yaml_load(file, as_namespace=False):
yaml = YAML(typ='safe')
return yaml.load(file)
else:
- def yaml_load(*_, **__):
+ def yaml_load(*_, **__): # type: ignore[misc]
raise ImportError("ruamel.yaml package is required to load `yaml` config files.")
From 132f168c1a1dcc840471f591492256dda53d2bc3 Mon Sep 17 00:00:00 2001
From: PGijsbers
Date: Wed, 28 Aug 2024 21:08:53 +0200
Subject: [PATCH 2/2] Remove sections which define default behavior
This is legacy from when they were first all `false` to
incrementally turn on errors.
---
pyproject.toml | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index a5d4d3d04..ff6479037 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -18,35 +18,6 @@ module=[
]
ignore_missing_imports=true
-[[tool.mypy.overrides]]
-ignore_errors = false
-module = "amlb.utils.*"
-
-
-[[tool.mypy.overrides]]
-ignore_errors = false
-module = "amlb.benchmarks.*"
-
-
-[[tool.mypy.overrides]]
-ignore_errors = false
-module = "amlb.datasets.*"
-
-
-[[tool.mypy.overrides]]
-ignore_errors = false
-module = "amlb.frameworks.*"
-
-
-[[tool.mypy.overrides]]
-ignore_errors = false
-module = "amlb.runners.*"
-
-
-[[tool.mypy.overrides]]
-ignore_errors = false
-module = "amlb.*"
-
[[tool.mypy.overrides]]
module = "amlb.benchmark"
disable_error_code = "union-attr"