Skip to content
Open
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.5
rev: v0.15.2
hooks:
- id: ruff
args: [ --fix ]
Expand All @@ -16,7 +16,7 @@ repos:
types_or: ["python"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.15.0'
rev: 'v1.19.1'
hooks:
- id: mypy
additional_dependencies: ["types-tabulate", "types-requests"]
Expand Down
16 changes: 9 additions & 7 deletions amlb/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,15 @@ def as_list(*args):
def flatten(iterable, flatten_tuple=False, flatten_dict=False):
return reduce(
lambda left, right: (
left.extend(right)
if isinstance(right, (list, tuple) if flatten_tuple else list)
else left.extend(right.items())
if flatten_dict and isinstance(right, dict)
else left.append(right)
)
or left,
(
left.extend(right)
if isinstance(right, (list, tuple) if flatten_tuple else list)
else left.extend(right.items())
if flatten_dict and isinstance(right, dict)
else left.append(right)
)
or left
),
iterable,
[],
)
Expand Down
6 changes: 4 additions & 2 deletions amlb/utils/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ def add_to_archive(file, isdir):
walk_apply(
path,
add_to_archive,
filter_=lambda p: (filter_ is None or filter_(p))
and not os.path.samefile(dest_archive, p),
filter_=lambda p: (
(filter_ is None or filter_(p))
and not os.path.samefile(dest_archive, p)
),
)


Expand Down
6 changes: 4 additions & 2 deletions frameworks/H2OAutoML/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ def save_artifacts(automl, dataset, config):
models_artifacts.append(models_archive)
clean_dir(
models_dir,
filter_=lambda p: p not in models_artifacts
and os.path.splitext(p)[1] in [".json", ".zip", ""],
filter_=lambda p: (
p not in models_artifacts
and os.path.splitext(p)[1] in [".json", ".zip", ""]
),
)

if "model_predictions" in artifacts:
Expand Down
Loading