WIP add a general read_raw function#1930
WIP add a general read_raw function#1930teonbrooks wants to merge 13 commits intomne-tools:masterfrom
Conversation
ae26fb9 to
b25439b
Compare
|
I like the idea to have a single read_raw function. I'll everybody comment on the DigMontage / Montage thing. |
|
should I split this pr into two? i guess technically they are two separate -teon On Mon, Apr 6, 2015 at 6:04 PM, Alexandre Gramfort <notifications@github.com
|
|
might make things easier yes
|
mne/io/base.py
Outdated
There was a problem hiding this comment.
we will need something like a params argument to pass additional parameters. Depending on the paths of the user this call might not work (config, hs_file).
There was a problem hiding this comment.
does BTi data have an extension? I was guessing at one. I looked through the module and it didn't seem like the test data had one. if not, I guess since it is the only one without an extension, if op.splitext doesn't return anything, we could assume that it is this format.
yeah, I was trying to figure out the best way that case with BTi with those parameters. so for a params arg, you propose something like a dict for the add'l ones?
There was a problem hiding this comment.
@teonlamont they don't have extensions ....
There was a problem hiding this comment.
The pattern you can look for is commas in the file name following a 'c'
|
Isn't a problem for this that different raw types have different file requirements? For example for KIT you'd want arguments for head_shape, ELP and marker files (https://github.com/mne-tools/mne-python/blob/master/mne/io/kit/kit.py#L619). Or is the idea for this to be a quick-and-dirty reader that can't specify those additional parameters? |
|
Or is the idea to supply a universal DigMontage object from your other PR? |
|
I like the idea of a single |
|
@christianbrodbeck the idea would be to have a universal DigMontage. |
|
Isn't a problem for this that different raw types have different file requirements? For example for KIT you'd want arguments for head_shape, ELP and marker files (https://github.com/mne-tools/mne-python/blob/master/mne/io/kit/kit.py#L619). Or is the idea for this to be a quick-and-dirty reader that can't specify those additional parameters?
I am against a quick and dirty. Either we make it work with read_raw
or we stay as it is. Remember
$ python -c "import this" | grep "obvious way"
There should be one-- and preferably only one --obvious way to do it.
|
|
it won't be quick and dirty. if it is to be done, it will be done right :) EEG: MEG: |
|
if that fits all use cases I am happy
|
|
|
all valid points. I use almost only fif files which are self contained so I
don't have the big picture.
|
I agree. I like this too :) i've also been reading a lot of Fodor recently ;)
hehe yeah. one use case is if you have both EEG and MEG and they are not automagically combined like in the neuromag set up, the api for creating the raw objects will now be the same for both data formats.
it is already implemented that the returned raw object will have all the same attributes and methods based on the |
|
Sounds good |
mne/io/base.py
Outdated
There was a problem hiding this comment.
BioSemi systems use the '.bdf' extension, so
elif ext == '.edf' or ext == '.bdf'
f5578f7 to
2116c55
Compare
There was a problem hiding this comment.
For RawFIFF you need to have the allow_maxshield option. Or should we have people use read_raw_fif if they need more options? If that's the case, add a Notes section making it clear that not all options are exposed and users might need to use type-specific readers. Also add See also section with the relevant readers.
|
What else needs to be done here @teonlamont? |
|
If nothing, then we can merge once you 1) add the comment I mention above, 2) update |
|
should the function be |
|
@dengemann check out 7bf1620 for the implementation of a read_params; this is what I initially had. since config is actually str and it is the default, we technically don't need this additional parameter to capture other settings. I think it might be fine how it was. I'm +1 for leaving the function without |
|
@dengemann you can't introspect Better than this: It is forcing another param to act as |
|
and |
|
At least this is a pattern we already support. Kwargs is not. I would really like to avoid kwargs. The other thing is what Alex mentioned: more ways to do the same thing. I'm really not sure what to do with this. Mixed feelings.
|
|
FWIW, we do have kwargs at least one other place, in Now, whether or not we should have |
|
Because I hated it always in matplotlib and elsewhere, it's too intransparent, especially if you cannot look it up in the docs. So if we support it we should at least make all accepted parameters explicit in the doc string... Or just stick with what we have as io functions...
|
There was a problem hiding this comment.
Our pattern is not to use assert statements at all, but to do a proper check and throw an error, should change for consistency. Plus it should probably be ValueError, this will end up being an AssertionError
|
@teonlamont did you take care of #1966 here? If so, please add |
|
@dengemann but what you proposed with |
There was a problem hiding this comment.
don't use nose outside of tests. It makes nosetests a strong dependency of MNE
|
I like the idea but this needs some thinking as it's really core of the library |
|
@agramfort have you done some thinking? :) |
|
I would vote for 0.10 as it's a big change. Let's play with it for a few
weeks before adding this to a release.
|
|
+1 2015-04-22 21:58 GMT+02:00 Alexandre Gramfort notifications@github.com:
|
|
I am closing as I am know thinking we will have to keep the other functions and we want only one way to do things |
|
I am currently working on trying to get FIF integration with scitran data management systems. I'm starting with only FIF support, but in theory mne-python could serve as a backend for all the M/EEG datatypes it supports. This would be facilitated quite a bit by having a single, auto-triaging |
|
The proposal is to have one read_raw function that will read any
supported data format and internally point it to the proper reader module.
It uses the default settings of those readers except for the exposed
parameters.
This will rely on the
mne.define_sensor#1909 (currently referred to asmne.rename_sensorin PR).