Browse Source

Built work-around in consecutive trial ID test to ignore a non-standard trial in Lilou data

Michael Denker 11 months ago
parent
commit
8c1732aeb2
1 changed files with 9 additions and 1 deletions
  1. 9 1
      code/reachgraspio/test_reachgraspio.py

+ 9 - 1
code/reachgraspio/test_reachgraspio.py

@@ -1,5 +1,5 @@
 import sys
-from os.path import join, realpath, dirname
+from os.path import join, realpath, dirname, split
 
 sys.path.insert(0, realpath(join(dirname(__file__), '..')))
 import numpy as np
@@ -74,6 +74,14 @@ class RGIOTestCase(unittest.TestCase):
                         # exclude invalid trial_ids:
                         trial_ids = ev.array_annotations['trial_id']
                         valid_ids = trial_ids[trial_ids != -1]
+
+                        # Lilou session has one trial (197), where the object
+                        # release happens late and during the next trial, thus
+                        # disrupting incremental trial IDs
+                        if split(
+                                block.file_origin)[1]=='l101210-001':
+                            valid_ids = valid_ids[valid_ids != 197]
+
                         self.assertTrue(all(np.diff(valid_ids) >= 0))
 
     def test_data_annotations_present(self):