@@ -41,15 +41,6 @@ def isequaln(a, b):
41
41
return bool (np .all (b == a ))
42
42
except :
43
43
pass
44
- # Handle nested structures
45
- if isinstance (a , dict ) and isinstance (b , dict ):
46
- if set (a .keys ()) != set (b .keys ()):
47
- return False
48
- return all (isequaln (a [k ], b [k ]) for k in a .keys ())
49
- elif isinstance (a , list ) and isinstance (b , list ):
50
- if len (a ) != len (b ):
51
- return False
52
- return all (isequaln (a [i ], b [i ]) for i in range (len (a )))
53
44
# Final comparison - ensure we return a boolean
54
45
try :
55
46
result = a == b
@@ -60,7 +51,7 @@ def isequaln(a, b):
60
51
return False
61
52
62
53
"""Compare two EEG-like structures, reporting differences to stderr."""
63
- print ('Field analysis:' )
54
+ print ('\n Field analysis: (no entries means OK) ' )
64
55
# Handle both dictionary-like objects and objects with __dict__
65
56
if hasattr (eeg1 , 'keys' ):
66
57
# Dictionary-like object
@@ -87,13 +78,13 @@ def isequaln(a, b):
87
78
print (f' Field { field } differs (ok, supposed to differ)' )
88
79
elif any (sub in name for sub in ('subject' , 'session' , 'run' , 'task' )):
89
80
print (f' Field { field } differs ("{ v1 } " vs "{ v2 } ")' , file = sys .stderr )
90
- elif any (sub in name for sub in ('eventdescription' , 'event' )):
81
+ elif any (sub in name for sub in ('chanlocs' , 'event' , 'reject' )):
82
+ pass
83
+ # For complex nested structures, provide more detailed info
84
+ elif any (sub in name for sub in ('eventdescription' )):
91
85
n1 = len (v1 ) if isinstance (v1 , Sequence ) else 1
92
86
n2 = len (v2 ) if isinstance (v2 , Sequence ) else 1
93
87
print (f' Field { field } differs (n={ n1 } vs n={ n2 } )' , file = sys .stderr )
94
- elif any (sub in name for sub in ('chanlocs' , 'reject' )):
95
- # For complex nested structures, provide more detailed info
96
- print (f' Field { field } differs (complex structure - see detailed analysis below)' )
97
88
else :
98
89
print (f' Field { field } differs' , file = sys .stderr )
99
90
# compare xmin/xmax
0 commit comments