{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/178098589","pull_request_review_id":108101190,"id":178098589,"diff_hunk":"@@ -0,0 +1,81 @@\n+# author: ngayraud\n+#\n+# Created on Fri Mar 16 10:31:51 2018.\n+\n+import warnings\n+import numpy as np\n+\n+from ..cov import make_ad_hoc_cov, read_cov, make_custom_cov\n+from ..externals.six import string_types\n+from ..io.pick import pick_channels_cov\n+from ..utils import check_random_state\n+\n+from mne.cov import Covariance","path":"mne/simulation/noise.py","position":13,"original_position":13,"commit_id":"e510db2b741fdedd972f36f2d4d81e170e1405d4","original_commit_id":"e510db2b741fdedd972f36f2d4d81e170e1405d4","user":{"login":"agramfort","id":161052,"avatar_url":"https://avatars2.githubusercontent.com/u/161052?v=4","gravatar_id":"","url":"https://api.github.com/users/agramfort","html_url":"https://github.com/agramfort","followers_url":"https://api.github.com/users/agramfort/followers","following_url":"https://api.github.com/users/agramfort/following{/other_user}","gists_url":"https://api.github.com/users/agramfort/gists{/gist_id}","starred_url":"https://api.github.com/users/agramfort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agramfort/subscriptions","organizations_url":"https://api.github.com/users/agramfort/orgs","repos_url":"https://api.github.com/users/agramfort/repos","events_url":"https://api.github.com/users/agramfort/events{/privacy}","received_events_url":"https://api.github.com/users/agramfort/received_events","type":"User","site_admin":false},"body":"use relative import","created_at":"2018-03-29T15:44:14Z","updated_at":"2018-03-29T15:44:14Z","html_url":"https://github.com/mne-tools/mne-python/pull/5059#discussion_r178098589","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/5059","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/178098589"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/5059#discussion_r178098589"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/5059"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/5059","id":178364740,"html_url":"https://github.com/mne-tools/mne-python/pull/5059","diff_url":"https://github.com/mne-tools/mne-python/pull/5059.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/5059.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/5059","number":5059,"state":"open","locked":false,"title":"Feature: Simulation of signals","user":{"login":"ngayraud","id":18072563,"avatar_url":"https://avatars0.githubusercontent.com/u/18072563?v=4","gravatar_id":"","url":"https://api.github.com/users/ngayraud","html_url":"https://github.com/ngayraud","followers_url":"https://api.github.com/users/ngayraud/followers","following_url":"https://api.github.com/users/ngayraud/following{/other_user}","gists_url":"https://api.github.com/users/ngayraud/gists{/gist_id}","starred_url":"https://api.github.com/users/ngayraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngayraud/subscriptions","organizations_url":"https://api.github.com/users/ngayraud/orgs","repos_url":"https://api.github.com/users/ngayraud/repos","events_url":"https://api.github.com/users/ngayraud/events{/privacy}","received_events_url":"https://api.github.com/users/ngayraud/received_events","type":"User","site_admin":false},"body":"Related to issue #5058 \r\n\r\nThe implementation I coded is i think generic enough to allow for other types of simulations. I looked a lot into the existing MNE code and tried to make mine as close as possible to the way things are implemented. I have used many of the existing functions, added some that I needed and couldn’t find, and tried to design the whole thing in an “easy to use” way.\r\n\r\nSome documentation about new files and functions.\r\n\r\n**_simulation/simulation.py_**\r\n\r\nThis file contains the Simulation object and functions to generate raw (Raw object) simulated data. The main idea can be summarized as this:\r\n\r\nSimulation mostly handles things that are happening at a source level. So: the number of dipoles, the selection of dipoles (to be implemented in a better way), the kind of activity that will be associated to each dipole (waveforms) and if it is a waveform that models a response to a stimulus, the time window associated to the response (time array).\r\n\r\nsimulate_raw_signal corresponds more to the “external” parameters of the simulation. The most important input parameters are an initialized Simulation object, the stimuli (events), the noise, and time length of the experiment. The number of events must however be either a single array that will be applied to all types of waveforms, or a list that has the same length as the number of dipoles.\r\n\r\n_**simulation/waveforms.py**_    \r\n\r\nThis file contains some waveforms that can be parameterized. More can be added. The user can also create his own waveform and provide it as input.\r\n\r\n**_simulation/noise.py_**\r\n\r\nThis file contains some functions to handle noise simulations.\r\nI needed to be able to generate noise with specific parameters, and also I think that this function (generate_noise_data) should exist separately, so I took the existing private function in evoked.py and copied it (and minimally changed it).\r\n\r\n_Also added: some tests in the simulation/tests folder._\r\n\r\nFinally, I added a function in _cov.py_ to create a covariance matrix from an array that represents the variance of each random variable, called _make_custom_cov.py_. It’s a fast solution that I don’t like but for now it does the job. \r\n\r\n======================\r\n\r\n**Notes:** \r\n\r\nConcerning the events, the idea is to use them to convolute the basic waveform with the stimulus occurence to obtain the source signal. After discussing with colleagues from the BCI-Lift project, they have implemented the same idea for simulations under Matlab (a paper is under publication).\r\n\r\n**Example:**\r\n\r\nSeveral kinds of experiments can be simulated, as long as the user understand that the lists of parameters must have the same order. For example, I want to simulate the recordings of an auditory p300 speller with 10 dipoles, 5 on the left and 5 on the right auditory cortex, and on one of these dipoles I want to put a sinusoid. Among others, I have to  input the following (bold for the Simulation object, italics for the simulation function):\r\n\r\n**Label**   =   Aud-rh X 5, Aud-lh X 5\r\n**Waveform** = P300_nontarget, P300_target, P300_nontarget, P300_target, P300_nontarget, P300_target, P300_nontarget, P300_target, P300_nontarget, sin\r\n**Waveform time window** = array from 0 to 0.5 sec\r\n_Event_ = nontarget_stimuli, target_stimuli, nontarget_stimuli, target_stimuli, nontarget_stimuli, target_stimuli, nontarget_stimuli, target_stimuli, nontarget_stimuli, target_stimuli\r\n\r\nAnd here is the code you can run to check out how it works:\r\n```\r\n\"\"\"\r\nSimulation example of two p300 speller experiments.\r\nThe differences are the events simulated, and the noise\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport mne\r\nfrom mne.forward import convert_forward_solution\r\n\r\nfrom mne import (read_forward_solution, pick_types_forward, read_label,\r\n                 pick_types, make_custom_cov)\r\nfrom mne.simulation import Simulation, simulate_raw_signal, waveforms\r\nfrom mne.datasets import sample\r\n\r\n# Load a sample forward solution\r\n# Forward solution should have fixed orientation\r\ndata_path = sample.data_path()\r\n\r\nfwd_fname = data_path + '/MEG/sample/sample_audvis-meg-eeg-oct-6-fwd.fif'\r\nfwd = read_forward_solution(fwd_fname)\r\nfwd = pick_types_forward(fwd, meg=True, eeg=True)\r\nfwd = convert_forward_solution(fwd, surf_ori=True, force_fixed=True,\r\n                               use_cps=True)\r\n\r\n\r\n# Create the simulation type. This only needs to be generated once, since the\r\n# simulated experiment is the same. \r\n# The simulation will include 10 dipoles, 5 on the left auditory and 5 on the \r\n# right, at random positions.\r\n\r\nn_dipoles = 10\r\n\r\nlabel_names = ['Aud-lh', 'Aud-rh']\r\nlabels = [read_label(data_path + '/MEG/sample/labels/%s.label' % ln)\r\n          for ln in label_names]\r\n\r\n# each dipole will simulate a different waveform.\r\n# A sinusoide has been added to the last dipole.\r\nlabels = [labels[0]]*5 + [labels[1]]*5\r\n\r\nwaveforms = ['p300_target', 'p300_nontarget' ,'p300_target', 'p300_nontarget',\r\n             'p300_target', 'p300_target', 'p300_nontarget' ,'p300_target', \r\n             'p300_nontarget', 'sin']\r\n\r\n# Only one time window needs to be defined since it will be the same for all \r\n# waveforms (except the sinusoide, but this will be defined through the event matrix)\r\nfreq = 256\r\ntime_window_duration = 0.5 #(sec) \r\nwindow_times=np.arange(0.,time_window_duration,1./freq)\r\n\r\nsim = Simulation(fwd, n_dipoles=n_dipoles, labels=labels, waveform=waveforms,\r\n                 window_times=window_times)\r\n\r\n# Functions to generate events that are specific to a p300 speller experiment\r\ndef get_events_array(stim_channel, n_sample, label):\r\n    events = np.zeros((n_sample, 3))\r\n    events[:,0] = np.array(np.squeeze(np.argwhere(stim_channel == 1)))\r\n    events[:,2] = label\r\n    return np.array(events)\r\n\r\n\r\ndef generate_p300speller_events(times, freq, interval = 0.3, ratio = 6):    \r\n    \"\"\" Generate events that simulate a p300 experiment\"\"\"\r\n    stim_channel_target = np.zeros((len(times)))\r\n    stim_channel_nontarget = np.zeros((len(times)))\r\n\r\n    counter, n_target, n_nontarget = (0, 0, 0)\r\n\r\n    for i in range(1,len(times),int(np.ceil(freq*interval))):\r\n        if counter==0:\r\n            target = np.random.randint(0,ratio)\r\n        if counter == target:\r\n            stim_channel_target[i] = 1\r\n            n_target += 1\r\n        else:\r\n            stim_channel_nontarget[i] = 1\r\n            n_nontarget += 1\r\n        counter += 1\r\n        if counter == ratio:\r\n            counter = 0\r\n    \r\n    events_target = get_events_array(stim_channel_target, n_target, 1)\r\n    events_nontarget = get_events_array(stim_channel_nontarget, n_nontarget, 2)\r\n\r\n\r\n    return np.array(events_target), np.array(events_nontarget)\r\n\r\n# Experiment Parameters\r\n\r\nexperiment_duration = 60 #(sec)\r\ntimes = np.arange(0.,experiment_duration,1./freq)\r\n\r\n# Noise parameters \r\n\r\nchnames = sim['info']['ch_names']\r\nn_eeg = len(pick_types(sim['info'], meg=False, eeg=True))\r\nn_mag = len(pick_types(sim['info'], meg='mag', eeg=False))\r\nn_grad = len(pick_types(sim['info'], meg='grad', eeg=False))\r\n\r\n\r\nrng = np.random.RandomState(41)\r\nevents_p300_target, events_p300_nontarget = generate_p300speller_events(times, freq, interval = 0.4)\r\n\r\nevents_p300=[]\r\n\r\n#By adding \"None\" for the sinusoide, we make sure that it will be generated for the entire duration\r\nfor w in waveforms:\r\n    if w == 'p300_target':\r\n        events_p300.append(events_p300_target)\r\n    elif w == 'p300_nontarget':\r\n        events_p300.append(events_p300_nontarget)\r\n    else:\r\n        events_p300.append(None)\r\n\r\n# We will make two experiments with diferent kinds of noise\r\nstandard_deviations = dict(eeg=[0.8e-6]*n_eeg, grad=[2e-13]*n_grad, mag=[5e-15]*n_mag)\r\ncov1 = make_custom_cov(sim['info'], standard_deviations)\r\nstandard_deviations = dict(eeg=[1.3e-6]*n_eeg, grad=[11e-13]*n_grad, mag=[26e-15]*n_mag)\r\ncov2 = make_custom_cov(sim['info'], standard_deviations)\r\n\r\n\r\n# Simulating two experiments\r\nraw1 = simulate_raw_signal(sim, times, cov1, events_p300, verbose=False)\r\nraw2 = simulate_raw_signal(sim, times, cov2, events_p300, verbose=False)\r\n\r\n\r\n# Now create epochs out of the raw data\r\nevent_id = dict(target=1, nontarget=2)  # event trigger and conditions\r\ntmin = 0  # start of each epoch (trigger)\r\ntmax = time_window_duration  # end of each epoch (600ms after the trigger)\r\n\r\ndef plot_experiment_data(raw):\r\n    events = mne.find_events(raw, stim_channel=\"STI 014\")\r\n    epochs = mne.Epochs(raw, events, event_id, tmin, tmax,\r\n                        baseline=None, reject=None, preload=True)\r\n\r\n    epochs.plot(show=True)\r\n    evoked = epochs['target'].average()\r\n    evoked.plot(show=True)\r\n    evoked = epochs['nontarget'].average()\r\n    evoked.plot(show=True)\r\n\r\nplot_experiment_data(raw1)\r\nplot_experiment_data(raw2)\r\n```\r\n","created_at":"2018-03-29T15:33:20Z","updated_at":"2018-03-29T15:44:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"609c085ba451b4b35a11b2dc4f05faaaa45d6d76","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/5059/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/5059/comments","review_comment_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/issues/5059/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/e510db2b741fdedd972f36f2d4d81e170e1405d4","head":{"label":"ngayraud:simulate-signal","ref":"simulate-signal","sha":"e510db2b741fdedd972f36f2d4d81e170e1405d4","user":{"login":"ngayraud","id":18072563,"avatar_url":"https://avatars0.githubusercontent.com/u/18072563?v=4","gravatar_id":"","url":"https://api.github.com/users/ngayraud","html_url":"https://github.com/ngayraud","followers_url":"https://api.github.com/users/ngayraud/followers","following_url":"https://api.github.com/users/ngayraud/following{/other_user}","gists_url":"https://api.github.com/users/ngayraud/gists{/gist_id}","starred_url":"https://api.github.com/users/ngayraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngayraud/subscriptions","organizations_url":"https://api.github.com/users/ngayraud/orgs","repos_url":"https://api.github.com/users/ngayraud/repos","events_url":"https://api.github.com/users/ngayraud/events{/privacy}","received_events_url":"https://api.github.com/users/ngayraud/received_events","type":"User","site_admin":false},"repo":{"id":120645128,"name":"mne-python","full_name":"ngayraud/mne-python","owner":{"login":"ngayraud","id":18072563,"avatar_url":"https://avatars0.githubusercontent.com/u/18072563?v=4","gravatar_id":"","url":"https://api.github.com/users/ngayraud","html_url":"https://github.com/ngayraud","followers_url":"https://api.github.com/users/ngayraud/followers","following_url":"https://api.github.com/users/ngayraud/following{/other_user}","gists_url":"https://api.github.com/users/ngayraud/gists{/gist_id}","starred_url":"https://api.github.com/users/ngayraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngayraud/subscriptions","organizations_url":"https://api.github.com/users/ngayraud/orgs","repos_url":"https://api.github.com/users/ngayraud/repos","events_url":"https://api.github.com/users/ngayraud/events{/privacy}","received_events_url":"https://api.github.com/users/ngayraud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngayraud/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":true,"url":"https://api.github.com/repos/ngayraud/mne-python","forks_url":"https://api.github.com/repos/ngayraud/mne-python/forks","keys_url":"https://api.github.com/repos/ngayraud/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngayraud/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngayraud/mne-python/teams","hooks_url":"https://api.github.com/repos/ngayraud/mne-python/hooks","issue_events_url":"https://api.github.com/repos/ngayraud/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/ngayraud/mne-python/events","assignees_url":"https://api.github.com/repos/ngayraud/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/ngayraud/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/ngayraud/mne-python/tags","blobs_url":"https://api.github.com/repos/ngayraud/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngayraud/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngayraud/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngayraud/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngayraud/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/ngayraud/mne-python/languages","stargazers_url":"https://api.github.com/repos/ngayraud/mne-python/stargazers","contributors_url":"https://api.github.com/repos/ngayraud/mne-python/contributors","subscribers_url":"https://api.github.com/repos/ngayraud/mne-python/subscribers","subscription_url":"https://api.github.com/repos/ngayraud/mne-python/subscription","commits_url":"https://api.github.com/repos/ngayraud/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngayraud/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngayraud/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngayraud/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/ngayraud/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/ngayraud/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngayraud/mne-python/merges","archive_url":"https://api.github.com/repos/ngayraud/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngayraud/mne-python/downloads","issues_url":"https://api.github.com/repos/ngayraud/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/ngayraud/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/ngayraud/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/ngayraud/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngayraud/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/ngayraud/mne-python/releases{/id}","deployments_url":"https://api.github.com/repos/ngayraud/mne-python/deployments","created_at":"2018-02-07T17:05:02Z","updated_at":"2018-03-29T14:21:53Z","pushed_at":"2018-03-29T14:45:59Z","git_url":"git://github.com/ngayraud/mne-python.git","ssh_url":"git@github.com:ngayraud/mne-python.git","clone_url":"https://github.com/ngayraud/mne-python.git","svn_url":"https://github.com/ngayraud/mne-python","homepage":"http://martinos.org/mne/","size":98635,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mne-tools:master","ref":"master","sha":"36446621d6e001ddf21fe850bf8d42ad59035930","user":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars3.githubusercontent.com/u/583875?v=4","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"repo":{"id":1301584,"name":"mne-python","full_name":"mne-tools/mne-python","owner":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars3.githubusercontent.com/u/583875?v=4","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mne-tools/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":false,"url":"https://api.github.com/repos/mne-tools/mne-python","forks_url":"https://api.github.com/repos/mne-tools/mne-python/forks","keys_url":"https://api.github.com/repos/mne-tools/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mne-tools/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mne-tools/mne-python/teams","hooks_url":"https://api.github.com/repos/mne-tools/mne-python/hooks","issue_events_url":"https://api.github.com/repos/mne-tools/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/mne-tools/mne-python/events","assignees_url":"https://api.github.com/repos/mne-tools/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/mne-tools/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/mne-tools/mne-python/tags","blobs_url":"https://api.github.com/repos/mne-tools/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mne-tools/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mne-tools/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/mne-tools/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/mne-tools/mne-python/languages","stargazers_url":"https://api.github.com/repos/mne-tools/mne-python/stargazers","contributors_url":"https://api.github.com/repos/mne-tools/mne-python/contributors","subscribers_url":"https://api.github.com/repos/mne-tools/mne-python/subscribers","subscription_url":"https://api.github.com/repos/mne-tools/mne-python/subscription","commits_url":"https://api.github.com/repos/mne-tools/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/mne-tools/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/mne-tools/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/mne-tools/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/mne-tools/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mne-tools/mne-python/merges","archive_url":"https://api.github.com/repos/mne-tools/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mne-tools/mne-python/downloads","issues_url":"https://api.github.com/repos/mne-tools/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/mne-tools/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/mne-tools/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/mne-tools/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mne-tools/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/mne-tools/mne-python/releases{/id}","deployments_url":"https://api.github.com/repos/mne-tools/mne-python/deployments","created_at":"2011-01-28T03:31:13Z","updated_at":"2018-03-29T14:25:06Z","pushed_at":"2018-03-29T15:33:21Z","git_url":"git://github.com/mne-tools/mne-python.git","ssh_url":"git@github.com:mne-tools/mne-python.git","clone_url":"https://github.com/mne-tools/mne-python.git","svn_url":"https://github.com/mne-tools/mne-python","homepage":"http://martinos.org/mne/","size":98688,"stargazers_count":430,"watchers_count":430,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":383,"mirror_url":null,"archived":false,"open_issues_count":274,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":383,"open_issues":274,"watchers":430,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/5059"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/5059"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/5059"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/5059/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/5059/comments"},"review_comment":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/5059/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/e510db2b741fdedd972f36f2d4d81e170e1405d4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"agramfort"}}