Skip to content

Commit 8654e2f

Browse files
handle empty ablation (#229)
1 parent 6822d38 commit 8654e2f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

openep/data_structures/ablation.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ def extract_ablation_data(ablation_data):
114114
as well as the force applied.
115115
"""
116116

117-
if isinstance(ablation_data, np.ndarray) or ablation_data['originaldata']['ablparams']['time'].size == 0:
117+
if isinstance(ablation_data, np.ndarray):
118+
return Ablation()
119+
120+
try:
121+
if not ablation_data['originaldata']['ablparams']['time'].size:
122+
return Ablation()
123+
except KeyError as e:
118124
return Ablation()
119125

120126
times = ablation_data['originaldata']['ablparams']['time'].astype(float)

0 commit comments

Comments
 (0)