Skip to content

Commit

Permalink
Merge pull request optuna#4971 from HideakiImamura/code-fix/use-futur…
Browse files Browse the repository at this point in the history
…e-annotations-plot-pareto-front

Use collections.abc in plot pareto front
  • Loading branch information
toshihikoyanase authored Oct 5, 2023
2 parents 760c774 + 17efa39 commit 2b052ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions optuna/visualization/_pareto_front.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from __future__ import annotations

import collections
from collections.abc import Callable
from collections.abc import Sequence
from typing import Any
from typing import Callable
from typing import NamedTuple
from typing import Sequence
import warnings

import optuna
Expand Down Expand Up @@ -302,7 +301,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))
Expand Down

0 comments on commit 2b052ee

Please sign in to comment.