def test_cluster_view_extra_columns(qtbot, gui, data): for cl in data: cl['my_metrics'] = cl['id'] * 1000 cv = ClusterView(gui, data=data, columns=['id', 'n_spikes', 'my_metrics']) _wait_until_table_ready(qtbot, cv)
def test_similarity_view_1(qtbot, gui, data): sv = SimilarityView(gui, data=data) _wait_until_table_ready(qtbot, sv) @connect(sender=sv) def on_request_similar_clusters(sender, cluster_id): return [{'id': id} for id in (100 + cluster_id, 110 + cluster_id, 102 + cluster_id)] sv.reset([5]) _assert(sv.get_ids, [105, 115, 107])
def test_cluster_view_1(qtbot, gui, data): cv = ClusterView(gui, data=data) _wait_until_table_ready(qtbot, cv) cv.sort_by('n_spikes', 'asc') cv.select([1]) qtbot.wait(10) assert cv.state == {'current_sort': ('n_spikes', 'asc'), 'selected': [1]} cv.set_state({'current_sort': ('id', 'desc'), 'selected': [2]}) assert cv.state == {'current_sort': ('id', 'desc'), 'selected': [2]}