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

RDT io broken on latest pandas #188

Closed arrrobase closed 4 years ago

arrrobase commented 4 years ago

On latest version of pandas, mask and dataframe size don't match which is throwing an error. Works on pandas 0.24.2 but not pandas 0.25.3.

Tested with the following:

batch, cellid = 307, "TAR010c-27-2"
modelname = "psth.fs20.pup-ld-st.pup.beh-ref-psthfr.s_sdexp.S_jk.nf20-basic"

fit_model_xform(cellid, batch, modelname)
arrrobase commented 4 years ago

4th bullet point: https://pandas.pydata.org/pandas-docs/stable/whatsnew/v0.25.0.html#indexing

Bug in .iloc and .loc with a boolean indexer not raising an IndexError when too few items are passed (GH26658).

This error was not getting raised previously.

svdavid commented 4 years ago

A couple other points for @bburan : Typo in the relevant model. It's this one:

batch, cellid = 269, 'btn144a-a1'
modelname = 'rdtld-rdtshf-rdtsev.j.4-rdtfmt_rdtgain.gen.NTARGETS-rdtmerge.stim-wc.18x1.g-fir.1x15-lvl.1_init-basic'

and the specific place where the error is being thrown is L147 in nems_lbhb.rdt.io.reformat_epochs

This chunk of code is creating a bunch of epochs called current_target and other_target. As far as I know, I never use these epochs. So I could just delete those lines. The issue seems to be that extract_epochs is not returned as many events as there are occurrences in epochs. Presumably there are invalid events where the signal is nan or something and they're note getting returned.

svdavid commented 4 years ago

Yeah, that's crazy. Glad it's fixed now! Ok @awctomlinson . Looks like that code wasn't doing anything useful anyway. So I deleted it and pushed to nems_db master.