ea1bdc71e554847b6b982058547e0b26bbd20faf,nilearn/plotting/tests/test_matrix_plotting.py,,test_matrix_plotting,#,12

Before Change


    plt.close()
    // test if reordering with default linkage works
    ax = plot_matrix(mat, labels=labels, reorder=True)
    plt.close()

After Change


    ax.axes.set_title("Title")
    plt.close()
    import scipy
    if int(scipy.__version__.split(".")[0]) >= 1:
        // test if reordering with default linkage works
        idx = [2, 3, 5]
        from itertools import permutations
        // make symmetric matrix of similarities so we can get a block
        for perm in permutations(idx, 2):
            mat[perm] = 1
        ax = plot_matrix(mat, labels=labels, reorder=True)
        reordered_labels = [int(lbl.get_text())
                            for lbl in ax.axes.get_xticklabels()]
        // block order does not matter
        assert_true(reordered_labels[:3] == idx or reordered_labels[-3:] == idx,
                    "Clustering does not find block structure.")
        plt.close()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: nilearn/nilearn
Commit Name: ea1bdc71e554847b6b982058547e0b26bbd20faf
Time: 2017-12-24
Author: moritz.boos@uni-oldenburg.de
File Name: nilearn/plotting/tests/test_matrix_plotting.py
Class Name:
Method Name: test_matrix_plotting


Project Name: gooofy/zamia-speech
Commit Name: 85861ea5c5320518267405bef050a0dab933e069
Time: 2018-02-17
Author: guenter@zamia.org
File Name: phone_gen.py
Class Name:
Method Name:


Project Name: snorkel-team/snorkel
Commit Name: 8fb0987926a8e86c17ac516106b7a81c97b26505
Time: 2017-01-12
Author: stephenhbach@gmail.com
File Name: snorkel/models/meta.py
Class Name:
Method Name: set_sqlite_pragma


Project Name: matthewwithanm/django-imagekit
Commit Name: 732f7045e43c148891b8777dce675b1f8fff818e
Time: 2017-02-15
Author: rohitsuri@gmail.com
File Name: imagekit/specs/__init__.py
Class Name: ImageSpec
Method Name: generate