e937b1993a65ea353c5981f9065027a1dfac788a,cirq/vis/heatmap_test.py,,test_annotation_position_and_content,#Any#Any#,106

Before Change


    qubits = ((0, 5), (8, 1), (7, 0), (13, 5), (1, 6), (3, 2), (2, 8))
    values = np.random.random(len(qubits))
    test_value_map = {qubit: value for qubit, value in zip(qubits, values)}
    random_heatmap = heatmap.Heatmap(test_value_map).set_annotation_format(format_string)
    random_heatmap.plot(ax)
    actual_texts = set()
    for artist in ax.get_children():

After Change


@pytest.mark.parametrize("format_string", [".3e", ".2f", ".4g"])
def test_annotation_position_and_content(ax, format_string):
    row_col_list = ((0, 5), (8, 1), (7, 0), (13, 5), (1, 6), (3, 2), (2, 8))
    qubits = [grid_qubit.GridQubit(row, col) for (row, col) in row_col_list]
    values = np.random.random(len(qubits))
    test_value_map = {(qubit,): value for qubit, value in zip(qubits, values)}
    test_row_col_map = {rc: value for rc, value in zip(row_col_list, values)}
    random_heatmap = heatmap.Heatmap(test_value_map, annotation_format=format_string)
    random_heatmap.plot(ax)
    actual_texts = set()
    for artist in ax.get_children():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: quantumlib/Cirq
Commit Name: e937b1993a65ea353c5981f9065027a1dfac788a
Time: 2021-03-02
Author: tanujkhattar@google.com
File Name: cirq/vis/heatmap_test.py
Class Name:
Method Name: test_annotation_position_and_content


Project Name: quantumlib/Cirq
Commit Name: e937b1993a65ea353c5981f9065027a1dfac788a
Time: 2021-03-02
Author: tanujkhattar@google.com
File Name: cirq/vis/heatmap_test.py
Class Name:
Method Name: test_cell_colors


Project Name: quantumlib/Cirq
Commit Name: e937b1993a65ea353c5981f9065027a1dfac788a
Time: 2021-03-02
Author: tanujkhattar@google.com
File Name: cirq/vis/heatmap_test.py
Class Name:
Method Name: test_non_float_values


Project Name: quantumlib/Cirq
Commit Name: e937b1993a65ea353c5981f9065027a1dfac788a
Time: 2021-03-02
Author: tanujkhattar@google.com
File Name: cirq/vis/heatmap_test.py
Class Name:
Method Name: test_annotation_position_and_content