Skip to content

Commit

Permalink
Fix code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneCmb committed Jun 22, 2023
1 parent cb2f715 commit bfb4633
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frites/utils/preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ def split_group(x, names=None, axis='roi', new_axis='subjects', average=False):
x_roi, suj_roi = [], []
for n_s, s in zip(names, x):
# skip if roi is absent (ieeg)
if r not in s[axis]: continue
if r not in s[axis]:
continue

# boolean selection
_x = s.isel(**{axis: np.where(s[axis].data == r)[0]})
Expand All @@ -468,7 +469,6 @@ def split_group(x, names=None, axis='roi', new_axis='subjects', average=False):
n_times = 100
times = np.linspace(-.5, 1.5, n_times)


x = []
for i in range(n_suj):
_x = np.random.rand(np.random.randint(1, 10, (1,))[0], n_times)
Expand All @@ -482,7 +482,6 @@ def split_group(x, names=None, axis='roi', new_axis='subjects', average=False):
)
x.append(_x)


x_split, u_roi = split_group(x, axis='space')
x_back, u_suj = split_group(x_split, names=u_roi, axis='subjects',
new_axis='roi')

0 comments on commit bfb4633

Please sign in to comment.