[med-svn] [python-mne] 328/353: FIX: don't use index() in loop

Yaroslav Halchenko debian at onerussian.com
Fri Nov 27 17:25:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

yoh pushed a commit to tag 0.4
in repository python-mne.

commit de089113dcace32521d4c26c854dc234b191340d
Author: Martin Luessi <mluessi at nmr.mgh.harvard.edu>
Date:   Mon Jul 30 16:10:44 2012 -0400

    FIX: don't use index() in loop
---
 mne/cov.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mne/cov.py b/mne/cov.py
index a368a8c..518a403 100644
--- a/mne/cov.py
+++ b/mne/cov.py
@@ -491,13 +491,13 @@ def regularize(cov, info, mag=0.1, grad=0.1, eeg=0.1, exclude=None,
     ch_names = cov.ch_names
 
     idx_eeg, idx_mag, idx_grad = [], [], []
-    for ch in ch_names:
+    for i, ch in enumerate(ch_names):
         if ch in ch_names_eeg:
-            idx_eeg.append(ch_names.index(ch))
+            idx_eeg.append(i)
         elif ch in ch_names_mag:
-            idx_mag.append(ch_names.index(ch))
+            idx_mag.append(i)
         elif ch in ch_names_grad:
-            idx_grad.append(ch_names.index(ch))
+            idx_grad.append(i)
         else:
             raise Exception('channel is unknown type')
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-mne.git



More information about the debian-med-commit mailing list