{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/191261581","pull_request_review_id":123798698,"id":191261581,"diff_hunk":"@@ -1045,9 +1046,16 @@ def create_filter(data, sfreq, l_freq, h_freq, filter_length='auto',\n \n     .. versionadded:: 0.14\n     \"\"\"\n-    sfreq = float(sfreq)\n-    if sfreq < 0:\n+    if sfreq is None or float(sfreq) < 0:\n         raise ValueError('sfreq must be positive')\n+    else:\n+        sfreq = float(sfreq)\n+    # If no data specified, sanity checking is invalid\n+    # perform it on a dummy array that is long enough to never fail sanity\n+    # checks\n+    if data is None:\n+        logger.info('No data specified. No sanity checks performed.')\n+        data = np.empty(int(sfreq ** 2))","path":"mne/filter.py","position":43,"original_position":43,"commit_id":"0cee737ce27c47c1d1c142492f5db6a680ec7a9a","original_commit_id":"0cee737ce27c47c1d1c142492f5db6a680ec7a9a","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":"I suspect you can actually avoid creating an array for nothing here no?","created_at":"2018-05-28T19:19:36Z","updated_at":"2018-05-28T19:19:36Z","html_url":"https://github.com/mne-tools/mne-python/pull/5232#discussion_r191261581","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/5232","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/191261581"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/5232#discussion_r191261581"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/5232"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/5232","id":190923183,"html_url":"https://github.com/mne-tools/mne-python/pull/5232","diff_url":"https://github.com/mne-tools/mne-python/pull/5232.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/5232.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/5232","number":5232,"state":"open","locked":false,"title":"allow data=None in filter.create_filter","user":{"login":"sappelhoff","id":9084751,"avatar_url":"https://avatars1.githubusercontent.com/u/9084751?v=4","gravatar_id":"","url":"https://api.github.com/users/sappelhoff","html_url":"https://github.com/sappelhoff","followers_url":"https://api.github.com/users/sappelhoff/followers","following_url":"https://api.github.com/users/sappelhoff/following{/other_user}","gists_url":"https://api.github.com/users/sappelhoff/gists{/gist_id}","starred_url":"https://api.github.com/users/sappelhoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sappelhoff/subscriptions","organizations_url":"https://api.github.com/users/sappelhoff/orgs","repos_url":"https://api.github.com/users/sappelhoff/repos","events_url":"https://api.github.com/users/sappelhoff/events{/privacy}","received_events_url":"https://api.github.com/users/sappelhoff/received_events","type":"User","site_admin":false},"body":"This PR is part of a bunch of issues around the reporting of filters, see #5226 .\r\n\r\nAddressing the comment by @larsoner:\r\n\r\n> mne.filter.create_filter will create the filter and give these log messages. You can pass it a dummy data array. Actually we should proably make data=None a possibility, meaning \"skip length checks/warnings\".","created_at":"2018-05-28T12:52:18Z","updated_at":"2018-05-28T19:19:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05de7b94cd1337ab4fa93b043f4b5652a088d5be","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/5232/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/5232/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/5232/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/0cee737ce27c47c1d1c142492f5db6a680ec7a9a","head":{"label":"sappelhoff:report_filters","ref":"report_filters","sha":"0cee737ce27c47c1d1c142492f5db6a680ec7a9a","user":{"login":"sappelhoff","id":9084751,"avatar_url":"https://avatars1.githubusercontent.com/u/9084751?v=4","gravatar_id":"","url":"https://api.github.com/users/sappelhoff","html_url":"https://github.com/sappelhoff","followers_url":"https://api.github.com/users/sappelhoff/followers","following_url":"https://api.github.com/users/sappelhoff/following{/other_user}","gists_url":"https://api.github.com/users/sappelhoff/gists{/gist_id}","starred_url":"https://api.github.com/users/sappelhoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sappelhoff/subscriptions","organizations_url":"https://api.github.com/users/sappelhoff/orgs","repos_url":"https://api.github.com/users/sappelhoff/repos","events_url":"https://api.github.com/users/sappelhoff/events{/privacy}","received_events_url":"https://api.github.com/users/sappelhoff/received_events","type":"User","site_admin":false},"repo":{"id":124230273,"name":"mne-python","full_name":"sappelhoff/mne-python","owner":{"login":"sappelhoff","id":9084751,"avatar_url":"https://avatars1.githubusercontent.com/u/9084751?v=4","gravatar_id":"","url":"https://api.github.com/users/sappelhoff","html_url":"https://github.com/sappelhoff","followers_url":"https://api.github.com/users/sappelhoff/followers","following_url":"https://api.github.com/users/sappelhoff/following{/other_user}","gists_url":"https://api.github.com/users/sappelhoff/gists{/gist_id}","starred_url":"https://api.github.com/users/sappelhoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sappelhoff/subscriptions","organizations_url":"https://api.github.com/users/sappelhoff/orgs","repos_url":"https://api.github.com/users/sappelhoff/repos","events_url":"https://api.github.com/users/sappelhoff/events{/privacy}","received_events_url":"https://api.github.com/users/sappelhoff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sappelhoff/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":true,"url":"https://api.github.com/repos/sappelhoff/mne-python","forks_url":"https://api.github.com/repos/sappelhoff/mne-python/forks","keys_url":"https://api.github.com/repos/sappelhoff/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sappelhoff/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sappelhoff/mne-python/teams","hooks_url":"https://api.github.com/repos/sappelhoff/mne-python/hooks","issue_events_url":"https://api.github.com/repos/sappelhoff/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/sappelhoff/mne-python/events","assignees_url":"https://api.github.com/repos/sappelhoff/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/sappelhoff/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/sappelhoff/mne-python/tags","blobs_url":"https://api.github.com/repos/sappelhoff/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sappelhoff/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sappelhoff/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/sappelhoff/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sappelhoff/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/sappelhoff/mne-python/languages","stargazers_url":"https://api.github.com/repos/sappelhoff/mne-python/stargazers","contributors_url":"https://api.github.com/repos/sappelhoff/mne-python/contributors","subscribers_url":"https://api.github.com/repos/sappelhoff/mne-python/subscribers","subscription_url":"https://api.github.com/repos/sappelhoff/mne-python/subscription","commits_url":"https://api.github.com/repos/sappelhoff/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/sappelhoff/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/sappelhoff/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/sappelhoff/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/sappelhoff/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/sappelhoff/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sappelhoff/mne-python/merges","archive_url":"https://api.github.com/repos/sappelhoff/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sappelhoff/mne-python/downloads","issues_url":"https://api.github.com/repos/sappelhoff/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/sappelhoff/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/sappelhoff/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/sappelhoff/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sappelhoff/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/sappelhoff/mne-python/releases{/id}","deployments_url":"https://api.github.com/repos/sappelhoff/mne-python/deployments","created_at":"2018-03-07T12:05:45Z","updated_at":"2018-05-24T06:59:09Z","pushed_at":"2018-05-28T19:18:49Z","git_url":"git://github.com/sappelhoff/mne-python.git","ssh_url":"git@github.com:sappelhoff/mne-python.git","clone_url":"https://github.com/sappelhoff/mne-python.git","svn_url":"https://github.com/sappelhoff/mne-python","homepage":"http://martinos.org/mne/","size":99960,"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":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mne-tools:master","ref":"master","sha":"45898628a416691a89a8d48ca38860298cfb58fc","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-05-28T18:50:53Z","pushed_at":"2018-05-28T19:18:50Z","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":99929,"stargazers_count":467,"watchers_count":467,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":400,"mirror_url":null,"archived":false,"open_issues_count":245,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":400,"open_issues":245,"watchers":467,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/5232"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/5232"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/5232"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/5232/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/5232/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/5232/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/0cee737ce27c47c1d1c142492f5db6a680ec7a9a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"agramfort"}}