Conversation
|
I think an issue with this was that different readers would need different parameters, for example KIT raw files need specification for the stim-channel that other formats don’t need…
… On Oct 17, 2017, at 11:07 AM, Clemens Brunner ***@***.***> wrote:
Would it be useful to have a wrapper read_raw function that calls specific readers based on the file extensions?
You can view, comment on, or merge this pull request online at:
#4675 <#4675>
Commit Summary
Add read_raw wrapper function
File Changes
M mne/io/__init__.py <https://github.com/mne-tools/mne-python/pull/4675/files#diff-0> (2)
A mne/io/raw.py <https://github.com/mne-tools/mne-python/pull/4675/files#diff-1> (44)
Patch Links:
https://github.com/mne-tools/mne-python/pull/4675.patch <https://github.com/mne-tools/mne-python/pull/4675.patch>
https://github.com/mne-tools/mne-python/pull/4675.diff <https://github.com/mne-tools/mne-python/pull/4675.diff>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#4675>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAI5a5nThu12X3U-8z8VU_UMHqj0PsHTks5stMLHgaJpZM4P8Tq7>.
|
|
See also discussion in #1930 |
|
I'd argue not to replace the existing @christianbrodbeck |
|
@teonbrooks already implemented something similar in our mne-bids repo. |
| from .eeglab import read_raw_eeglab | ||
|
|
||
|
|
||
| def read_raw(input_fname, **kwargs): |
There was a problem hiding this comment.
then how do you find out what parameters to pass? I find it clearer to be explicit by using the proper dedicated function
|
I think that there may be some value in exploring a generic just my 2c |
The irony! :) |
|
Yes, I agree. If we just pass |
|
I think I agree with @teonbrooks - if the args of the different readers are 95% the same, so that a generic wrapper would have 95% of the docstring for the specific functions, we could probably have a tiny bit of **kwargs at the end. We are, after all, doing this with montages already. |
| elif ext == '.data': | ||
| return read_raw_nicolet(input_fname, **kwargs) | ||
| elif ext == '.set': | ||
| return read_raw_eeglab(input_fname, **kwargs) |
There was a problem hiding this comment.
In principle, I'd use a dict for this.
|
I am still -1
it means testing twice many IO things. But I would be ok to have a private
helper if you need it in your GUI code.
|
|
I agree, this is probably not such a great idea. The GUI will abstract this away anyway, so there's no need for a (private) helper. |
Would it be useful to have a wrapper
read_rawfunction that calls specific readers based on the file extensions?