-
Notifications
You must be signed in to change notification settings - Fork 1.4k
MRG: Fix bleeding-edge library bugs #5811
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
Conversation
mne/inverse_sparse/mxne_optim.py
Outdated
clf = MultiTaskLasso(alpha=alpha / len(M), tol=tol / sum_squared(M), | ||
normalize=False, fit_intercept=False, max_iter=maxit, | ||
warm_start=True) | ||
clf.coef_ = init | ||
if init is not None: | ||
clf.coef_ = init.T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI these +2 / -4 are the ones that fixed the mxne_optim
bug
nopos_chanlocs[ind][dt[fld][0]] = vals[fld] | ||
# In theory this should work and be simpler, but there is an obscure | ||
# SciPy writing bug that pops up sometimes: | ||
# nopos_chanlocs = np.array(chanlocs[['labels', 'Z']]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And these are the lines that fixed the obscure savemat bug
Turns out that the "fix" for sklearn |
|
||
import numpy as np | ||
from numpy.testing import (assert_array_almost_equal, assert_array_equal, | ||
assert_allclose, assert_equal) | ||
import pytest | ||
import matplotlib.pyplot as plt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was moved up from below in test_find_layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Eventually there is lout.plot and plt.close)
@larsoner we had this conversation in the past that matplotlib should not be a hard dep of mne: 14ab6b6#diff-d859f370c264e1ee2bcb22eefd2c5c2d does this PR change this? |
No, just a dependency to run tests as usual |
LGTM ok for you @massich ? |
|
||
|
||
@pytest.fixture(scope='package') | ||
def matplotlib_config(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1000
Since SciPy 1.2.0 just came out and NumPy 1.16.0 is in RC status, I updated all my libs locally and hunted down errors. This PR thus (in three separate commits):
sklearn
var (we shouldn't ever setclf.coefs_ = None
, sklearn can't handle this anymore). I also fixed PEP8 errors while in the file.scipy.io.savemat
bug when subselecting fields from a structured array intest_eeglab.py
. I also fixed PEP8 errors while in the file.matplotlib
tests. I noticed mine had been horribly slow for some time. Turns out it's because I addedinteractive=True
to mymatplotlibrc
. We now use a package-widepytest
fixture to setmatplotlib
params. This allows us to stop nesting ourplt
imports in tests, and no longer needmatploltlib.use
at the top of every test file that has viz tests. This makes our code more DRY and lowers maintenance and new-contributor burden! (I am really starting to appreciate all thatpytest
brings to the table.)