Skip to content

Commit

Permalink
Cast explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
not522 committed Nov 14, 2021
1 parent a9f834f commit d9841ab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions optuna/visualization/matplotlib/_contour.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from collections import defaultdict
from typing import Callable
from typing import cast
from typing import DefaultDict
from typing import Dict
from typing import List
Expand Down Expand Up @@ -458,9 +457,9 @@ def _create_zmap(
# so we are going with close approximations of trial value positions
zmap = dict()
for x, y, z in zip(x_values, y_values, z_values):
xindex = np.argmin(np.abs(xi - x))
yindex = np.argmin(np.abs(yi - y))
zmap[(cast(int, xindex), cast(int, yindex))] = z
xindex = int(np.argmin(np.abs(xi - x)))
yindex = int(np.argmin(np.abs(yi - y)))
zmap[(xindex, yindex)] = z

return zmap

Expand Down

0 comments on commit d9841ab

Please sign in to comment.