Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
richardkoehler committed Feb 13, 2024
1 parent 73da1ee commit 089ec7e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
Binary file added .pytask.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion src/pte_decode/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pandas as pd
import seaborn as sns
import matplotlib as mpl
from matplotlib import axes, cm, collections, figure, patheffects
from matplotlib import axes, collections, figure, patheffects
from matplotlib import pyplot as plt
import scipy.stats
from statannotations import Annotator
Expand Down
27 changes: 14 additions & 13 deletions src/pte_decode/results.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for loading results from decoding experiments."""
from collections.abc import Sequence
import json
from pathlib import Path

Expand Down Expand Up @@ -292,7 +293,7 @@ def _load_labels_single(


def load_predictions(
files: list[Path | str],
files: Sequence[Path | str],
baseline: tuple[int | float | None, int | float | None] | None = None,
baseline_mode: str = "zscore",
baseline_trialwise: bool = False,
Expand Down Expand Up @@ -343,7 +344,7 @@ def load_predictions_singlefile(
sub, med, stim = pte.filetools.sub_med_stim_from_fname(filename)
with open(file, "r", encoding="utf-8") as in_file:
pred_data = json.load(in_file)

times = np.array(pred_data.pop("times"))
trial_ids = list(set(pred_data.pop("trial_ids")))
data_all = []
Expand Down Expand Up @@ -371,17 +372,17 @@ def load_predictions_singlefile(
preds=predictions, times=times, tmin=tmin, tmax=tmax
)
data_all.append(
(
sub,
med,
stim,
channel,
trial_ids,
times,
predictions,
filename,
),
)
(
sub,
med,
stim,
channel,
trial_ids,
times,
predictions,
filename,
),
)
data_final = pd.DataFrame(
data=data_all,
columns=[
Expand Down

0 comments on commit 089ec7e

Please sign in to comment.