fa91217b895957c4106d6175e27d72a48f4f05dc,mne/viz/topo.py,,_plot_evoked_topo,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,530

Before Change


        color = cycle([color])

    times = evoked[0].times
    if not all((e.times == times).all() for e in evoked):
        raise ValueError("All evoked.times must be the same")

    noise_cov = _check_cov(noise_cov, evoked[0].info)
    if noise_cov is not None:
        evoked = [whiten_evoked(e, noise_cov) for e in evoked]
    else:
        evoked = [e.copy() for e in evoked]
    info = evoked[0].info
    ch_names = evoked[0].ch_names
    scalings = _handle_default("scalings", scalings)
    if not all(e.ch_names == ch_names for e in evoked):
        raise ValueError("All evoked.picks must be the same")
    ch_names = _clean_names(ch_names)
    if merge_grads:
        picks = _pair_grad_sensors(info, topomap_coords=False)
        chs = list()
        for pick in picks[::2]:
            ch = info["chs"][pick]
            ch["ch_name"] = ch["ch_name"][:-1] + "X"
            chs.append(ch)
        info["chs"] = chs
        info["bads"] = list()  // bads dropped on pair_grad_sensors
        info._update_redundant()
        info._check_consistency()
        new_picks = list()
        for e in evoked:
            data = _merge_grad_data(e.data[picks])
            if noise_cov is None:
                data *= scalings["grad"]
            e.data = data
            new_picks.append(range(len(data)))
        picks = new_picks
        types_used = ["grad"]
        unit = _handle_default("units")["grad"] if noise_cov is None else "NA"
        y_label = "RMS amplitude (%s)" % unit

    if layout is None:
        layout = find_layout(info)

    if not merge_grads:
        // XXX. at the moment we are committed to 1- / 2-sensor-types layouts
        chs_in_layout = set(layout.names) & set(ch_names)
        types_used = set(channel_type(info, ch_names.index(ch))
                         for ch in chs_in_layout)
        // remove possible reference meg channels
        types_used = set.difference(types_used, set("ref_meg"))
        // one check for all vendors
        meg_types = set(("mag", "grad"))
        is_meg = len(set.intersection(types_used, meg_types)) > 0
        if is_meg:
            types_used = list(types_used)[::-1]  // -> restore kwarg order
            picks = [pick_types(info, meg=kk, ref_meg=False, exclude=[])
                     for kk in types_used]
        else:
            types_used_kwargs = dict((t, True) for t in types_used)
            picks = [pick_types(info, meg=False, exclude=[],
                                **types_used_kwargs)]
        assert isinstance(picks, list) and len(types_used) == len(picks)

        if noise_cov is None:
            for e in evoked:
                for pick, ch_type in zip(picks, types_used):
                    e.data[pick] *= scalings[ch_type]

        if proj is True and all(e.proj is not True for e in evoked):
            evoked = [e.apply_proj() for e in evoked]
        elif proj == "interactive":  // let it fail early.
            for e in evoked:
                _check_delayed_ssp(e)
        // Y labels for picked plots must be reconstructed
        y_label = list()
        for ch_idx in range(len(chs_in_layout)):
            if noise_cov is None:
                unit = _handle_default("units")[channel_type(info, ch_idx)]
            else:
                unit = "NA"
            y_label.append("Amplitude (%s)" % unit)

    if ylim is None:
        def set_ylim(x):
            return np.abs(x).max()
        ylim_ = [set_ylim([e.data[t] for e in evoked]) for t in picks]
        ymax = np.array(ylim_)
        ylim_ = (-ymax, ymax)
    elif isinstance(ylim, dict):
        ylim_ = _handle_default("ylim", ylim)
        ylim_ = [ylim_[kk] for kk in types_used]
        // extra unpack to avoid bug /񳊔

After Change


                         labels=comments)

    time_min = min([t[0] for t in times])
    time_max = max([t[-1] for t in times])
    fig = _plot_topo(info=info, times=[time_min, time_max],
                     show_func=show_func, click_func=click_func, layout=layout,
                     colorbar=False, ylim=ylim_, cmap=None,
                     layout_scale=layout_scale, border=border,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: mne-tools/mne-python
Commit Name: fa91217b895957c4106d6175e27d72a48f4f05dc
Time: 2019-01-12
Author: jnu@iki.fi
File Name: mne/viz/topo.py
Class Name:
Method Name: _plot_evoked_topo


Project Name: facebookresearch/ParlAI
Commit Name: 72e28f315e6458993407beb4d7041ccebca90735
Time: 2018-10-16
Author: bhancock@fb.com
File Name: parlai/core/torch_ranker_agent.py
Class Name: TorchRankerAgent
Method Name: _build_candidates


Project Name: interactiveaudiolab/nussl
Commit Name: b82419f321b3b52841065e00d1f50945d7e8a2ee
Time: 2020-03-16
Author: prem@u.northwestern.edu
File Name: nussl/separation/primitive/hpss.py
Class Name: HPSS
Method Name: run