[med-svn] [python-mne] 01/05: Imported Upstream version 0.8.3+dfsg

Alexandre Gramfort agramfort-guest at moszumanska.debian.org
Sat Oct 25 07:52:15 UTC 2014


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

agramfort-guest pushed a commit to branch master
in repository python-mne.

commit 696d09ebcd4ea9483860e8e7d9ddf6e421525c32
Author: Alexandre Gramfort <alexandre.gramfort at m4x.org>
Date:   Wed Sep 3 00:51:14 2014 -0400

    Imported Upstream version 0.8.3+dfsg
---
 doc/source/python_reference.rst      | 30 ++++++++++++++++++++++++++++--
 mne/__init__.py                      |  2 +-
 mne/channels.py                      |  9 +++++++--
 mne/html/bootstrap.min.js            |  7 +++++++
 mne/html/d3.v3.min.js                |  5 +++++
 mne/html/jquery-1.10.2.min.js        |  6 ++++++
 mne/html/jquery-ui.min.js            | 12 ++++++++++++
 mne/html/mpld3.v0.2.min.js           |  2 ++
 mne/time_frequency/__init__.py       |  1 +
 mne/time_frequency/tests/test_tfr.py | 16 ++++++++++++++++
 mne/time_frequency/tfr.py            |  5 ++++-
 11 files changed, 89 insertions(+), 6 deletions(-)

diff --git a/doc/source/python_reference.rst b/doc/source/python_reference.rst
index 6101c43..3704cc9 100644
--- a/doc/source/python_reference.rst
+++ b/doc/source/python_reference.rst
@@ -132,7 +132,7 @@ Functions:
    get_head_surf
    get_meg_helmet_surf
    parse_config
-   read_annot
+   read_labels_from_annot
    read_bem_solution
    read_bem_surfaces
    read_cov
@@ -151,7 +151,7 @@ Functions:
    read_surface
    read_trans
    save_stc_as_volume
-   write_annot
+   write_labels_to_annot
    write_bem_surface
    write_cov
    write_events
@@ -723,7 +723,19 @@ Decoding
 
 .. automodule:: mne.decoding
    :no-members:
+   :no-inherited-members:
+
+Classes:
+
+.. autosummary::
+   :toctree: generated/
+   :template: class.rst
 
+   Scaler
+   ConcatenateChannels
+   PSDEstimator
+   FilterEstimator
+   CSP
 
 Realtime
 ========
@@ -732,6 +744,20 @@ Realtime
 
 .. automodule:: mne.realtime
    :no-members:
+   :no-inherited-members:
+
+Classes:
+
+.. autosummary::
+   :toctree: generated/
+   :template: class.rst
+
+   RtEpochs
+   RtClient
+   MockRtClient
+   FieldTripClient
+   StimServer
+   StimClient
 
 MNE-Report
 ==========
diff --git a/mne/__init__.py b/mne/__init__.py
index a2d4884..a8c5268 100644
--- a/mne/__init__.py
+++ b/mne/__init__.py
@@ -1,7 +1,7 @@
 """MNE for MEG and EEG data analysis
 """
 
