Repository navigation
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4637 +/- ##
==========================================
- Coverage 87.68% 87.57% -0.11%
==========================================
Files 351 351
Lines 66613 66765 +152
Branches 11550 11597 +47
==========================================
+ Hits 58407 58469 +62
- Misses 5254 5328 +74
- Partials 2952 2968 +16 |
|
These changes look too extensive for 0.15. I think we'll want to test for some months before unleashing on the public. 0.16 okay with you? |
|
@larsoner give us one more day to evaluate.
It's more bug fixes
|
| from mne.io import read_info, read_raw_fif | ||
| from mne.io.constants import FIFF | ||
| from mne.io.proc_history import _get_sss_rank | ||
| from mne import _get_rank_sss |
There was a problem hiding this comment.
I don't think we should put this at the root level, it seems better buried in io.proc_history
|
I think this solves a circrular import issue. I could not get it working
inside meas info IIRC ...
…On Tue 3 Oct 2017 at 18:16, Eric Larson ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In mne/io/tests/test_proc_history.py
<#4637 (comment)>:
> from mne.io.constants import FIFF
-from mne.io.proc_history import _get_sss_rank
+from mne import _get_rank_sss
I don't think we should put this at the root level, it seems better buried
in io.proc_history
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4637 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB0finPbHNZC2K2yQmF8a07XXvH1vwIuks5sol3OgaJpZM4Pr1jp>
.
|
Probably better to solve it with a nested import |
|
Let me try that. I agree that it is far from ideal as it is now.
…On Tue 3 Oct 2017 at 19:04, Eric Larson ***@***.***> wrote:
I think this solves a circrular import issue.
Probably better to solve it with a nested import
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4637 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB0figbEj6p9-V27mbDiJPvOsX0dO719ks5somk0gaJpZM4Pr1jp>
.
|
| Computing covariance matrix | ||
| =========================== | ||
|
|
||
| Many methods in MNE, including e.g. source estimation and some classification |
There was a problem hiding this comment.
This broke CircleCI
ValueError: Example docstring should have a header for the example title and at least a paragraph explaining what the example is about. Please check the example file:
plot_compute_covariance.py
There was a problem hiding this comment.
wow, oops. this was not intended.
|
@larsoner @larsoner @jasmainak this is good for review. |
| picks_list_ = picks_list | ||
|
|
||
| for key, this_picks in picks_list_: | ||
| this_info = pick_info(info.copy(), this_picks) |
There was a problem hiding this comment.
pick_info has a copy param and I think it defaults to True
| if key == 'meg' and has_sss: | ||
| rank = min(rank, _get_rank_sss(info)) | ||
| n_ssp = sum(pp['active'] for pp in info['projs'] if | ||
| _match_proj_type(pp, this_info['ch_names'])) |
There was a problem hiding this comment.
I don't think it depends on active IIRC we always apply proj at some point in the pipeline before applying the inverse
There was a problem hiding this comment.
what do you mean @larsoner? This is what I needed to get it right IIRC. Any alternative suggestion?
There was a problem hiding this comment.
I'm trying to figure out if you should just do sum(_match_proj_type(pp, this_info['ch_names'])). Think about the proj='delayed' use case or even epochs=Epochs(proj=False) (but will be applied later during inversion) will this code do the right thing?
There was a problem hiding this comment.
I agree with @larsoner we always end up applying all proj in the inverse to me:
sum(_match_proj_type(pp, this_info['ch_names']))
seems like the right fix
|
|
||
| elif this_method == 'pca': | ||
| estimator_cov_info.append([sc, sc.covariance_, _info]) | ||
| elif this_method == 'pca': # XXX this is now nonsensical |
| estimator_cov_info.append([pca, pca.get_covariance(), _info]) | ||
|
|
||
| elif this_method == 'factor_analysis': | ||
| elif this_method == 'factor_analysis': # XXX SSS case + EEG weird? |
There was a problem hiding this comment.
and this one? is it exposed by some test? do we need a doc update?
| # XXX we need a rank dict here and clip conditional upon | ||
| # low rank config. | ||
| if has_sss: | ||
| # XXX the logic is broken here for EEG |
There was a problem hiding this comment.
This looks a bit like something we need to raise an error or warning for, or fix before release
There was a problem hiding this comment.
I should remove the XXX now....
| time_label=time_label, n_jobs=n_jobs) | ||
|
|
||
| def plot_white(self, noise_cov, show=True): | ||
| def plot_white(self, noise_cov, rank=None, show=True): |
There was a problem hiding this comment.
should be after show for backward compat
There was a problem hiding this comment.
Do we really support API positional arguments?
I feel something like show should be the last one. And people should anyways not use positional arguments. The order of the purely positional arguments should be of course preserved.
There was a problem hiding this comment.
Do we really support API positional arguments?
Yes, at least for the first few inputs (say maybe 10?). In this case there were only two so I think it's clear.
I feel something like show should be the last one.
We'd need to do this in a separate PR
And people should anyways not use positional arguments.
I think it's reasonable to use positional arguments and expect API stability there. Imagine someone has code:
show = True # can be toggled to false in iteration
...
evoked.plot_white(cov, show)
This seems fine to me, and this change will break it.
There was a problem hiding this comment.
I don't share this view as I always recommend to pass by keyword, but if you insist it's ok with me.
|
|
||
| # but the rest is the same | ||
| assert_array_equal( | ||
| assert_array_almost_equal( # XXX make sure this is ok. |
There was a problem hiding this comment.
That assert_array_equal does not work here and that I don't know if this is expected or not.
There was a problem hiding this comment.
I'd use assert_allclose with proper rtol and atol set based on the data of interest
| noise_cov = mne.compute_raw_covariance( | ||
| raw_empty_room, tmin=0, tmax=None, method='diagonal_fixed') | ||
| noise_cov.nfree | ||
| ############################################################################### |
|
|
||
| noise_cov = mne.compute_raw_covariance( | ||
| raw_empty_room, tmin=0, tmax=None, method='diagonal_fixed') | ||
| noise_cov.nfree |
There was a problem hiding this comment.
some explanation for diagonal_fixed choice would be good
There was a problem hiding this comment.
it was just debugging. I will remove it.
| # file with :func:`mne.write_cov`. Later you can read it back to a python | ||
| # object using :func:`mne.read_cov`. | ||
| # Now that you the covariance matrix in an MNE-Python object you can save it | ||
| # to a file with :func:`mne.write_cov`. Later you can read it back |
|
@dengemann I am sorry I need one more day before I can try it on biomag data ... |
|
@dengemann you have some undesired commits in this PR (stuff already in master) |
|
@dengemann you need to rebase and clean history... |
|
Copied that. Did not have time yet to fix the mess.
…On Mon 9 Oct 2017 at 20:44, Alexandre Gramfort ***@***.***> wrote:
@dengemann <https://github.com/dengemann> you need to rebase and clean
history...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4637 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB0fimMt59CWm326Td1_oe2LE5mznQTZks5sqml0gaJpZM4Pr1jp>
.
|
ae75b95 to
db94218
Compare
|
Travis failure is the unrelated OSX failure currently in Can you add to |
413f563 to
c68cd5c
Compare
|
Slightly OT, but do you think this can be merged ASAP to finalize 0.15 (if possible, please consider #4662, which is ready to go, but I'd argue for no further major delays)? |
+1 yes I think this is all we are waiting for currently |
| raw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif') | ||
| raw = mne.io.read_raw_fif(raw_fname) | ||
| raw.set_eeg_reference('average', projection=True) | ||
| raw.set_eeg_reference() |
|
Closing to split into mergeable and more-dev-to-do part. |
Work in progress & to be fine tuned.
But here is what I propose (pooling over the last months of discussion):
This should then stabilize the performance of plot_white
cc @agramfort @larsoner