abuzarmahmood / blech_clust

GNU General Public License v3.0
7 stars 4 forks source link

`blech_clust/utils/blech_process_utils.py` `check_classifier_data_exists` exits if classifier data is not found, #167

Open abuzarmahmood opened 1 month ago

abuzarmahmood commented 1 month ago

That seems to be an unresolved issue in blech_clust/utils/blech_process_utils.py check_classifier_data_exists exits if classifier data is not found, and the function is run when initializing cluster_handler. This should not be happening. You can remove the call to check_classifier_data_exists in the initialization and that should work

class cluster_handler():
    """
    Class to handle clustering steps
    """

    def __init__(self, params_dict,
                 data_dir, electrode_num, cluster_num,
                 spike_set, fit_type = 'manual'):
        assert fit_type in ['manual', 'auto'], 'fit_type must be manual or auto'
        self.check_classifier_data_exists(data_dir)
    def check_classifier_data_exists(self, data_dir):
        clf_list = glob(os.path.join(
            data_dir,
            'spike_waveforms/electrode*/clf_prob.npy'))

        if len(clf_list) == 0:
            print()
            print('======================================')
            print('Classifier output not found, please run blech_run_process.sh with classifier.')
            print('======================================')
            print()
            exit()

_Originally posted by @abuzarmahmood in https://github.com/abuzarmahmood/blech_clust/issues/164#issuecomment-2148052935_