Skip to content

Edit Error Message For Channels Marked Dead During Sorting #53

@22AviPatel

Description

@22AviPatel

Error Message:

In [11]: dat.sort_spikes(0)                                                     
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-11-62e03d9064c9> in <module>
----> 1 dat.sort_spikes(0)

~/conda/envs/blechpy/lib/python3.7/site-packages/blechpy/datastructures/dataset.py in sort_spikes(self, electrode, shell)
    928             self.cleanup_clustering()
    929 
--> 930         sorter = clust.SpikeSorter(self.root_dir, electrode=electrode, shell=shell)
    931         if not shell:
    932             root, sorting_GUI = ssg.launch_sorter_GUI(sorter)

~/conda/envs/blechpy/lib/python3.7/site-packages/blechpy/analysis/blech_clustering.py in __init__(self, rec_dirs, electrode, clustering_dir, shell)
   1019         self.clustering_dir = clustering_dir
   1020         try:
-> 1021             clust = BlechClust(rec_dirs, electrode, out_dir = clustering_dir, no_write=True)
   1022         except FileNotFoundError:
   1023             clust = None

~/conda/envs/blechpy/lib/python3.7/site-packages/blechpy/analysis/blech_clustering.py in __init__(self, rec_dirs, electrode, out_dir, params, overwrite, no_write, n_pc, data_transform)
    674                        'rec_key': key_file, 'clustering_results': results_file}
    675         self.params = params
--> 676         self._load_existsing_data()
    677 
    678         if self._rec_key is None and not no_write:

~/conda/envs/blechpy/lib/python3.7/site-packages/blechpy/analysis/blech_clustering.py in _load_existsing_data(self)
    702         if params is None and not file_check['params']:
    703             raise ValueError(('Params file does not exists at %s. Must provide'
--> 704                               ' clustering parameters.') % self._files['params'])
    705         elif params is not None:
    706             self.params['max_clusters'] = params['clustering_params']['Max Number of Clusters']

ValueError: Params file does not exists at /media/senecascott/Samsung_T51/taste_experience_resorts/DS49/DS49_spont_taste_221013_161008/BlechClust/electrode_0/BlechClust_params.json. Must provide clustering parameters.

This error message is not friendly and should be replaced that directs the user to move onto the next channel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions