mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.69k stars 1.31k forks source link

Regression: Beamforming errors #1365

Closed larsoner closed 10 years ago

larsoner commented 10 years ago

I have some errors on current master related to beamforming:

======================================================================
ERROR: Test TF beamforming based on DICS
----------------------------------------------------------------------
  File "/home/larsoner/custombuilds/mne-python/mne/beamformer/tests/test_dics.py", line 296, in test_tf_dics
    label=label)
  File "<string>", line 2, in tf_dics
  File "/home/larsoner/custombuilds/mne-python/mne/utils.py", line 444, in verbose
    ret = function(*args, **kwargs)
  File "/home/larsoner/custombuilds/mne-python/mne/beamformer/_dics.py", line 513, in tf_dics
    epochs.subtract_evoked()
  File "/home/larsoner/custombuilds/mne-python/mne/epochs.py", line 316, in subtract_evoked
    raise ValueError('Epochs and Evoked object do not contain '
ValueError: Epochs and Evoked object do not contain the same time points.
-------------------- >> begin captured stdout << ---------------------
(33, 4)

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: Test DICS with evoked data and single trials
----------------------------------------------------------------------
  File "/home/larsoner/custombuilds/mne-python/mne/beamformer/tests/test_dics.py", line 147, in test_dics
    assert_true(0.045 < tmax < 0.055)  # odd due to limited number of epochs
AssertionError: False is not true
    'False is not true' = self._formatMessage('False is not true', "%s is not true" % safe_repr(False))
>>  raise self.failureException('False is not true')

======================================================================
FAIL: Test LCMV with evoked data and single trials
----------------------------------------------------------------------
  File "/home/larsoner/custombuilds/mne-python/mne/beamformer/tests/test_lcmv.py", line 108, in test_lcmv
    assert_true(0.09 < tmax < 0.105)
AssertionError: False is not true
    'False is not true' = self._formatMessage('False is not true', "%s is not true" % safe_repr(False))
>>  raise self.failureException('False is not true')
larsoner commented 10 years ago

Also, I get un-caught warnings related to beamforming during tests.

agramfort commented 10 years ago

can you fix? we're all running now... sorry about this

rgoj commented 10 years ago

Sorry, this didn't come up when I ran the tests locally, can't fix now, earliest in the morning... On 16 Jun 2014 18:33, "Eric89GXL" notifications@github.com wrote:

I have some errors on current master related to beamforming:

ERROR: Test TF beamforming based on DICS

File "/home/larsoner/custombuilds/mne-python/mne/beamformer/tests/test_dics.py", line 296, in test_tf_dics label=label) File "", line 2, in tf_dics File "/home/larsoner/custombuilds/mne-python/mne/utils.py", line 444, in verbose ret = function(_args, *_kwargs) File "/home/larsoner/custombuilds/mne-python/mne/beamformer/_dics.py", line 513, in tf_dics epochs.subtract_evoked() File "/home/larsoner/custombuilds/mne-python/mne/epochs.py", line 316, in subtract_evoked raise ValueError('Epochs and Evoked object do not contain ' ValueError: Epochs and Evoked object do not contain the same time points. -------------------- >> begin captured stdout << --------------------- (33, 4)

--------------------- >> end captured stdout << ----------------------

FAIL: Test DICS with evoked data and single trials

File "/home/larsoner/custombuilds/mne-python/mne/beamformer/tests/test_dics.py", line 147, in test_dics assert_true(0.045 < tmax < 0.055) # odd due to limited number of epochs AssertionError: False is not true 'False is not true' = self._formatMessage('False is not true', "%s is not true" % safe_repr(False))

raise self.failureException('False is not true')

FAIL: Test LCMV with evoked data and single trials

File "/home/larsoner/custombuilds/mne-python/mne/beamformer/tests/test_lcmv.py", line 108, in test_lcmv assert_true(0.09 < tmax < 0.105) AssertionError: False is not true 'False is not true' = self._formatMessage('False is not true', "%s is not true" % safe_repr(False))

raise self.failureException('False is not true')

— Reply to this email directly or view it on GitHub https://github.com/mne-tools/mne-python/issues/1365.

adykstra commented 10 years ago

@rgoj Should I wait until you fix this to start working on baseline contrasts?

rgoj commented 10 years ago

On 16/06/14 18:33, Eric89GXL wrote:

I have some errors on current master related to beamforming:

On it now, I'm getting the errors locally now fortunately, must have missed them yesterday.

rgoj commented 10 years ago

These tests failures seem to be unrelated to recent beamforming code changes. The commit that seems to cause the tests to fail is 92a69816de78653972fe7428dd149e5f8600c3fe, @adykstra, any idea why?

To be precise when I check out the last beamforming change (c45fc21e432ad0503afef18adc1109d332ee772a) the tests pass, when I checkout the commit (d51b5834ef7b117cbb72f6d3c99b9da12cc53d8c) right before the one that causes problems, the tests pass, but they start to fail once I checkout the next one.

larsoner commented 10 years ago

Something might have changed about how projs are handled. I had to fix a test in viz a couple days ago. Do you check anywhere to see if projectors have been applied?

rgoj commented 10 years ago

Errors are now fixed in #1371

The uncaught warnings come from removing unnecessary baselining in tf_lcmv. This causes the warning from compute_covariance, but the data is filtered here, so baselining is unnecessary anyway. So, ideally, I'll try to catch/prevent the warnings from within tf_lcmv, so that users don't get alarmed by them. Good approach?

larsoner commented 10 years ago

I think we should add a parameter to compute_covariance (or whatever you use) to toggle baseline checking at all, since there are legitimate use cases (like yours) where we don't want it (right?).

rgoj commented 10 years ago

@Eric89GXL, I'm trying to see if I can check if the data was highpass filtered, suggested by @agramfort

rgoj commented 10 years ago

@agramfort seems we can't check if data was filtered or not, this comes from the filter method:

Note: self.info['lowpass'] and self.info['highpass'] are only updated
with picks=None.

Shall I add a parameter to compute_covariance?

rgoj commented 10 years ago

The warnings problem is now solved too by manually writing info['highpass'] and checking for it before issuing the warning in compute_covariance (#1376), thanks for the suggestions @agramfort and @Eric89GXL