Skip to content

Commit c3be139

Browse files
committed
Fix tests 2
1 parent 2dbbb61 commit c3be139

1 file changed

Lines changed: 16 additions & 20 deletions

File tree

src/spikeinterface/curation/tests/test_curation_model.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def test_merge_units():
9191
"format_version": "2",
9292
"unit_ids": [1, 2, 3, 4],
9393
"merges": [
94-
{"merge_unit_group": [1, 2], "merge_new_unit_id": 5},
95-
{"merge_unit_group": [3, 4], "merge_new_unit_id": 6},
94+
{"unit_ids": [1, 2], "new_unit_id": 5},
95+
{"unit_ids": [3, 4], "new_unit_id": 6},
9696
],
9797
}
9898

@@ -122,7 +122,7 @@ def test_merge_units():
122122
invalid_merge_group = {
123123
"format_version": "2",
124124
"unit_ids": [1, 2, 3],
125-
"merges": [{"merge_unit_group": [1], "merge_new_unit_id": 4}],
125+
"merges": [{"unit_ids": [1], "new_unit_id": 4}],
126126
}
127127
with pytest.raises(ValidationError):
128128
CurationModel(**invalid_merge_group)
@@ -132,8 +132,8 @@ def test_merge_units():
132132
"format_version": "2",
133133
"unit_ids": [1, 2, 3],
134134
"merges": [
135-
{"merge_unit_group": [1, 2], "merge_new_unit_id": 4},
136-
{"merge_unit_group": [2, 3], "merge_new_unit_id": 5},
135+
{"unit_ids": [1, 2], "new_unit_id": 4},
136+
{"unit_ids": [2, 3], "new_unit_id": 5},
137137
],
138138
}
139139
with pytest.raises(ValidationError):
@@ -149,9 +149,9 @@ def test_split_units():
149149
"splits": [
150150
{
151151
"unit_id": 1,
152-
"split_mode": "indices",
153-
"split_indices": [[0, 1, 2], [3, 4, 5]],
154-
"split_new_unit_ids": [4, 5],
152+
"mode": "indices",
153+
"indices": [[0, 1, 2], [3, 4, 5]],
154+
"new_unit_ids": [4, 5],
155155
}
156156
],
157157
}
@@ -165,9 +165,7 @@ def test_split_units():
165165
valid_split_labels = {
166166
"format_version": "2",
167167
"unit_ids": [1, 2, 3],
168-
"splits": [
169-
{"unit_id": 1, "split_mode": "labels", "split_labels": [0, 0, 1, 1, 0, 2], "split_new_unit_ids": [4, 5, 6]}
170-
],
168+
"splits": [{"unit_id": 1, "mode": "labels", "labels": [0, 0, 1, 1, 0, 2], "new_unit_ids": [4, 5, 6]}],
171169
}
172170

173171
model = CurationModel(**valid_split_labels)
@@ -193,7 +191,7 @@ def test_split_units():
193191
invalid_unit_id = {
194192
"format_version": "2",
195193
"unit_ids": [1, 2, 3],
196-
"splits": [{"unit_id": 4, "split_mode": "indices", "split_indices": [[0, 1], [2, 3]]}], # Non-existent unit
194+
"splits": [{"unit_id": 4, "mode": "indices", "indices": [[0, 1], [2, 3]]}], # Non-existent unit
197195
}
198196
with pytest.raises(ValidationError):
199197
CurationModel(**invalid_unit_id)
@@ -205,9 +203,9 @@ def test_split_units():
205203
"splits": [
206204
{
207205
"unit_id": 1,
208-
"split_mode": "indices",
209-
"split_indices": [[0, 1], [2, 3]],
210-
"split_new_unit_ids": [4], # Should have 2 new IDs for 2 splits
206+
"mode": "indices",
207+
"indices": [[0, 1], [2, 3]],
208+
"new_unit_ids": [4], # Should have 2 new IDs for 2 splits
211209
}
212210
],
213211
}
@@ -231,7 +229,7 @@ def test_removed_units():
231229
invalid_merge_remove = {
232230
"format_version": "2",
233231
"unit_ids": [1, 2, 3],
234-
"merges": [{"merge_unit_group": [1, 2], "merge_new_unit_id": 4}],
232+
"merges": [{"unit_ids": [1, 2], "new_unit_id": 4}],
235233
"removed": [1], # Unit is both merged and removed
236234
}
237235
with pytest.raises(ValidationError):
@@ -248,10 +246,8 @@ def test_complete_model():
248246
"tags": LabelDefinition(name="tags", label_options=["burst", "slow"], exclusive=False),
249247
},
250248
"manual_labels": [{"unit_id": 1, "labels": {"quality": ["good"], "tags": ["burst"]}}],
251-
"merges": [{"merge_unit_group": [2, 3], "merge_new_unit_id": 6}],
252-
"splits": [
253-
{"unit_id": 4, "split_mode": "indices", "split_indices": [[0, 1], [2, 3]], "split_new_unit_ids": [7, 8]}
254-
],
249+
"merges": [{"unit_ids": [2, 3], "new_unit_id": 6}],
250+
"splits": [{"unit_id": 4, "mode": "indices", "indices": [[0, 1], [2, 3]], "new_unit_ids": [7, 8]}],
255251
"removed": [5],
256252
}
257253

0 commit comments

Comments
 (0)