diff --git a/pyproject.toml b/pyproject.toml index 353b276c..b657eb13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -138,13 +138,13 @@ files = ["src", "tests"] [tool.codespell] ignore-words-list = "fpr" -[tool.ruff] +[tool.ruff.lint] ignore = ["N818", "UP006", "UP007", "UP035", "UP038", "B905", "PGH003"] select = ["F", "E", "W", "C90", "N", "UP", "YTT", "S", "BLE", "B", "A", "C4", "T10", "EXE", "ISC", "INP", "PIE", "T20", "PT", "Q", "RSE", "RET", "SLF", "SIM", "TID", "TCH", "INT", "ARG", "PGH", "PL", "TRY", "NPY", "RUF"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "noxfile.py" = ["D", "PTH"] "tests/*" = ["S101", "INP001", "SLF001", "ARG001", "ARG002", "ARG005", "PLR2004", "NPY002"] -[tool.ruff.pylint] +[tool.ruff.lint.pylint] max-args = 10 diff --git a/src/dvclive/optuna.py b/src/dvclive/optuna.py index 77b5d678..9dfce74c 100644 --- a/src/dvclive/optuna.py +++ b/src/dvclive/optuna.py @@ -27,12 +27,14 @@ def _log_metrics(self, values, live): names = [self.metric_name] elif len(self.metric_name) != len(values): - raise ValueError( + msg = ( "Running multi-objective optimization " - f"with {len(values)} objective values, but {len(self.metric_name)} names specified. " + f"with {len(values)} objective values, " + f"but {len(self.metric_name)} names specified. " "Match objective values and names," "or use default broadcasting." ) + raise ValueError(msg) else: names = [*self.metric_name]