We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86f17eb commit 999fd94Copy full SHA for 999fd94
cirq-core/cirq/vis/heatmap_test.py
@@ -105,10 +105,8 @@ def test_cell_colors(ax, colormap_name):
105
col = int(round(np.mean([v[0] for v in vertices])))
106
value = test_row_col_map[(row, col)]
107
color_scale = (value - vmin) / (vmax - vmin)
108
- if color_scale < 0.0:
109
- color_scale = 0.0
110
- if color_scale > 1.0:
111
- color_scale = 1.0
+ color_scale = max(color_scale, 0.0)
+ color_scale = min(color_scale, 1.0)
112
expected_color = np.array(colormap(color_scale))
113
assert np.all(np.isclose(facecolor, expected_color))
114
0 commit comments