{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/68844406","id":68844406,"diff_hunk":"@@ -109,25 +109,32 @@ def define_target_events(events, reference_id, target_id, sfreq, tmin, tmax,\n     lag : ndarray\n         time lag between reference and target in milliseconds.\n     \"\"\"\n+    \n+    if isinstance(reference_ids, int):\n+        reference_ids = [reference_ids]\n \n-    if new_id is None:\n-        new_id = reference_id\n+    if isinstance(target_ids, int):\n+        target_ids = [target_ids]\n \n     tsample = 1e3 / sfreq\n     imin = int(tmin * sfreq)\n     imax = int(tmax * sfreq)\n \n     new_events = []\n     lag = []\n+\n     for event in events.copy().astype(int):\n-        if event[2] == reference_id:\n+        if event[2] in reference_ids:\n             lower = event[0] + imin\n             upper = event[0] + imax\n+            matching_events = np.any([events[:, 2] == target for target in targets_ids])","path":"mne/event.py","position":57,"original_position":57,"commit_id":"58ab32f1dc2a740bc1ff06d8374a50cde3530642","original_commit_id":"58ab32f1dc2a740bc1ff06d8374a50cde3530642","user":{"login":"dengemann","id":1908618,"avatar_url":"https://avatars.githubusercontent.com/u/1908618?v=3","gravatar_id":"","url":"https://api.github.com/users/dengemann","html_url":"https://github.com/dengemann","followers_url":"https://api.github.com/users/dengemann/followers","following_url":"https://api.github.com/users/dengemann/following{/other_user}","gists_url":"https://api.github.com/users/dengemann/gists{/gist_id}","starred_url":"https://api.github.com/users/dengemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dengemann/subscriptions","organizations_url":"https://api.github.com/users/dengemann/orgs","repos_url":"https://api.github.com/users/dengemann/repos","events_url":"https://api.github.com/users/dengemann/events{/privacy}","received_events_url":"https://api.github.com/users/dengemann/received_events","type":"User","site_admin":false},"body":"yes, this is a good idea.","created_at":"2016-06-28T21:12:15Z","updated_at":"2016-06-28T21:12:15Z","html_url":"https://github.com/mne-tools/mne-python/pull/3285#discussion_r68844406","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/3285","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/68844406"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/3285#discussion_r68844406"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/3285"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/3285","id":72699354,"html_url":"https://github.com/mne-tools/mne-python/pull/3285","diff_url":"https://github.com/mne-tools/mne-python/pull/3285.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/3285.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/3285","number":3285,"state":"open","locked":false,"title":"[WIP/ENH] Allows list of references and/or targets in define_target_events","user":{"login":"claire-braboszcz","id":914741,"avatar_url":"https://avatars.githubusercontent.com/u/914741?v=3","gravatar_id":"","url":"https://api.github.com/users/claire-braboszcz","html_url":"https://github.com/claire-braboszcz","followers_url":"https://api.github.com/users/claire-braboszcz/followers","following_url":"https://api.github.com/users/claire-braboszcz/following{/other_user}","gists_url":"https://api.github.com/users/claire-braboszcz/gists{/gist_id}","starred_url":"https://api.github.com/users/claire-braboszcz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claire-braboszcz/subscriptions","organizations_url":"https://api.github.com/users/claire-braboszcz/orgs","repos_url":"https://api.github.com/users/claire-braboszcz/repos","events_url":"https://api.github.com/users/claire-braboszcz/events{/privacy}","received_events_url":"https://api.github.com/users/claire-braboszcz/received_events","type":"User","site_admin":false},"body":"Modifying the function define_target_events so it can accept lists as arguments (for example when you have multiple names coding for  events/responses and want to select events by response time).\r\nFor now it works only if new_id is defined.\r\nIt also passes the current test (with single int as value for reference and target) but a new one with lists as argument still has to be defined.\r\nI'm fairly new to python so any advice/comment is welcome :-)","created_at":"2016-06-06T12:14:16Z","updated_at":"2016-06-28T21:12:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1252a40f9ea00706f26c11ff226dbf781ed7079","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/3285/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/3285/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/3285/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/58ab32f1dc2a740bc1ff06d8374a50cde3530642","head":{"label":"claire-braboszcz:list-for-define-event","ref":"list-for-define-event","sha":"58ab32f1dc2a740bc1ff06d8374a50cde3530642","user":{"login":"claire-braboszcz","id":914741,"avatar_url":"https://avatars.githubusercontent.com/u/914741?v=3","gravatar_id":"","url":"https://api.github.com/users/claire-braboszcz","html_url":"https://github.com/claire-braboszcz","followers_url":"https://api.github.com/users/claire-braboszcz/followers","following_url":"https://api.github.com/users/claire-braboszcz/following{/other_user}","gists_url":"https://api.github.com/users/claire-braboszcz/gists{/gist_id}","starred_url":"https://api.github.com/users/claire-braboszcz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claire-braboszcz/subscriptions","organizations_url":"https://api.github.com/users/claire-braboszcz/orgs","repos_url":"https://api.github.com/users/claire-braboszcz/repos","events_url":"https://api.github.com/users/claire-braboszcz/events{/privacy}","received_events_url":"https://api.github.com/users/claire-braboszcz/received_events","type":"User","site_admin":false},"repo":{"id":60376796,"name":"mne-python","full_name":"claire-braboszcz/mne-python","owner":{"login":"claire-braboszcz","id":914741,"avatar_url":"https://avatars.githubusercontent.com/u/914741?v=3","gravatar_id":"","url":"https://api.github.com/users/claire-braboszcz","html_url":"https://github.com/claire-braboszcz","followers_url":"https://api.github.com/users/claire-braboszcz/followers","following_url":"https://api.github.com/users/claire-braboszcz/following{/other_user}","gists_url":"https://api.github.com/users/claire-braboszcz/gists{/gist_id}","starred_url":"https://api.github.com/users/claire-braboszcz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claire-braboszcz/subscriptions","organizations_url":"https://api.github.com/users/claire-braboszcz/orgs","repos_url":"https://api.github.com/users/claire-braboszcz/repos","events_url":"https://api.github.com/users/claire-braboszcz/events{/privacy}","received_events_url":"https://api.github.com/users/claire-braboszcz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/claire-braboszcz/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":true,"url":"https://api.github.com/repos/claire-braboszcz/mne-python","forks_url":"https://api.github.com/repos/claire-braboszcz/mne-python/forks","keys_url":"https://api.github.com/repos/claire-braboszcz/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/claire-braboszcz/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/claire-braboszcz/mne-python/teams","hooks_url":"https://api.github.com/repos/claire-braboszcz/mne-python/hooks","issue_events_url":"https://api.github.com/repos/claire-braboszcz/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/claire-braboszcz/mne-python/events","assignees_url":"https://api.github.com/repos/claire-braboszcz/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/claire-braboszcz/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/claire-braboszcz/mne-python/tags","blobs_url":"https://api.github.com/repos/claire-braboszcz/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/claire-braboszcz/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/claire-braboszcz/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/claire-braboszcz/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/claire-braboszcz/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/claire-braboszcz/mne-python/languages","stargazers_url":"https://api.github.com/repos/claire-braboszcz/mne-python/stargazers","contributors_url":"https://api.github.com/repos/claire-braboszcz/mne-python/contributors","subscribers_url":"https://api.github.com/repos/claire-braboszcz/mne-python/subscribers","subscription_url":"https://api.github.com/repos/claire-braboszcz/mne-python/subscription","commits_url":"https://api.github.com/repos/claire-braboszcz/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/claire-braboszcz/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/claire-braboszcz/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/claire-braboszcz/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/claire-braboszcz/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/claire-braboszcz/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/claire-braboszcz/mne-python/merges","archive_url":"https://api.github.com/repos/claire-braboszcz/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/claire-braboszcz/mne-python/downloads","issues_url":"https://api.github.com/repos/claire-braboszcz/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/claire-braboszcz/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/claire-braboszcz/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/claire-braboszcz/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/claire-braboszcz/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/claire-braboszcz/mne-python/releases{/id}","deployments_url":"https://api.github.com/repos/claire-braboszcz/mne-python/deployments","created_at":"2016-06-03T20:48:45Z","updated_at":"2016-06-03T20:48:49Z","pushed_at":"2016-06-06T22:49:32Z","git_url":"git://github.com/claire-braboszcz/mne-python.git","ssh_url":"git@github.com:claire-braboszcz/mne-python.git","clone_url":"https://github.com/claire-braboszcz/mne-python.git","svn_url":"https://github.com/claire-braboszcz/mne-python","homepage":"http://martinos.org/mne/","size":86230,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mne-tools:master","ref":"master","sha":"81bdd0f2f96e70d0628bd47d3c81540d75e052cb","user":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars.githubusercontent.com/u/583875?v=3","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://avatars.githubusercontent.com/u/583875?v=3","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":"2016-06-26T02:34:24Z","pushed_at":"2016-06-28T19:25:28Z","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":178830,"stargazers_count":211,"watchers_count":211,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":203,"mirror_url":null,"open_issues_count":201,"forks":203,"open_issues":201,"watchers":211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/3285"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/3285"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/3285"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/3285/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/3285/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/3285/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/58ab32f1dc2a740bc1ff06d8374a50cde3530642"}}}}
{"actor":{"display_login":"dengemann"}}