Quellcode durchsuchen

gin commit from nit-ope-de04

Modified files: 1
sprenger vor 3 Jahren
Ursprung
Commit
eb1875e716
1 geänderte Dateien mit 7 neuen und 4 gelöschten Zeilen
  1. 7 4
      code/reachgraspio/reachgraspio.py

+ 7 - 4
code/reachgraspio/reachgraspio.py

@@ -48,6 +48,7 @@ import re
 import warnings
 
 import numpy as np
+import odml
 import odml.tools
 import quantities as pq
 
@@ -1666,11 +1667,13 @@ class ReachGraspIO(BlackrockIO):
 
         # load data of all events and epochs
         for ev_idx, event in enumerate(seg.events):
-            seg.events[ev_idx] = event.load()
-            seg.events[ev_idx].segment = seg
+            if hasattr(event, 'load'):
+                seg.events[ev_idx] = event.load()
+                seg.events[ev_idx].segment = seg
         for ep_idx, epoch in enumerate(seg.epochs):
-            seg.epochs[ep_idx] = epoch.load()
-            seg.epochs[ep_idx].segment = seg
+            if hasattr(epoch, 'load'):
+                seg.epochs[ep_idx] = epoch.load()
+                seg.epochs[ep_idx].segment = seg
 
         for asig in seg.analogsignals:
             self.__annotate_analogsignals_with_odml(asig)