Procházet zdrojové kódy

gin commit from nit-ope-de04

Modified files: 1
sprenger před 3 roky
rodič
revize
eb1875e716
1 změnil soubory, kde provedl 7 přidání a 4 odebrání
  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)