question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

raw.add_channels 'buffer_size_sec' error

See original GitHub issue

I’m trying to add a stim channel (a clean combination of multiple already existing stim channels) to a raw object:

# read raw
raw = read_raw_edf(fname, preload=True)

# clean stim
raw_stim = raw.pick_channels(chs_stim, copy=True)
data = clean_stim(raw_stim._data)

# append data
info = create_info(ch_names=['stim_clean'], sfreq=raw.info['sfreq'], ch_types=['stim'])
raw_stim = RawArray(data, info=info, first_samp=raw._first_samps[0])
raw.add_channels([raw_stim])

But I get the following error:

RuntimeError: Don't know how to merge 'buffer_size_sec'. Make sure values are compatible.

What shall I do?

cc @choldgraf @Eric89GXL

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:28 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
kingjrcommented, Feb 25, 2016

It works with

        info['buffer_size_sec'] = raw.info['buffer_size_sec']
        info['filename'] = raw.info['filename']

I’m keeping the issue opened. I think we should have a less hacky way. WDYT?

I would expect to be able to do Raw.add_channels(data=np.array, ch_type=['stim', 'misc'], ch_names=['foo', 'bar'])

0reactions
larsonercommented, May 1, 2016

Would this work?

  1. The force option takes any conflicting keys and uses the value from the first dictionary (easy to explain, hopefully easy to implement). Call _check_consistency at the end, and beef up that function of necessary to hopefully catch any traps.
Read more comments on GitHub >

github_iconTop Results From Across the Web

mne.io.Raw — MNE 1.2.2 documentation - MNE-Python
Can be 'raise' (default) to raise an error, 'warn' to emit a warning, or 'ignore' to ignore when split file is missing. New...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found