-__version__ = '0.8.2'
+__version__ = '0.8.3'
 
 # have to import verbose first since it's needed by many things
 from .utils import (set_log_level, set_log_file, verbose, set_config,
diff --git a/mne/channels.py b/mne/channels.py
index 1c525fd..d50dee2 100644
--- a/mne/channels.py
+++ b/mne/channels.py
@@ -92,10 +92,11 @@ def equalize_channels(candidates, verbose=None):
     from .io.base import _BaseRaw
     from .epochs import Epochs
     from .evoked import Evoked
+    from .time_frequency import AverageTFR
 
-    if not all([isinstance(c, (_BaseRaw, Epochs, Evoked))
+    if not all([isinstance(c, (_BaseRaw, Epochs, Evoked, AverageTFR))
                 for c in candidates]):
-        valid = ['Raw', 'Epochs', 'Evoked']
+        valid = ['Raw', 'Epochs', 'Evoked', 'AverageTFR']
         raise ValueError('candidates must be ' + ' or '.join(valid))
 
     chan_max_idx = np.argmax([c.info['nchan'] for c in candidates])
@@ -175,6 +176,8 @@ class PickDropChannelsMixin(object):
         from .io.base import _BaseRaw
         from .epochs import Epochs
         from .evoked import Evoked
+        from .time_frequency import AverageTFR
+
         if isinstance(self, _BaseRaw):
             if not self.preload:
                 raise RuntimeError('Raw data must be preloaded to drop or pick'
@@ -197,6 +200,8 @@ class PickDropChannelsMixin(object):
             self._data = self._data[idx, :]
         elif isinstance(self, Epochs) and inst_has('_data'):
             self._data = self._data[:, idx, :]
+        elif isinstance(self, AverageTFR) and inst_has('data'):
+            self.data = self.data[idx, :, :]
         elif isinstance(self, Evoked):
             self.data = self.data[idx, :]
 
diff --git a/mne/html/bootstrap.min.js b/mne/html/bootstrap.min.js
new file mode 100644
index 0000000..1a6258e
--- /dev/null
+++ b/mne/html/bootstrap.min.js
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v3.0.3 (http://getbootstrap.com)
+ * Copyright 2013 Twitter, Inc.
+ * Licensed under http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).tri [...]
\ No newline at end of file
diff --git a/mne/html/d3.v3.min.js b/mne/html/d3.v3.min.js
new file mode 100644
index 0000000..eed58e6
--- /dev/null
+++ b/mne/html/d3.v3.min.js
@@ -0,0 +1,5 @@
+!function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(n){return aa+n in this}function o(n){return n=aa+n,n in this&&delete this[n]}function a(){var n=[];return this.forEach(function(t){n.push(t)}),n}function c(){var n=0;for(var t in this)t.charCodeAt(0)===ca&&++n;retu [...]
+},t.clipExtent=function(n){return arguments.length?(w=n,_=n?Pe(n[0][0],n[0][1],n[1][0],n[1][1]):bt,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Na,d=n[1]%360*Na,r()):[v*La,d*La]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Na,y=n[1]%360*Na,x=n.length>2?n[2]%360*Na:0,r()):[m*La,y*La,x*La]},Xo.rebind(t,f,"precision"),functio [...]
+}return r.invert=function(t){return Io(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Io)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Io(+e+1),t).length}var i=r.domain(),o=Ti(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Pi(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Ti(r.dom [...]
+}};return function(n){g=h=-(l=f=1/0),x=[],Xo.geo.stream(n,_);var t=x.length;if(t){x.sort(c);for(var e,r=1,u=x[0],i=[u];t>r;++r)e=x[r],s(e[0],u)||s(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,l=e[0],h=u[1])}return x=M=null,1/0===l||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[l,f],[h,g]]}}(),Xo.geo.centroid=function(n){pc=vc=dc=mc=yc=xc=Mc=_c=bc=wc=Sc=0,Xo.geo [...]
+},Xo.scale.quantize=function(){return Ki(0,1,[0,1])},Xo.scale.threshold=function(){return Qi([.5],[0,1])},Xo.scale.identity=function(){return no([0,1])},Xo.svg={},Xo.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=e.apply(this,arguments),o=r.apply(this,arguments)+ys,a=u.apply(this,arguments)+ys,c=(o>a&&(c=o,o=a,a=c),a-o),s=Sa>c?"0":"1",l=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);return c>=xs?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+ [...]
\ No newline at end of file
diff --git a/mne/html/jquery-1.10.2.min.js b/mne/html/jquery-1.10.2.min.js
new file mode 100644
index 0000000..da41706
--- /dev/null
+++ b/mne/html/jquery-1.10.2.min.js
@@ -0,0 +1,6 @@
+/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery-1.10.2.min.map
+*/
+(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/ [...]
+}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null [...]
+u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.first [...]
diff --git a/mne/html/jquery-ui.min.js b/mne/html/jquery-ui.min.js
new file mode 100644
index 0000000..82bbb67
--- /dev/null
+++ b/mne/html/jquery-ui.min.js
@@ -0,0 +1,12 @@
+/*! jQuery UI - v1.10.3 - 2013-05-03
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, [...]
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t,e){function i(e,i){var n,o,a,r=e.nodeName.toLowerCase();return"area"===r?(n=e.parentNode,o=n.name,e.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap=#"+o+"]")[0],!!a&&s(a)):!1):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r?e.href||i:i)&&s(e)}function s(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var n=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1. [...]
+},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},t.ui.ddmanager.droppables[e.scope]=t.ui.ddmanager.droppables[e.scope]||[],t.ui.ddmanager.droppables[e.scope].push(this),e.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(th [...]
+this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(thi [...]
+},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("t [...]
+case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e [...]
+}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function( [...]
+},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math. [...]
+if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=s [...]
\ No newline at end of file
diff --git a/mne/html/mpld3.v0.2.min.js b/mne/html/mpld3.v0.2.min.js
new file mode 100644
index 0000000..adefb15
--- /dev/null
+++ b/mne/html/mpld3.v0.2.min.js
@@ -0,0 +1,2 @@
+!function(t){function s(t){var s={};for(var o in t)s[o]=t[o];return s}function o(t,s){t="undefined"!=typeof t?t:10,s="undefined"!=typeof s?s:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var o=s.charAt(Math.round(Math.random()*(s.length-11))),e=1;t>e;e++)o+=s.charAt(Math.round(Math.random()*(s.length-1)));return o}function e(s,o){var e=t.interpolate([s[0].valueOf(),s[1].valueOf()],[o[0].valueOf(),o[1].valueOf()]);return function(t){var s=e(t);return[new Date(s[0]), [...]
+},this.disable=function(){t.select(l).call(p.clear()),this.fig.hideBrush(this.extentClass),this.enabled=!1},this.disable()},F.register_plugin("mouseposition",B),B.prototype=Object.create(F.Plugin.prototype),B.prototype.constructor=B,B.prototype.requiredProps=[],B.prototype.defaultProps={fontsize:12,fmt:".3g"},B.prototype.draw=function(){for(var s=this.fig,o=t.format(this.props.fmt),e=s.canvas.append("text").attr("class","mpld3-coordinates").style("text-anchor","end").style("font-size",th [...]
\ No newline at end of file
diff --git a/mne/time_frequency/__init__.py b/mne/time_frequency/__init__.py
index 806c44d..4e8837c 100644
--- a/mne/time_frequency/__init__.py
+++ b/mne/time_frequency/__init__.py
@@ -2,6 +2,7 @@
 """
 
 from .tfr import induced_power, single_trial_power, morlet, tfr_morlet
+from .tfr import AverageTFR
 from .psd import compute_raw_psd, compute_epochs_psd
 from .csd import CrossSpectralDensity, compute_epochs_csd
 from .ar import yule_walker, ar_raw, iir_filter_raw
diff --git a/mne/time_frequency/tests/test_tfr.py b/mne/time_frequency/tests/test_tfr.py
index 653e43a..d9497cc 100644
--- a/mne/time_frequency/tests/test_tfr.py
+++ b/mne/time_frequency/tests/test_tfr.py
@@ -3,6 +3,7 @@ import os.path as op
 from numpy.testing import assert_array_almost_equal
 from nose.tools import assert_true, assert_false, assert_equal
 
+import mne
 from mne import io, Epochs, read_events, pick_types
 from mne.time_frequency import single_trial_power
 from mne.time_frequency.tfr import cwt_morlet, morlet, tfr_morlet
@@ -51,6 +52,10 @@ def test_time_frequency():
     freqs = np.arange(6, 20, 5)  # define frequencies of interest
     n_cycles = freqs / 4.
 
+    # Test first with a single epoch
+    power, itc = tfr_morlet(epochs[0], freqs=freqs, n_cycles=n_cycles,
+                            use_fft=True, return_itc=True)
+
     power, itc = tfr_morlet(epochs, freqs=freqs, n_cycles=n_cycles,
                             use_fft=True, return_itc=True)
 
@@ -91,3 +96,14 @@ def test_time_frequency():
                                       n_cycles=2)
 
     assert_array_almost_equal(np.mean(single_power), power.data)
+
+    power_pick = power.pick_channels(power.ch_names[:10:2])
+    assert_equal(len(power_pick.ch_names), len(power.ch_names[:10:2]))
+    assert_equal(power_pick.data.shape[0], len(power.ch_names[:10:2]))
+    power_drop = power.drop_channels(power.ch_names[1:10:2])
+    assert_equal(power_drop.ch_names, power_pick.ch_names)
+    assert_equal(power_pick.data.shape[0], len(power_drop.ch_names))
+
+    mne.equalize_channels([power_pick, power_drop])
+    assert_equal(power_pick.ch_names, power_drop.ch_names)
+    assert_equal(power_pick.data.shape, power_drop.data.shape)
diff --git a/mne/time_frequency/tfr.py b/mne/time_frequency/tfr.py
index 6a16a9e..7653eed 100644
--- a/mne/time_frequency/tfr.py
+++ b/mne/time_frequency/tfr.py
@@ -386,7 +386,7 @@ def _induced_power(data, Fs, frequencies, use_fft=True, n_cycles=7,
         plf = np.empty((n_channels, n_frequencies, n_times), dtype=np.complex)
 
         for c in range(n_channels):
-            X = np.squeeze(data[:, c, :])
+            X = data[:, c, :]
             this_psd, this_plf = _time_frequency(X, Ws, use_fft)
             psd[c], plf[c] = this_psd[:, ::decim], this_plf[:, ::decim]
     else:
@@ -476,6 +476,9 @@ def _preproc_tfr(data, times, freqs, tmin, tmax, fmin, fmax, mode,
 
     freqs = freqs[ifmin:ifmax]
 
+    # crop data
+    data = data[:, ifmin:ifmax, itmin:itmax]
+
     times *= 1e3
     if dB:
         data = 20 * np.log10(data)

-- 
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