Skip to content

Commit 44d4949

Browse files
committed
fixed conflicts
2 parents 6e8709d + 78c2640 commit 44d4949

6 files changed

Lines changed: 1428 additions & 1200 deletions

File tree

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.9"
6+
python: "3.10"
77

88
mkdocs:
99
configuration: mkdocs.yml

docs/requirements.txt

Lines changed: 172 additions & 178 deletions
Large diffs are not rendered by default.

hypyp/utils.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ def merge(epoch_S1: mne.Epochs, epoch_S2: mne.Epochs) -> mne.Epochs:
184184

185185
merges = []
186186

187+
# Verify both epochs have same filter settings
188+
if (epoch_S1.info['highpass'] != epoch_S2.info['highpass'] or
189+
epoch_S1.info['lowpass'] != epoch_S2.info['lowpass']):
190+
import warnings
191+
warnings.warn("Filter settings differ between participants. Using S1 settings.")
192+
187193
# checking wether data have the same size
188194
assert(len(epoch_S1) == len(epoch_S2)
189195
), "Epochs from S1 and S2 should have the same size!"
@@ -210,10 +216,23 @@ def merge(epoch_S1: mne.Epochs, epoch_S2: mne.Epochs) -> mne.Epochs:
210216

211217
merged = np.array(merges)
212218
ch_names_merged = ch_names1+ch_names2
213-
info = mne.create_info(ch_names_merged, sfreq, ch_types='eeg',
214-
verbose=None)
219+
220+
# Create info object with filter information preserved
221+
info = mne.create_info(ch_names_merged, sfreq, ch_types='eeg', verbose=None)
222+
223+
# Also preserve other relevant metadata
224+
if 'description' in epoch_S1.info:
225+
info['description'] = epoch_S1.info['description']
226+
elif 'description' in epoch_S2.info:
227+
info['description'] = epoch_S2.info['description']
228+
215229
ep_hyper = mne.EpochsArray(merged, info)
216230

231+
# Preserve filter information from source epochs
232+
with ep_hyper.info._unlock():
233+
ep_hyper.info['highpass'] = epoch_S1.info['highpass']
234+
ep_hyper.info['lowpass'] = epoch_S1.info['lowpass']
235+
217236
# setting channels type
218237
EOG_ch = []
219238
for ch in epoch_S1.info['chs']:
@@ -222,14 +241,10 @@ def merge(epoch_S1: mne.Epochs, epoch_S2: mne.Epochs) -> mne.Epochs:
222241

223242
for ch in ep_hyper.info['chs']:
224243
if ch['ch_name'].split('_')[0] in EOG_ch:
225-
# print('emg')
226244
ch['kind'] = FIFF.FIFFV_EOG_CH
227245
else:
228246
ch['kind'] = FIFF.FIFFV_EEG_CH
229247

230-
# info about task
231-
ep_hyper.info['description'] = epoch_S1[0].info['description']
232-
233248
return ep_hyper
234249

235250

mkdocs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ repo_url: https://github.com/ppsp-team/HyPyP/
55
markdown_extensions:
66
- admonition
77
- codehilite
8-
- markdown_include.include
98

109
theme:
1110
name: "material"
@@ -15,8 +14,8 @@ extra_css:
1514

1615
plugins:
1716
- search
17+
- include-markdown
1818
- mkdocstrings:
19-
default_handler: python
2019
handlers:
2120
python:
2221
options:

0 commit comments

Comments
 (0)