Skip to content

Commit 8edbc79

Browse files
committed
Robust on loading
1 parent 8819f71 commit 8edbc79

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "szcore-evaluation"
3-
version = "0.0.6"
3+
version = "0.0.7"
44
description = "Compare szCORE compliant annotations of EEG datasets of people with epilelpsy."
55
authors = [
66
{ name = "Jonathan Dan", email = "jonathan.dan@epfl.ch" }

src/szcore_evaluation/evaluate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ def evaluate_dataset(
9292
hyp_tsv = Path(hypothesis) / ref_tsv.relative_to(reference)
9393
if hyp_tsv.exists():
9494
hyp = Annotations.loadTsv(hyp_tsv)
95-
hyp = Annotation(hyp.getMask(FS), FS)
95+
try:
96+
hyp = Annotation(hyp.getMask(FS), FS)
97+
except IndexError as e:
98+
print(f"Error in {hyp_tsv}: {e}")
99+
hyp = Annotation(np.zeros_like(ref.mask), ref.fs)
96100
else:
97101
hyp = Annotation(np.zeros_like(ref.mask), ref.fs)
98102

0 commit comments

Comments
 (0)