<commit_before>from spiketag.base import *
from spiketag.view import *
from spiketag.mvc import MainModel, MainView
from spiketag.mvc.Control import controller
import numpy as np
from PyQt5.QtWidgets import QApplication
import sys


tritrode = probe(shank_no=1, grp_No=1)
tritrode[0] = np.array([0,1,2])
tritrode.mapping[0] = np.array([-90,0])
tritrode.mapping[1] = np.array([90,0])
tritrode.mapping[2] = np.array([0,10])
tritrode.fs = 20000.
tritrode.n_ch = 3


# def model_view():
#     model = MainModel('./cell_0109.bin', './cell_0109.spk.bin', tritrode, binary_radix=11)
#     view = MainView(tritrode)
#     view.set_data(0, model.mua, model.spk[0], model.fet[0], model.clu[0])
#     view.show()


def sort():
    ctrl = controller(
                      probe = tritrode,
                      mua_filename='./cell_0109.bin', 
                      spk_filename='./cell_0109.spk.bin', 
                      binary_radix=11, 
                      # cutoff=[-100, 100],
                      # time_segs=[[0,320]],
                      fall_off_size=15
                     )
    ctrl.sort(clu_method='no_clustering')
    ctrl.show()


if __name__ == '__main__':
    app  = QApplication(sys.argv)
    sort()
    sys.exit(app.exec_())
<commit_msg>new usage demo on gt data<commit_after>from spiketag.base import *
from spiketag.view import *
from spiketag.mvc import MainModel, MainView
from spiketag.mvc.Control import controller
import numpy as np
from PyQt5.QtWidgets import QApplication
import sys


tritrode = probe(shank_no=1, grp_No=1)
tritrode[0] = np.array([0,1,2])
tritrode.mapping[0] = np.array([-90,0])
tritrode.mapping[1] = np.array([90,0])
tritrode.mapping[2] = np.array([0,10])
tritrode.fs = 20000.
tritrode.n_ch = 3


# def model_view():
#     model = MainModel('./cell_0109.bin', './cell_0109.spk.bin', tritrode, binary_radix=11)
#     view = MainView(tritrode)
#     view.set_data(0, model.mua, model.spk[0], model.fet[0], model.clu[0])
#     view.show()


def sort():
    ctrl = controller(
                      probe = tritrode,
                      mua_filename='./cell_0109.bin', 
                      spk_filename='./cell_0109.spk.bin', 
                      binary_radix=11, 
                      # cutoff=[-100, 100],
                      # time_segs=[[0,320]],
                      fall_off_size=15
                     )
    ctrl.model.get_spk()
    ctrl.model.get_fet()
    ctrl.model.sort(clu_method='dpgmm', group_id=0, n_comp=8, max_iter=400)
    ctrl.show()


if __name__ == '__main__':
    app  = QApplication(sys.argv)
    sort()
    sys.exit(app.exec_())

{'fraction_non_alphanumeric': 0.14400921658986174, 'fraction_numerical': 0.04877112135176651, 'mean_word_length': 2.4096858638743455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2063093', 'n_tokens_mistral': 1053, 'n_tokens_neox': 958, 'n_words': 164}