{"action":"created","comment":{"url":"https://api.github.com/repos/obspy/obspy/pulls/comments/97992482","pull_request_review_id":18619796,"id":97992482,"diff_hunk":"@@ -1485,6 +1485,22 @@ def test_split(self):\n         self.assertFalse(isinstance(st[0].data, np.ma.masked_array))\n         self.assertFalse(isinstance(st[1].data, np.ma.masked_array))\n \n+    def test_split_empty_masked_array(self):\n+        \"\"\"\n+        Test split method with a masked array without any data.\n+        \"\"\"\n+        tr1 = Trace(data=np.arange(1000))\n+        tr2 = Trace(data=np.arange(1000, 2000))\n+        trace = tr1 + tr2","path":"obspy/core/tests/test_trace.py","position":10,"original_position":10,"commit_id":"c219411ddf69bd3703442207df482d8a6517a259","original_commit_id":"c219411ddf69bd3703442207df482d8a6517a259","user":{"login":"krischer","id":800487,"avatar_url":"https://avatars.githubusercontent.com/u/800487?v=3","gravatar_id":"","url":"https://api.github.com/users/krischer","html_url":"https://github.com/krischer","followers_url":"https://api.github.com/users/krischer/followers","following_url":"https://api.github.com/users/krischer/following{/other_user}","gists_url":"https://api.github.com/users/krischer/gists{/gist_id}","starred_url":"https://api.github.com/users/krischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krischer/subscriptions","organizations_url":"https://api.github.com/users/krischer/orgs","repos_url":"https://api.github.com/users/krischer/repos","events_url":"https://api.github.com/users/krischer/events{/privacy}","received_events_url":"https://api.github.com/users/krischer/received_events","type":"User","site_admin":false},"body":"It would IMHO be clearer to directly initialize a Trace with a fully masked array, e.g.\r\n\r\n```python\r\ntr = Trace(data=np.ma.masked_all(100))\r\n```","created_at":"2017-01-26T13:28:03Z","updated_at":"2017-01-26T13:28:59Z","html_url":"https://github.com/obspy/obspy/pull/1650#discussion_r97992482","pull_request_url":"https://api.github.com/repos/obspy/obspy/pulls/1650","_links":{"self":{"href":"https://api.github.com/repos/obspy/obspy/pulls/comments/97992482"},"html":{"href":"https://github.com/obspy/obspy/pull/1650#discussion_r97992482"},"pull_request":{"href":"https://api.github.com/repos/obspy/obspy/pulls/1650"}}},"pull_request":{"url":"https://api.github.com/repos/obspy/obspy/pulls/1650","id":103150838,"html_url":"https://github.com/obspy/obspy/pull/1650","diff_url":"https://github.com/obspy/obspy/pull/1650.diff","patch_url":"https://github.com/obspy/obspy/pull/1650.patch","issue_url":"https://api.github.com/repos/obspy/obspy/issues/1650","number":1650,"state":"open","locked":false,"title":"Fix Trace splitting with empty masked array","user":{"login":"Brtle","id":19774452,"avatar_url":"https://avatars.githubusercontent.com/u/19774452?v=3","gravatar_id":"","url":"https://api.github.com/users/Brtle","html_url":"https://github.com/Brtle","followers_url":"https://api.github.com/users/Brtle/followers","following_url":"https://api.github.com/users/Brtle/following{/other_user}","gists_url":"https://api.github.com/users/Brtle/gists{/gist_id}","starred_url":"https://api.github.com/users/Brtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brtle/subscriptions","organizations_url":"https://api.github.com/users/Brtle/orgs","repos_url":"https://api.github.com/users/Brtle/repos","events_url":"https://api.github.com/users/Brtle/events{/privacy}","received_events_url":"https://api.github.com/users/Brtle/received_events","type":"User","site_admin":false},"body":"This is a little PR to fix the Trace splitting when there is no data in the masked array.\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/toto/.virtualenvs/obspy/lib/python3.5/site-packages/obspy/core/tests/test_trace.py\", line 1499, in test_split_empty_masked_array\r\n    st = trace.split()\r\n  File \"<decorator-gen-24>\", line 2, in split\r\n  File \"/home/toto/.virtualenvs/obspy/lib/python3.5/site-packages/obspy/core/trace.py\", line 231, in _add_processing_info\r\n    result = func(*args, **kwargs)\r\n  File \"/home/toto/.virtualenvs/obspy/lib/python3.5/site-packages/obspy/core/trace.py\", line 2227, in split\r\n    for slice in slices:\r\nTypeError: 'NoneType' object is not iterable\r\n```\r\n\r\nThe function `obspy.core.util.misc.flat_not_masked_contiguous` returns `None` instead of an empty list when there is no data, raising a `TypeError` in  `obspy.core.trace.Trace.split`.\r\n\r\nI added a unit test to cover this case.","created_at":"2017-01-25T16:14:09Z","updated_at":"2017-01-26T13:28:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"365f7f0bf1b5b6f27404500111f2e474163ffdb3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/obspy/obspy/pulls/1650/commits","review_comments_url":"https://api.github.com/repos/obspy/obspy/pulls/1650/comments","review_comment_url":"https://api.github.com/repos/obspy/obspy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/obspy/obspy/issues/1650/comments","statuses_url":"https://api.github.com/repos/obspy/obspy/statuses/c219411ddf69bd3703442207df482d8a6517a259","head":{"label":"Brtle:fix_empty_masked_array_splitting","ref":"fix_empty_masked_array_splitting","sha":"c219411ddf69bd3703442207df482d8a6517a259","user":{"login":"Brtle","id":19774452,"avatar_url":"https://avatars.githubusercontent.com/u/19774452?v=3","gravatar_id":"","url":"https://api.github.com/users/Brtle","html_url":"https://github.com/Brtle","followers_url":"https://api.github.com/users/Brtle/followers","following_url":"https://api.github.com/users/Brtle/following{/other_user}","gists_url":"https://api.github.com/users/Brtle/gists{/gist_id}","starred_url":"https://api.github.com/users/Brtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brtle/subscriptions","organizations_url":"https://api.github.com/users/Brtle/orgs","repos_url":"https://api.github.com/users/Brtle/repos","events_url":"https://api.github.com/users/Brtle/events{/privacy}","received_events_url":"https://api.github.com/users/Brtle/received_events","type":"User","site_admin":false},"repo":{"id":60854461,"name":"obspy","full_name":"Brtle/obspy","owner":{"login":"Brtle","id":19774452,"avatar_url":"https://avatars.githubusercontent.com/u/19774452?v=3","gravatar_id":"","url":"https://api.github.com/users/Brtle","html_url":"https://github.com/Brtle","followers_url":"https://api.github.com/users/Brtle/followers","following_url":"https://api.github.com/users/Brtle/following{/other_user}","gists_url":"https://api.github.com/users/Brtle/gists{/gist_id}","starred_url":"https://api.github.com/users/Brtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brtle/subscriptions","organizations_url":"https://api.github.com/users/Brtle/orgs","repos_url":"https://api.github.com/users/Brtle/repos","events_url":"https://api.github.com/users/Brtle/events{/privacy}","received_events_url":"https://api.github.com/users/Brtle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Brtle/obspy","description":"ObsPy: A Python Toolbox for seismology/seismological observatories.","fork":true,"url":"https://api.github.com/repos/Brtle/obspy","forks_url":"https://api.github.com/repos/Brtle/obspy/forks","keys_url":"https://api.github.com/repos/Brtle/obspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Brtle/obspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Brtle/obspy/teams","hooks_url":"https://api.github.com/repos/Brtle/obspy/hooks","issue_events_url":"https://api.github.com/repos/Brtle/obspy/issues/events{/number}","events_url":"https://api.github.com/repos/Brtle/obspy/events","assignees_url":"https://api.github.com/repos/Brtle/obspy/assignees{/user}","branches_url":"https://api.github.com/repos/Brtle/obspy/branches{/branch}","tags_url":"https://api.github.com/repos/Brtle/obspy/tags","blobs_url":"https://api.github.com/repos/Brtle/obspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Brtle/obspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Brtle/obspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Brtle/obspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Brtle/obspy/statuses/{sha}","languages_url":"https://api.github.com/repos/Brtle/obspy/languages","stargazers_url":"https://api.github.com/repos/Brtle/obspy/stargazers","contributors_url":"https://api.github.com/repos/Brtle/obspy/contributors","subscribers_url":"https://api.github.com/repos/Brtle/obspy/subscribers","subscription_url":"https://api.github.com/repos/Brtle/obspy/subscription","commits_url":"https://api.github.com/repos/Brtle/obspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Brtle/obspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Brtle/obspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Brtle/obspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Brtle/obspy/contents/{+path}","compare_url":"https://api.github.com/repos/Brtle/obspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Brtle/obspy/merges","archive_url":"https://api.github.com/repos/Brtle/obspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Brtle/obspy/downloads","issues_url":"https://api.github.com/repos/Brtle/obspy/issues{/number}","pulls_url":"https://api.github.com/repos/Brtle/obspy/pulls{/number}","milestones_url":"https://api.github.com/repos/Brtle/obspy/milestones{/number}","notifications_url":"https://api.github.com/repos/Brtle/obspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Brtle/obspy/labels{/name}","releases_url":"https://api.github.com/repos/Brtle/obspy/releases{/id}","deployments_url":"https://api.github.com/repos/Brtle/obspy/deployments","created_at":"2016-06-10T14:36:46Z","updated_at":"2016-06-10T14:36:52Z","pushed_at":"2017-01-26T10:20:44Z","git_url":"git://github.com/Brtle/obspy.git","ssh_url":"git@github.com:Brtle/obspy.git","clone_url":"https://github.com/Brtle/obspy.git","svn_url":"https://github.com/Brtle/obspy","homepage":"https://www.obspy.org","size":81520,"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":"obspy:master","ref":"master","sha":"81b3c37f8fed8a92e7350fcd91916f87f990bbf0","user":{"login":"obspy","id":1701221,"avatar_url":"https://avatars.githubusercontent.com/u/1701221?v=3","gravatar_id":"","url":"https://api.github.com/users/obspy","html_url":"https://github.com/obspy","followers_url":"https://api.github.com/users/obspy/followers","following_url":"https://api.github.com/users/obspy/following{/other_user}","gists_url":"https://api.github.com/users/obspy/gists{/gist_id}","starred_url":"https://api.github.com/users/obspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obspy/subscriptions","organizations_url":"https://api.github.com/users/obspy/orgs","repos_url":"https://api.github.com/users/obspy/repos","events_url":"https://api.github.com/users/obspy/events{/privacy}","received_events_url":"https://api.github.com/users/obspy/received_events","type":"Organization","site_admin":false},"repo":{"id":5731348,"name":"obspy","full_name":"obspy/obspy","owner":{"login":"obspy","id":1701221,"avatar_url":"https://avatars.githubusercontent.com/u/1701221?v=3","gravatar_id":"","url":"https://api.github.com/users/obspy","html_url":"https://github.com/obspy","followers_url":"https://api.github.com/users/obspy/followers","following_url":"https://api.github.com/users/obspy/following{/other_user}","gists_url":"https://api.github.com/users/obspy/gists{/gist_id}","starred_url":"https://api.github.com/users/obspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obspy/subscriptions","organizations_url":"https://api.github.com/users/obspy/orgs","repos_url":"https://api.github.com/users/obspy/repos","events_url":"https://api.github.com/users/obspy/events{/privacy}","received_events_url":"https://api.github.com/users/obspy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/obspy/obspy","description":"ObsPy: A Python Toolbox for seismology/seismological observatories.","fork":false,"url":"https://api.github.com/repos/obspy/obspy","forks_url":"https://api.github.com/repos/obspy/obspy/forks","keys_url":"https://api.github.com/repos/obspy/obspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/obspy/obspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/obspy/obspy/teams","hooks_url":"https://api.github.com/repos/obspy/obspy/hooks","issue_events_url":"https://api.github.com/repos/obspy/obspy/issues/events{/number}","events_url":"https://api.github.com/repos/obspy/obspy/events","assignees_url":"https://api.github.com/repos/obspy/obspy/assignees{/user}","branches_url":"https://api.github.com/repos/obspy/obspy/branches{/branch}","tags_url":"https://api.github.com/repos/obspy/obspy/tags","blobs_url":"https://api.github.com/repos/obspy/obspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/obspy/obspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/obspy/obspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/obspy/obspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/obspy/obspy/statuses/{sha}","languages_url":"https://api.github.com/repos/obspy/obspy/languages","stargazers_url":"https://api.github.com/repos/obspy/obspy/stargazers","contributors_url":"https://api.github.com/repos/obspy/obspy/contributors","subscribers_url":"https://api.github.com/repos/obspy/obspy/subscribers","subscription_url":"https://api.github.com/repos/obspy/obspy/subscription","commits_url":"https://api.github.com/repos/obspy/obspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/obspy/obspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/obspy/obspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/obspy/obspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/obspy/obspy/contents/{+path}","compare_url":"https://api.github.com/repos/obspy/obspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/obspy/obspy/merges","archive_url":"https://api.github.com/repos/obspy/obspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/obspy/obspy/downloads","issues_url":"https://api.github.com/repos/obspy/obspy/issues{/number}","pulls_url":"https://api.github.com/repos/obspy/obspy/pulls{/number}","milestones_url":"https://api.github.com/repos/obspy/obspy/milestones{/number}","notifications_url":"https://api.github.com/repos/obspy/obspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/obspy/obspy/labels{/name}","releases_url":"https://api.github.com/repos/obspy/obspy/releases{/id}","deployments_url":"https://api.github.com/repos/obspy/obspy/deployments","created_at":"2012-09-08T19:17:46Z","updated_at":"2017-01-24T13:17:27Z","pushed_at":"2017-01-26T10:47:27Z","git_url":"git://github.com/obspy/obspy.git","ssh_url":"git@github.com:obspy/obspy.git","clone_url":"https://github.com/obspy/obspy.git","svn_url":"https://github.com/obspy/obspy","homepage":"https://www.obspy.org","size":81657,"stargazers_count":258,"watchers_count":258,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":184,"mirror_url":null,"open_issues_count":204,"forks":184,"open_issues":204,"watchers":258,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/obspy/obspy/pulls/1650"},"html":{"href":"https://github.com/obspy/obspy/pull/1650"},"issue":{"href":"https://api.github.com/repos/obspy/obspy/issues/1650"},"comments":{"href":"https://api.github.com/repos/obspy/obspy/issues/1650/comments"},"review_comments":{"href":"https://api.github.com/repos/obspy/obspy/pulls/1650/comments"},"review_comment":{"href":"https://api.github.com/repos/obspy/obspy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/obspy/obspy/pulls/1650/commits"},"statuses":{"href":"https://api.github.com/repos/obspy/obspy/statuses/c219411ddf69bd3703442207df482d8a6517a259"}}}}
{"actor":{"display_login":"krischer"}}