LBHB / NEMS0

THIS VERSION OF NEMS IS NO LONGER SUPPORTED. PLEASE USE THE NEW NEMS REPOSITORY OR INSTALL NEMS_DB TO GET NEMS0 SUPPORT.
GNU General Public License v3.0
8 stars 4 forks source link

clean up `nems.epochs` #105

Open bburan opened 6 years ago

bburan commented 6 years ago

nems.epochs has a mix of functions that work on an epochs dataframe and others that work only on a Nx2 array of start/end times. It gets confusing for new users. These need to be clearly differentiated. Consider moving the Nx2 functions into a submodule, nems.epochs.util.

svdavid commented 6 years ago

I also find it confusing that about half the epoch manipulations are built into the signal and/or reference objects. Does it make sense to move everything to signals? Or perhaps to move some low-level code out of the signal object either to the epochs or utils library?

Generally, there seem to be cases where access to the full epochs dataframe is help (eg, when looking for name matches) but others where only Nx2 arrays are needed. I don't know the best way to segregate that functionality.

bburan commented 6 years ago

Yes, I agree that we should move as much of the epoch manipulation code out of the Recording/Signal objects as possible. Signal and Recording methods can simply be thin wrappers around the epochs module. This also simplifies unit testing (i.e., we don't need to create a Signal/Recording just to test basic epoch manipulation stuff).

I think we should just split the functions that take Nx2 into one file and functions that take the dataframe into another file. Just not sure what to call the file that would take dataframe manipulation routines.

svdavid commented 6 years ago

The dataframe manipulations seem like real "epoch" functions, since they'll be very specific to the epoch data structure. So maybe we should preserve those in nems.epochs? Then the more general Nx2 functions can be cast as more general set manipulations... Though they also are kind of specialized. Do you use any of these functions regularly? Or call them through signal/recording methods?

On Tue, Jun 5, 2018 at 11:07 AM, Brad Buran notifications@github.com wrote:

Yes, I agree that we should move as much of the epoch manipulation code out of the Recording/Signal objects as possible. Signal and Recording methods can simply be thin wrappers around the epochs module. This also simplifies unit testing (i.e., we don't need to create a Signal/Recording just to test basic epoch manipulation stuff).

I think we should just split the functions that take Nx2 into one file and functions that take the dataframe into another file. Just not sure what to call the file that would take dataframe manipulation routines.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LBHB/NEMS/issues/105#issuecomment-394806321, or mute the thread https://github.com/notifications/unsubscribe-auth/AH_8p_x8RIpVQjiZ5aEh-h5gQww10jWbks5t5sjSgaJpZM4UbN7d .

bburan commented 6 years ago

The NX2 functions are used in the higher level functions in NEMS (including the dataframe manipulation routines). I use them quite a bit in my own preprocessing. I think it's safe to move them to nems.epoch.util. The dataframe manipulations can live in nems.epoch.api.

Or, we can reorganize all of our data structures:

nems.data.signal nems.data.recording nems.data.io <- for loading/saving signals & recordings nems.data.epoch nems.data.util <- for the Nx2 manipulations, etc.

nems.data.api <- single point of import for accessing functions most people will want.


From: Stephen D [notifications@github.com] Sent: Tuesday, June 05, 2018 2:35 PM To: LBHB/NEMS Cc: Brad Buran; Author Subject: Re: [LBHB/NEMS] clean up nems.epochs (#105)

The dataframe manipulations seem like real "epoch" functions, since they'll be very specific to the epoch data structure. So maybe we should preserve those in nems.epochs? Then the more general Nx2 functions can be cast as more general set manipulations... Though they also are kind of specialized. Do you use any of these functions regularly? Or call them through signal/recording methods?

On Tue, Jun 5, 2018 at 11:07 AM, Brad Buran notifications@github.com wrote:

Yes, I agree that we should move as much of the epoch manipulation code out of the Recording/Signal objects as possible. Signal and Recording methods can simply be thin wrappers around the epochs module. This also simplifies unit testing (i.e., we don't need to create a Signal/Recording just to test basic epoch manipulation stuff).

I think we should just split the functions that take Nx2 into one file and functions that take the dataframe into another file. Just not sure what to call the file that would take dataframe manipulation routines.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LBHB/NEMS/issues/105#issuecomment-394806321, or mute the thread https://github.com/notifications/unsubscribe-auth/AH_8p_x8RIpVQjiZ5aEh-h5gQww10jWbks5t5sjSgaJpZM4UbN7d .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/LBHB/NEMS/issues/105#issuecomment-394868361, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAT5QpxZnoMDjJGPlTHtvn205-OBEIdkks5t5vm8gaJpZM4UbN7d.