[med-svn] [python-mne] 23/52: STY: misc
Yaroslav Halchenko
debian at onerussian.com
Fri Nov 27 17:23:46 UTC 2015
This is an automated email from the git hooks/post-receive script.
yoh pushed a commit to annotated tag v0.2
in repository python-mne.
commit a54ebbd0bc508a1ee1ab3cbe90235a3c29d9d608
Author: Alexandre Gramfort <alexandre.gramfort at inria.fr>
Date: Wed Sep 28 17:42:22 2011 -0400
STY: misc
---
mne/epochs.py | 12 +++++++-----
mne/tests/test_epochs.py | 2 +-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/mne/epochs.py b/mne/epochs.py
index b3063a7..b726985 100644
--- a/mne/epochs.py
+++ b/mne/epochs.py
@@ -84,8 +84,10 @@ class Epochs(object):
Drop all epochs marked as bad. Should be used before indexing and
slicing operations.
- Indexing and Slicing:
- -------
+ Notes
+ -----
+ For indexing and slicing:
+
epochs = Epochs(...)
epochs[idx] : Epochs
@@ -197,7 +199,7 @@ class Epochs(object):
if self.preload:
self._data, good_events = self._get_data_from_disk()
- self.events = self.events[good_events, :]
+ self.events = np.atleast_2d(self.events[good_events, :])
self.bad_dropped = True
def drop_picks(self, bad_picks):
@@ -367,9 +369,9 @@ class Epochs(object):
"""
if not self.bad_dropped:
warnings.warn("Bad epochs have not been dropped, indexing will be "
- "inccurate. Use drop_bad_epochs() or preload=True")
+ "inaccurate. Use drop_bad_epochs() or preload=True")
- epochs = copy.copy(self)
+ epochs = copy.copy(self) # XXX : should use deepcopy but breaks ...
epochs.events = np.atleast_2d(self.events[key])
if self.preload:
diff --git a/mne/tests/test_epochs.py b/mne/tests/test_epochs.py
index 120cf87..2712a36 100644
--- a/mne/tests/test_epochs.py
+++ b/mne/tests/test_epochs.py
@@ -84,7 +84,7 @@ def test_indexing_slicing():
# indices for slicing
start_index = 1
- end_index = n_good_events - 1
+ end_index = n_good_events - 1
assert((end_index - start_index) > 0)
--
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