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

[pre-commit.ci] pre-commit suggestions #338

Merged
merged 4 commits into from
Jan 12, 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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
args: [--in-place, --wrap-summaries=120, --wrap-descriptions=120]

- repo: https://github.com/psf/black
rev: 23.11.0
rev: 23.12.1
hooks:
- id: black
name: Black code
Expand All @@ -64,7 +64,7 @@ repos:
- id: yesqa

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.1.11
hooks:
- id: ruff
args: ["--fix"]
Expand Down
13 changes: 7 additions & 6 deletions src/pytorch_tabular/tabular_model_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ def _validate_args(
assert all(
isinstance(m, (str, ModelConfig)) for m in model_list
), f"models must be a list of strings or ModelConfigs, but got {model_list}"
assert all(
task == m.task for m in model_list if isinstance(m, ModelConfig)
), f"task must be the same as the task in ModelConfig, but got {task} and {[m.task for m in model_list if isinstance(m, ModelConfig)]}"
assert all(task == m.task for m in model_list if isinstance(m, ModelConfig)), (
"task must be the same as the task in ModelConfig,"
f" but got {task} and {[m.task for m in model_list if isinstance(m, ModelConfig)]}"
)
if metrics is not None:
assert isinstance(metrics, list), f"metrics must be a list of strings or callables, but got {type(metrics)}"
assert all(
Expand Down Expand Up @@ -154,9 +155,9 @@ def model_sweep(

trainer_config (Union[TrainerConfig, str]): TrainerConfig object or path to the yaml file.

model_list (Union[str, List[Union[ModelConfig, str]]], optional): The list of models to compare. This can be one of
the presets defined in ``pytorch_tabular.tabular_model_sweep.MODEL_SWEEP_PRESETS`` or a list of ``ModelConfig`` objects.
Defaults to "lite".
model_list (Union[str, List[Union[ModelConfig, str]]], optional): The list of models to compare.
This can be one of the presets defined in ``pytorch_tabular.tabular_model_sweep.MODEL_SWEEP_PRESETS``
or a list of ``ModelConfig`` objects. Defaults to "lite".

metrics (Optional[List[str]]): the list of metrics you need to track during training. The metrics
should be one of the functional metrics implemented in ``torchmetrics``. By default, it is
Expand Down
Loading