Skip to content

Commit

Permalink
flake8 + fix plot fig2
Browse files Browse the repository at this point in the history
  • Loading branch information
agramfort committed Nov 5, 2023
1 parent 0cd5988 commit df936c4
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 197 deletions.
4 changes: 2 additions & 2 deletions bsi_zoo/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _compute_eloreta_kernel(L, *, lambda2, n_orient, whitener, loose=1.0, max_it
)
G_R_Gt = _this_normalize_R(G, R, G_3)
# extra = " (this make take a while)" if n_orient == 3 else ""
for kk in range(max_iter):
for _ in range(max_iter):
# 1. Compute inverse of the weights (stabilized) and C
s, u = eigh(G_R_Gt)
s = abs(s)
Expand Down Expand Up @@ -171,7 +171,7 @@ def _compute_eloreta_kernel(L, *, lambda2, n_orient, whitener, loose=1.0, max_it
if delta < eps:
break
else:
warnings.warn("eLORETA weight fitting did not converge (>= %s)" % eps)
warnings.warn("eLORETA weight fitting did not converge (>= %s)" % eps, UserWarning, stacklevel=2)
del G_R_Gt
G /= source_std # undo our biasing
G_3 = _get_G_3(G, n_orient)
Expand Down
3 changes: 1 addition & 2 deletions bsi_zoo/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,12 @@
)
results = benchmark.run(nruns=nruns)
df_results.append(results)
# save results
# save results
data_path = Path("bsi_zoo/data")
data_path.mkdir(exist_ok=True)
FILE_NAME = f"{estimator}_{subject}_{data_args['orientation_type'][0]}_{time.strftime('%b-%d-%Y_%H%M', time.localtime())}.pkl"
results.to_pickle(data_path / FILE_NAME)


df_results = pd.concat(df_results, axis=0)

data_path = Path("bsi_zoo/data")
Expand Down
Loading

0 comments on commit df936c4

Please sign in to comment.