From 5c3824722295aeb69617d07ba1782b05315316b4 Mon Sep 17 00:00:00 2001 From: HideakiImamura Date: Sat, 30 Sep 2023 10:57:15 +0900 Subject: [PATCH 1/4] use collections.abc --- optuna/visualization/_pareto_front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/optuna/visualization/_pareto_front.py b/optuna/visualization/_pareto_front.py index c7f8a0f809..cfe21d574a 100644 --- a/optuna/visualization/_pareto_front.py +++ b/optuna/visualization/_pareto_front.py @@ -2,9 +2,9 @@ import collections from typing import Any -from typing import Callable +from collections.abc import Callable from typing import NamedTuple -from typing import Sequence +from collections.abc import Sequence import warnings import optuna From 98578c42dfc3fb60959f0bfdf8d208d659ab1b6f Mon Sep 17 00:00:00 2001 From: HideakiImamura Date: Sat, 30 Sep 2023 11:24:43 +0900 Subject: [PATCH 2/4] Apply formatter --- optuna/visualization/_pareto_front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/optuna/visualization/_pareto_front.py b/optuna/visualization/_pareto_front.py index cfe21d574a..9930c41cf1 100644 --- a/optuna/visualization/_pareto_front.py +++ b/optuna/visualization/_pareto_front.py @@ -1,10 +1,10 @@ from __future__ import annotations import collections -from typing import Any from collections.abc import Callable -from typing import NamedTuple from collections.abc import Sequence +from typing import Any +from typing import NamedTuple import warnings import optuna From ca788e7115b42ac3d3835f52c4ee5917baf924e3 Mon Sep 17 00:00:00 2001 From: HideakiImamura Date: Thu, 5 Oct 2023 08:29:35 +0900 Subject: [PATCH 3/4] Apply review comment --- optuna/visualization/_pareto_front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optuna/visualization/_pareto_front.py b/optuna/visualization/_pareto_front.py index 9930c41cf1..256bf41fc4 100644 --- a/optuna/visualization/_pareto_front.py +++ b/optuna/visualization/_pareto_front.py @@ -302,7 +302,7 @@ def _make_trials_with_values( ) -> list[tuple[FrozenTrial, list[float]]]: target_values = [targets(trial) for trial in trials] for v in target_values: - if not isinstance(v, collections.abc.Sequence): + if not isinstance(v, Sequence): raise ValueError( "`targets` should return a sequence of target values." " your `targets` returns {}".format(type(v)) From 17efa3951d423228c994065d07804e05a0276627 Mon Sep 17 00:00:00 2001 From: HideakiImamura Date: Thu, 5 Oct 2023 13:59:18 +0900 Subject: [PATCH 4/4] Fix by linters --- optuna/visualization/_pareto_front.py | 1 - 1 file changed, 1 deletion(-) diff --git a/optuna/visualization/_pareto_front.py b/optuna/visualization/_pareto_front.py index 256bf41fc4..b2fbf5df99 100644 --- a/optuna/visualization/_pareto_front.py +++ b/optuna/visualization/_pareto_front.py @@ -1,6 +1,5 @@ from __future__ import annotations -import collections from collections.abc import Callable from collections.abc import Sequence from typing import Any