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

Typehint #632

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions amlb/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion amlb/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")


Expand Down
29 changes: 0 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading