Skip to content

Commit d921f4a

Browse files
committed
fix quality thing and add curation-file arg
1 parent 99926ee commit d921f4a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

spikeinterface_gui/controller.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ def make_manual_restore_merge(self, merge_group_indices):
773773
return
774774
for merge_index in merge_group_indices:
775775
if self.verbose:
776-
print(f"Unmerged merge group {self.curation_data['merge_unit_groups'][merge_index]['unit_ids']}")
776+
print(f"Unmerged merge group {self.curation_data['merges'][merge_index]['unit_ids']}")
777777
self.curation_data["merges"].pop(merge_index)
778778

779779
def get_curation_label_definitions(self):
@@ -794,9 +794,10 @@ def get_unit_label(self, unit_id, category):
794794
if ix is None:
795795
return
796796
lbl = self.curation_data["manual_labels"][ix]
797-
if category in lbl:
798-
labels = lbl[category]
799-
return labels[0]
797+
if 'labels' in lbl:
798+
if category in lbl['labels']:
799+
labels = lbl['labels'][category]
800+
return labels[0]
800801

801802
def set_label_to_unit(self, unit_id, category, label):
802803
if label is None:

spikeinterface_gui/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ def run_mainwindow_cli():
260260
parser.add_argument('--port', help='Port for web mode', default=0, type=int)
261261
parser.add_argument('--address', help='Address for web mode', default='localhost')
262262
parser.add_argument('--layout-file', help='Path to json file defining layout', default=None)
263+
parser.add_argument('--curation-file', help='Path to json file defining a curation', default=None)
263264

264265
args = parser.parse_args(argv)
265266

@@ -295,6 +296,12 @@ def run_mainwindow_cli():
295296
raise ValueError('The recording does not have the same channel ids as the analyzer')
296297
recording = recording.select_channels(recording.channel_ids[channel_mask])
297298

299+
if args.curation_file is not None:
300+
with open(args.curation_file, "r") as f:
301+
curation_data = json.load(f)
302+
else:
303+
curation_data = None
304+
298305
run_mainwindow(
299306
analyzer,
300307
mode=args.mode,
@@ -303,4 +310,5 @@ def run_mainwindow_cli():
303310
recording=recording,
304311
verbose=args.verbose,
305312
layout=args.layout_file,
313+
curation_dict=curation_data,
306314
)

0 commit comments

Comments
 (0)