Skip to content

Commit

Permalink
getting closer
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtfa committed Dec 3, 2024
1 parent 26e67b7 commit b30e43b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
4 changes: 4 additions & 0 deletions almkanal/almkanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def do_ica(
train: bool = True,
train_freq: int = 16,
threshold: float = 0.4,
img_path: None | str = None,
fname: None | str = None,
) -> None:
# this should do an ica
ica_info = ICAInfoDict(
Expand All @@ -92,6 +94,8 @@ def do_ica(
train=train,
train_freq=train_freq,
ica_corr_thresh=threshold,
img_path=img_path,
fname=fname,
)

if self.info.ica is None:
Expand Down
2 changes: 2 additions & 0 deletions almkanal/data_utils/data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class ICAInfoDict(TypedDict):
train: bool
train_freq: int
ica_corr_thresh: float
img_path: None | str
fname: None | str


@define
Expand Down
5 changes: 3 additions & 2 deletions tests/test_epoched.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from almkanal.almkanal import AlmKanal

def test_src(gen_mne_data_epochs): #, ch_picks
data_path = mne.datasets.sample.data_path()
meg_path = data_path / 'MEG' / 'sample'

ak = AlmKanal(epoched=gen_mne_data_epochs)

data_path = mne.datasets.sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
fwd_fname = meg_path / 'sample_audvis-meg-vol-7-fwd.fif'
fwd = mne.read_forward_solution(fwd_fname)
ak.pick_dict['meg'] = 'mag'
Expand Down
36 changes: 25 additions & 11 deletions tests/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,38 @@ def test_ica(gen_mne_data_raw, train, eog, ecg, resample_freq, threshold):
)


def test_double_ica(gen_mne_data_raw):
# def test_double_ica(gen_mne_data_raw):

# ak = AlmKanal(raw=gen_mne_data_raw)
# ak.do_ica(n_components=10,
# train=False,
# eog=True,
# ecg=False,
# resample_freq=100,
# threshold=0.4
# )

# ak.do_ica(n_components=10,
# train=False,
# eog=True,
# ecg=False,
# resample_freq=100,
# threshold=0.4
# )


def test_ica_plot(gen_mne_data_raw):
ak = AlmKanal(raw=gen_mne_data_raw)
ak.do_ica(n_components=10,
ak.do_ica(n_components=40,
train=False,
eog=True,
ecg=False,
ecg=True,
resample_freq=100,
threshold=0.4
threshold=0.4,
fname='test',
img_path='./'
)

ak.do_ica(n_components=10,
train=False,
eog=True,
ecg=False,
resample_freq=100,
threshold=0.4
)


def test_epoching(gen_mne_data_raw):
Expand Down

0 comments on commit b30e43b

Please sign in to comment.