Skip to content

Commit

Permalink
Merge e4c1c6a into 1eeddd3
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeilepp authored Nov 18, 2016
2 parents 1eeddd3 + e4c1c6a commit 6e37de1
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/time_frequency/plot_time_frequency_simulated.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
power = tfr_stockwell(epochs, fmin=fmin, fmax=fmax, width=width)
power.plot([0], baseline=(0., 0.1), mode='mean',
title='Sim: Using S transform, width '
'= {:0.1f}'.format(width), show=True)
'= {0:0.1f}'.format(width), show=True)

# #############################################################################
# Finally, compare to morlet wavelet
Expand Down
8 changes: 4 additions & 4 deletions mne/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def _get_channel_positions(self, picks=None):
n_zero = np.sum(np.sum(np.abs(pos), axis=1) == 0)
if n_zero > 1: # XXX some systems have origin (0, 0, 0)
raise ValueError('Could not extract channel positions for '
'{} channels'.format(n_zero))
'{0} channels'.format(n_zero))
return pos

def _set_channel_positions(self, pos, names):
Expand Down Expand Up @@ -771,7 +771,7 @@ def read_ch_connectivity(fname, picks=None):
break
else:
raise ValueError('I do not know about this neighbor '
'template: "{}"'.format(fname))
'template: "{0}"'.format(fname))

fname = op.join(templates_dir, fname)

Expand All @@ -783,8 +783,8 @@ def read_ch_connectivity(fname, picks=None):
if picks is not None:
if max(picks) >= len(ch_names):
raise ValueError('The picks must be compatible with '
'channels. Found a pick ({}) which exceeds '
'the channel range ({})'
'channels. Found a pick ({0}) which exceeds '
'the channel range ({1})'
.format(max(picks), len(ch_names)))
connectivity = _ch_neighbor_connectivity(ch_names, neighbors)
if picks is not None:
Expand Down
7 changes: 4 additions & 3 deletions mne/decoding/tests/test_time_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ def test_generalization_across_time():
y_4classes = np.hstack((epochs.events[:7, 2], epochs.events[7:, 2] + 1))
if check_version('sklearn', '0.18'):
from sklearn.model_selection import (KFold, StratifiedKFold,
ShuffleSplit, LeaveOneLabelOut)
ShuffleSplit, LeaveOneGroupOut)
cv_shuffle = ShuffleSplit()
cv = LeaveOneLabelOut()

cv = LeaveOneGroupOut()
# XXX we cannot pass any other parameters than X and y to cv.split
# so we have to build it before hand
cv_lolo = [(train, test) for train, test in cv.split(
X=y_4classes, y=y_4classes, labels=y_4classes)]
X=y_4classes, y=y_4classes, groups=y_4classes)]

# With sklearn >= 0.17, `clf` can be identified as a regressor, and
# the scoring metrics can therefore be automatically assigned.
Expand Down
2 changes: 1 addition & 1 deletion mne/io/pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def pick_types(info, meg=True, eeg=False, stim=False, eog=False, ecg=False,
ias, syst, seeg, dipole, gof, bio, ecog):
if not isinstance(param, bool):
w = ('Parameters for all channel types (with the exception '
'of "meg" and "ref_meg") must be of type bool, not {}.')
'of "meg" and "ref_meg") must be of type bool, not {0}.')
raise ValueError(w.format(type(param)))

for k in range(nchan):
Expand Down
2 changes: 1 addition & 1 deletion mne/tests/test_source_estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_volume_stc():
assert_array_almost_equal(img.get_affine(), t1_img.get_affine(),
decimal=5)

except ImportError:
except Exception:
print('Save as nifti test skipped, needs NiBabel')


Expand Down
6 changes: 2 additions & 4 deletions mne/time_frequency/tfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,8 @@ def _onselect(self, eclick, erelease, baseline, mode, layout):
if 'grad' in self:
types.append('grad')
fig = figure_nobar()
fig.suptitle('{:.2f} s - {:.2f} s, {:.2f} Hz - {:.2f} Hz'.format(tmin,
tmax,
fmin,
fmax),
fig.suptitle('{0:.2f} s - {1:.2f} s, '
'{2:.2f} Hz - {3:.2f} Hz'.format(tmin, tmax, fmin, fmax),
y=0.04)
for idx, ch_type in enumerate(types):
ax = plt.subplot(1, len(types), idx + 1)
Expand Down
2 changes: 1 addition & 1 deletion mne/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def has_nibabel(vox2ras_tkr=False):
'header_class', 0),
'get_vox2ras_tkr', None) is not None)
return out
except ImportError:
except Exception:
return False


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ doctest-fixtures = _fixture

[flake8]
exclude = __init__.py,*externals*,constants.py,fixes.py
ignore = E241
ignore = E241,E305
2 changes: 1 addition & 1 deletion tutorials/plot_dipole_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
plot_params['colorbar'] = True
diff.plot_topomap(time_format='Difference', axes=axes[2], **plot_params)
plt.suptitle('Comparison of measured and predicted fields '
'at {:.0f} ms'.format(best_time * 1000.), fontsize=16)
'at {0:.0f} ms'.format(best_time * 1000.), fontsize=16)

###############################################################################
# Estimate the time course of a single dipole with fixed position and
Expand Down
2 changes: 1 addition & 1 deletion tutorials/plot_python_intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# If you come from a background of matlab, remember that indexing in python
# starts from zero:
a = [1, 2, 3, 4]
print('This is the zeroth value in the list: {}'.format(a[0]))
print('This is the zeroth value in the list: {0}'.format(a[0]))

###############################################################################
# No need to reinvent the wheel. Scipy and Numpy are battle field tested
Expand Down
4 changes: 2 additions & 2 deletions tutorials/plot_stats_spatio_temporal_cluster_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@

plt.imshow(connectivity.toarray(), cmap='gray', origin='lower',
interpolation='nearest')
plt.xlabel('{} Magnetometers'.format(len(ch_names)))
plt.ylabel('{} Magnetometers'.format(len(ch_names)))
plt.xlabel('{0} Magnetometers'.format(len(ch_names)))
plt.ylabel('{0} Magnetometers'.format(len(ch_names)))
plt.title('Between-sensor adjacency')

###############################################################################
Expand Down

0 comments on commit 6e37de1

Please sign in to comment.