From e7a57daf1ed5edb6dfe903a9663b05aa125234cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Wed, 13 Mar 2024 14:40:33 +0545 Subject: [PATCH] fix ruff lint errors --- pyproject.toml | 6 +++--- src/dvclive/optuna.py | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) 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]