Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work for "inconsistent runs" (using ds001971) #41

Closed
wants to merge 8 commits into from

Conversation

jasmainak
Copy link
Member

@jasmainak jasmainak commented Aug 7, 2019

To do

@jasmainak
Copy link
Member Author

This PR should be merged after #40

@jasmainak
Copy link
Member Author

I get:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/Desktop/projects/github_repos/mne-study-template/05a-run_ica.py in <module>()
    171     parallel, run_func, _ = parallel_func(run_ica, n_jobs=config.N_JOBS)
    172     parallel(run_func(subject, session) for subject, session in
--> 173              itertools.product(config.subjects_list, config.sessions))

~/Desktop/projects/github_repos/mne-study-template/05a-run_ica.py in <genexpr>(.0)
    170 if config.use_ica:
    171     parallel, run_func, _ = parallel_func(run_ica, n_jobs=config.N_JOBS)
--> 172     parallel(run_func(subject, session) for subject, session in
    173              itertools.product(config.subjects_list, config.sessions))

~/Desktop/projects/github_repos/mne-study-template/05a-run_ica.py in run_ica(subject, session)
    136             ica.fit(epochs_for_ica, decim=config.ica_decim)
    137         else:
--> 138             ica.fit(epochs_for_ica, picks=picks, decim=config.ica_decim)
    139 
    140         print('  Fit %d components (explaining at least %0.1f%% of the'

</home/mainak/Desktop/projects/github_repos/mne-python/mne/externals/decorator.py:decorator-gen-394> in fit(self, inst, picks, start, stop, decim, reject, flat, tstep, reject_by_annotation, verbose)

~/Desktop/projects/github_repos/mne-python/mne/utils/_logging.py in wrapper(*args, **kwargs)
     87             with use_log_level(verbose_level):
     88                 return function(*args, **kwargs)
---> 89         return function(*args, **kwargs)
     90     return FunctionMaker.create(
     91         function, 'return decfunc(%(signature)s)',

~/Desktop/projects/github_repos/mne-python/mne/preprocessing/ica.py in fit(self, inst, picks, start, stop, decim, reject, flat, tstep, reject_by_annotation, verbose)
    472                           tstep, reject_by_annotation, verbose)
    473         elif isinstance(inst, BaseEpochs):
--> 474             self._fit_epochs(inst, picks, decim, verbose)
    475 
    476         # sort ICA components by explained variance

~/Desktop/projects/github_repos/mne-python/mne/preprocessing/ica.py in _fit_epochs(self, epochs, picks, decim, verbose)
    569         # more from _pre_whiten)
    570         data, self.pre_whitener_ = \
--> 571             self._pre_whiten(np.hstack(data), epochs.info, picks)
    572 
    573         self._fit(data, self.max_pca_components, 'epochs')

~/anaconda2/envs/mne/lib/python3.6/site-packages/numpy/core/shape_base.py in hstack(tup)
    286         return _nx.concatenate(arrs, 0)
    287     else:
--> 288         return _nx.concatenate(arrs, 1)
    289 
    290 

ValueError: need at least one array to concatenate

This is a bad error message from mne-python end because all the epochs were dropped and that's not what the error message says. Another easy fix @sappelhoff ?

I need to stop now. Can you take over @sappelhoff ?

@jasmainak
Copy link
Member Author

@sappelhoff why is CircleCI failing here?

@jasmainak
Copy link
Member Author

@sappelhoff can you make the CIs happy here?

@jasmainak
Copy link
Member Author

@sappelhoff where did my commit disappear? :)

@sappelhoff
Copy link
Member

@sappelhoff where did my commit disappear? :)

😱 which commit?

@sappelhoff
Copy link
Member

sappelhoff commented Aug 21, 2019

uff, got it: c28281b

no clue how it disappeared ... why it did not survive the rebase and force push

Co-authored-by: Mainak Jas <mainakjas@gmail.com>
@sappelhoff
Copy link
Member

so commit is back @jasmainak ... but now it's failing of course :-)

I'll add this to the project board

@jasmainak
Copy link
Member Author

@sappelhoff don't add too much to the project board. It'll just be me and maybe one more person on this. And we're there for 4.5 days split over many projects ...

@sappelhoff
Copy link
Member

@sappelhoff don't add too much to the project board. It'll just be me and maybe one more person on this. And we're there for 4.5 days split over many projects ...

so you are telling me I should not put the excess work from my GSoC on the project board? 😄

sounds reasonable ... but it felt so nice

@jasmainak
Copy link
Member Author

what did not get done in 3 months will not get done in 4 days :)

@sappelhoff sappelhoff changed the title MRG: make it work for ds001971 Make it work for "inconsisten runs" (using ds001971) Aug 23, 2019
@sappelhoff sappelhoff changed the title Make it work for "inconsisten runs" (using ds001971) Make it work for "inconsistent runs" (using ds001971) Aug 23, 2019
warnings.warn('Events are not unique. Uniqifying them')
_, idx = np.unique(events[:, 0], return_index=True)
events = events[idx]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with mne-tools/mne-python#6688 being merged, we can outsource handling of non-unique events to MNE-Python and remove this code in the study template

@jasmainak jasmainak added the bids label Aug 31, 2019
hoechenberger added a commit to hoechenberger/mne-bids-pipeline that referenced this pull request Jan 14, 2021
Closes mne-tools#41

Remaining / highlightes issues:

- Original dataset doesn't store fine-calibration and crosstalk files
   according to BIDS, so not doing Maxwell filtering for now

- I'd like to calculate the contrast of "face" vs "scrambled", however,
   to do that, I'd need to merge the "familiar" and "unfamiliar" events
   to "faces". We need to add support for operations like this.

Tests will fail until mne-tools/mne-bids#680
has been merged.
@agramfort agramfort closed this in 5437c03 Jan 14, 2021
woodshole coding sprint (2019) automation moved this from In progress to Done Jan 14, 2021
@hoechenberger hoechenberger reopened this Jan 14, 2021
woodshole coding sprint (2019) automation moved this from Done to In progress Jan 14, 2021
@hoechenberger
Copy link
Member

I incorrectly referenced this PR in a different commit. Will start working on this one now.

Base automatically changed from master to main March 26, 2021 13:42
@larsoner
Copy link
Member

larsoner commented Dec 2, 2022

@jasmainak any interest in redoing this with latest main?

@jasmainak
Copy link
Member Author

umm ... I'm not really using mne-bids-pipeline myself, so not my top priority ... I think this was more for @sappelhoff 's GSoC to figure out bugs and smooth them out.

@larsoner
Copy link
Member

larsoner commented Feb 6, 2024

I have been using MNE-BIDS-Pipeline for inconsistent runs with some success, and opened #820 to discuss a somewhat related issue. Let's close this for now and open follow-up PRs as needed to address specific use cases.

@larsoner larsoner closed this Feb 6, 2024
woodshole coding sprint (2019) automation moved this from In progress to Done Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants