You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@agramfort now that I'm in the middle of my edits it occurs to me how inconsistent it feels to have mne.Evoked, mne.Epochs but not mne.Raw., it really looks stupid next to each other in any example.
Also I think it would be cool to be able to say from mne import Raw, Epochs, Evoked
I think io should really be about converting, low level reading and writing.
My 2 cents.
@agramfort it would be strange to me to have a submodule named mne.io, but not have things like read_evoked, read_source_estimate, etc. not also be under it. That is what I had been assuming would happen -- all our I/O-related functions would be grouped under that module. Sorry I didn't bring it up earlier when you first proposed this...
@agramfort I think we agree on this. We simply should expose the most frequently used callables in mne. To me this would be Raw but not Base classes or conversion classes. It really looks kind of unpractical in an example to import io only to access the Raw constructor while mne.Epochs and mne.Evoked works. Same for pick_types ... cleanup is overdue
@Eric89GXL if we move all the read_* functions in io then we move many
many things there and need to split existing files / classes. Would
you move the source_estimate.py file there and remove the
SourceEstimate class from mne namespace? to me it would be too much.
On Tue, Dec 24, 2013 at 5:55 PM, Denis A. Engemann <[email protected]
wrote:
@agramforthttps://github.com/agramfort I think we agree on this. We
simply should expose the most frequently used callables in mne. To me
this would be Raw but not Base classes or conversion classes. It really
looks kind of unpractical in an example to import io only to access the
Raw constructor while mne.Epochs and mne.Evoked works. Same for pick_types... cleanup is overdue
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1003#issuecomment-31178748
.
I know that I suggested this.
But thinking about it it while editing this I think a data object constructors should have a consistent top-level API. flat is better than nested :-) (don't reply with namespaces are a honking great idea).
On Dec 24, 2013, at 5:59 PM, Alexandre Gramfort [email protected] wrote:
On Tue, Dec 24, 2013 at 5:55 PM, Denis A. Engemann <[email protected]
wrote:
@agramforthttps://github.com/agramfort I think we agree on this. We
simply should expose the most frequently used callables in mne. To me
this would be Raw but not Base classes or conversion classes. It really
looks kind of unpractical in an example to import io only to access the
Raw constructor while mne.Epochs and mne.Evoked works. Same for pick_types... cleanup is overdue
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1003#issuecomment-31178748
.
—
Reply to this email directly or view it on GitHub.
@agramfort that makes sense. Do you think we should not expose Raw as a way of reading raw files, but instead have people use read_raw_fif (e.g., for the FIF case)? @dengemann one disadvantage to having mne.Raw is that it would break this pattern, and make FIF-raw reading "exceptional" in how it's accessed/used.
I think it makes the most sense to deprecate direct instantiation of raw using Raw(...) and instead have people use read_raw_fif, since it's more explicit. And we can do the same thing with Evoked(...) versus read_evoked. This seems the cleanest, most consistent way to do it to me. I'm fine with having these be under mne or mne.io.
i'm fine with functions, but it really should be consistent. no historical excuses ;-)
also I don't see strong reasons to withhold the most commonly used functions from being exposed as top-level functions. usability over taxonomic desires, please.
@agramfort@mluessi a few of the attributes are computed during runtime. We would need to make them abc.abstractproperties to make them serve as interface definitions.
Another question is which things shall already be implemented in RawBase as concrete methods ...
@agramfort why do you suggest to put the RawBase class into fiff/base.py? Maybe I'm misunderstanding something, but isn't the point of this PR to make IO less fiff-centric? I think it would make more sense to have the base class in mne/raw.py and format specific readers in the .py file for the respective file format.
@dengemann are you trying to decide which methods/attributes from Raw should go into BaseRaw? I think almost everything except the things that are fiff-specific (read block, etc). You want as many methods as possible in the base class so all the features are available in all derived classes (which implement few format specific methods for reading and writing).
@agramfort +1 let's create the base class and the derived class for fiff first.
Given that we are now planing to implement readers for FT, do you guys think it is still the best idea to implement a flat hierarchy or would hierarchical be better? I.e., should we use mne.io.read_epochs_fieldtrip etc or put things for each file format in a separate sub-package, i.e., mne.io.fieldtrip.read_epochs. IMO, the later would allow for a cleaner organization and one could use from mne.io.fieldtrip import * for less typing.
@agramfort the problem I see is that using a proper ABC class won't allow for inheritance. All methods expected by the API will be needed to be implemented by the advanced user, if only wrapping super calls to the base class. I'm not sure this is really what we want.
Activity
dengemann commentedon Dec 24, 2013
@agramfort I'll take care of it over the holidays.
dengemann commentedon Dec 24, 2013
I'm on it now
dengemann commentedon Dec 24, 2013
@agramfort now that I'm in the middle of my edits it occurs to me how inconsistent it feels to have mne.Evoked, mne.Epochs but not mne.Raw., it really looks stupid next to each other in any example.
Also I think it would be cool to be able to say
from mne import Raw, Epochs, EvokedI think
ioshould really be about converting, low level reading and writing.My 2 cents.
agramfort commentedon Dec 24, 2013
well the meaning of io is raw io in my mind.
the io module should contain only the BaseRaw and Raw* classes.
larsoner commentedon Dec 24, 2013
@agramfort it would be strange to me to have a submodule named
mne.io, but not have things likeread_evoked,read_source_estimate, etc. not also be under it. That is what I had been assuming would happen -- all our I/O-related functions would be grouped under that module. Sorry I didn't bring it up earlier when you first proposed this...dengemann commentedon Dec 24, 2013
@agramfort I think we agree on this. We simply should expose the most frequently used callables in
mne. To me this would beRawbut not Base classes or conversion classes. It really looks kind of unpractical in an example to importioonly to access theRawconstructor whilemne.Epochsandmne.Evokedworks. Same forpick_types... cleanup is overdueagramfort commentedon Dec 24, 2013
@Eric89GXL if we move all the read_* functions in io then we move many
many things there and need to split existing files / classes. Would
you move the source_estimate.py file there and remove the
SourceEstimate class from mne namespace? to me it would be too much.
agramfort commentedon Dec 24, 2013
I have in mind to type:
mne.io.read_raw_fif
mne.io.read_raw_edf
mne.io.read_raw_kit
and
picks = mne.pick_types(...)
On Tue, Dec 24, 2013 at 5:55 PM, Denis A. Engemann <[email protected]
dengemann commentedon Dec 24, 2013
I know that I suggested this.
But thinking about it it while editing this I think a data object constructors should have a consistent top-level API. flat is better than nested :-) (don't reply with namespaces are a honking great idea).
larsoner commentedon Dec 24, 2013
@agramfort that makes sense. Do you think we should not expose
Rawas a way of reading raw files, but instead have people useread_raw_fif(e.g., for the FIF case)? @dengemann one disadvantage to havingmne.Rawis that it would break this pattern, and make FIF-raw reading "exceptional" in how it's accessed/used.larsoner commentedon Dec 24, 2013
I think it makes the most sense to deprecate direct instantiation of raw using
Raw(...)and instead have people useread_raw_fif, since it's more explicit. And we can do the same thing withEvoked(...)versusread_evoked. This seems the cleanest, most consistent way to do it to me. I'm fine with having these be undermneormne.io.dengemann commentedon Dec 24, 2013
i'm fine with functions, but it really should be consistent. no historical excuses ;-)
also I don't see strong reasons to withhold the most commonly used functions from being exposed as top-level functions. usability over taxonomic desires, please.
dengemann commentedon Dec 24, 2013
I won't continue here before we reach consensus, this PR is too fidgety otherwise. Let's shoot for a post-holiday / xmas hangout if necessary.
larsoner commentedon Dec 24, 2013
The only remaining debate is over whether to put the
read_raw_*functions undermneormne.io, right?dengemann commentedon Dec 24, 2013
and how many of all other read_* functions should follow, e.g. read_ica, etc.
likewise, how much of pick to expose in mne name space.
26 remaining items
dengemann commentedon Jan 27, 2014
@mluessi I was also thinking about about
.to_fieldtripetc methods ...dengemann commentedon Jan 27, 2014
@agramfort @Eric89GXL @mluessi ...
To simplify convergence, could we please vote what to include in the interface definition:
`print '\n - [ ] '.join(dir(raw))``
mluessi commentedon Jan 27, 2014
@dengemann I think for saving, maybe we could have a
formatkwarg in thesavemethods.mluessi commentedon Jan 27, 2014
@dengemann ?? I don't get it..
dengemann commentedon Jan 27, 2014
@mluessi vote for the ABCMeta methods ;-)
dengemann commentedon Jan 27, 2014
@agramfort @mluessi a few of the attributes are computed during runtime. We would need to make them
abc.abstractpropertiesto make them serve as interface definitions.Another question is which things shall already be implemented in RawBase as concrete methods ...
Any thoughts?
mluessi commentedon Jan 27, 2014
@agramfort why do you suggest to put the RawBase class into fiff/base.py? Maybe I'm misunderstanding something, but isn't the point of this PR to make IO less fiff-centric? I think it would make more sense to have the base class in mne/raw.py and format specific readers in the .py file for the respective file format.
@dengemann are you trying to decide which methods/attributes from
Rawshould go intoBaseRaw? I think almost everything except the things that are fiff-specific (read block, etc). You want as many methods as possible in the base class so all the features are available in all derived classes (which implement few format specific methods for reading and writing).agramfort commentedon Jan 27, 2014
whatever method is not specific to fiff files :)
agramfort commentedon Jan 27, 2014
first we create the base class then we refactor the io module to move stuff
from mne/fiff to mne/ ok?
mluessi commentedon Jan 27, 2014
@agramfort +1 let's create the base class and the derived class for fiff first.
Given that we are now planing to implement readers for FT, do you guys think it is still the best idea to implement a flat hierarchy or would hierarchical be better? I.e., should we use
mne.io.read_epochs_fieldtripetc or put things for each file format in a separate sub-package, i.e.,mne.io.fieldtrip.read_epochs. IMO, the later would allow for a cleaner organization and one could usefrom mne.io.fieldtrip import *for less typing.agramfort commentedon Jan 27, 2014
fine with mne.io.fieldtrip
dengemann commentedon Jan 27, 2014
@agramfort the problem I see is that using a proper ABC class won't allow for inheritance. All methods expected by the API will be needed to be implemented by the advanced user, if only wrapping super calls to the base class. I'm not sure this is really what we want.
agramfort commentedon Jan 27, 2014
abstract methods should be only the methods required by subclasses.
the other methods are inherited
agramfort commentedon Jun 11, 2014
duplicate