{"action":"created","comment":{"url":"https://api.github.com/repos/nipy/nibabel/pulls/comments/54675021","id":54675021,"diff_hunk":"@@ -92,6 +94,32 @@ def test_morph_data():\n     curv = read_morph_data(curv_path)\n     assert_true(-1.0 < curv.min() < 0)\n     assert_true(0 < curv.max() < 1.0)\n+    with InTemporaryDirectory():\n+        new_path = 'test'\n+        write_morph_data(new_path, curv)\n+        curv2 = read_morph_data(new_path)\n+        assert_equal(curv2, curv)\n+\n+\n+def test_write_morph_data():\n+    \"\"\"Test write_morph_data edge cases\"\"\"\n+    values = np.arange(20, dtype='>f4')\n+    okay_shapes = [(20,), (20, 1), (20, 1, 1), (1, 20)]\n+    bad_shapes = [(10, 2), (1, 1, 20, 1, 1)]\n+    big_num = np.iinfo('i4').max + 1\n+    with InTemporaryDirectory():\n+        for shape in okay_shapes:\n+            write_morph_data('test.curv', values.reshape(shape))\n+            # Check ordering is preserved, regardless of shape\n+            assert_equal(values, read_morph_data('test.curv'))\n+        assert_raises(ValueError, write_morph_data, 'test.curv',\n+                      np.zeros(shape), big_num)\n+        if ctypes.c_long is not ctypes.c_int32:\n+            assert_raises(ValueError, write_morph_data, 'test.curv',\n+                          strided_scalar((big_num,)))","path":"nibabel/freesurfer/tests/test_io.py","position":null,"original_position":49,"commit_id":"32e01efcc924081593c346e8151499778c320fff","original_commit_id":"21500d34c4b410fcf3a3ef10f88504dffa1c680d","user":{"login":"effigies","id":83442,"avatar_url":"https://avatars.githubusercontent.com/u/83442?v=3","gravatar_id":"","url":"https://api.github.com/users/effigies","html_url":"https://github.com/effigies","followers_url":"https://api.github.com/users/effigies/followers","following_url":"https://api.github.com/users/effigies/following{/other_user}","gists_url":"https://api.github.com/users/effigies/gists{/gist_id}","starred_url":"https://api.github.com/users/effigies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/effigies/subscriptions","organizations_url":"https://api.github.com/users/effigies/orgs","repos_url":"https://api.github.com/users/effigies/repos","events_url":"https://api.github.com/users/effigies/events{/privacy}","received_events_url":"https://api.github.com/users/effigies/received_events","type":"User","site_admin":false},"body":"Doesn't seem to capture the case for [PYTHON_VERSION=2.7, PYTHON_ARCH=32](https://ci.appveyor.com/project/Eric89GXL/nibabel/build/1.0.589).","created_at":"2016-03-02T03:29:51Z","updated_at":"2016-03-02T03:29:51Z","html_url":"https://github.com/nipy/nibabel/pull/414#discussion_r54675021","pull_request_url":"https://api.github.com/repos/nipy/nibabel/pulls/414","_links":{"self":{"href":"https://api.github.com/repos/nipy/nibabel/pulls/comments/54675021"},"html":{"href":"https://github.com/nipy/nibabel/pull/414#discussion_r54675021"},"pull_request":{"href":"https://api.github.com/repos/nipy/nibabel/pulls/414"}}},"pull_request":{"url":"https://api.github.com/repos/nipy/nibabel/pulls/414","id":61183270,"html_url":"https://github.com/nipy/nibabel/pull/414","diff_url":"https://github.com/nipy/nibabel/pull/414.diff","patch_url":"https://github.com/nipy/nibabel/pull/414.patch","issue_url":"https://api.github.com/repos/nipy/nibabel/issues/414","number":414,"state":"open","locked":false,"title":"ENH: Add write_morph_data to freesurfer.io","user":{"login":"effigies","id":83442,"avatar_url":"https://avatars.githubusercontent.com/u/83442?v=3","gravatar_id":"","url":"https://api.github.com/users/effigies","html_url":"https://github.com/effigies","followers_url":"https://api.github.com/users/effigies/followers","following_url":"https://api.github.com/users/effigies/following{/other_user}","gists_url":"https://api.github.com/users/effigies/gists{/gist_id}","starred_url":"https://api.github.com/users/effigies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/effigies/subscriptions","organizations_url":"https://api.github.com/users/effigies/orgs","repos_url":"https://api.github.com/users/effigies/repos","events_url":"https://api.github.com/users/effigies/events{/privacy}","received_events_url":"https://api.github.com/users/effigies/received_events","type":"User","site_admin":false},"body":"The first commit was in the midst of #249 and causing PEP8 warnings. Not otherwise relevant to Cifti, so  I'm submitting as its own PR. Fixed the style and brought a little more in line with `freesurfer.io` functions.","created_at":"2016-03-01T02:33:51Z","updated_at":"2016-03-02T03:29:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bdfe3b0490e8b78b36f0077e64ad4abfc79e603","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nipy/nibabel/pulls/414/commits","review_comments_url":"https://api.github.com/repos/nipy/nibabel/pulls/414/comments","review_comment_url":"https://api.github.com/repos/nipy/nibabel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nipy/nibabel/issues/414/comments","statuses_url":"https://api.github.com/repos/nipy/nibabel/statuses/32e01efcc924081593c346e8151499778c320fff","head":{"label":"effigies:write_morph","ref":"write_morph","sha":"32e01efcc924081593c346e8151499778c320fff","user":{"login":"effigies","id":83442,"avatar_url":"https://avatars.githubusercontent.com/u/83442?v=3","gravatar_id":"","url":"https://api.github.com/users/effigies","html_url":"https://github.com/effigies","followers_url":"https://api.github.com/users/effigies/followers","following_url":"https://api.github.com/users/effigies/following{/other_user}","gists_url":"https://api.github.com/users/effigies/gists{/gist_id}","starred_url":"https://api.github.com/users/effigies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/effigies/subscriptions","organizations_url":"https://api.github.com/users/effigies/orgs","repos_url":"https://api.github.com/users/effigies/repos","events_url":"https://api.github.com/users/effigies/events{/privacy}","received_events_url":"https://api.github.com/users/effigies/received_events","type":"User","site_admin":false},"repo":{"id":4785741,"name":"nibabel","full_name":"effigies/nibabel","owner":{"login":"effigies","id":83442,"avatar_url":"https://avatars.githubusercontent.com/u/83442?v=3","gravatar_id":"","url":"https://api.github.com/users/effigies","html_url":"https://github.com/effigies","followers_url":"https://api.github.com/users/effigies/followers","following_url":"https://api.github.com/users/effigies/following{/other_user}","gists_url":"https://api.github.com/users/effigies/gists{/gist_id}","starred_url":"https://api.github.com/users/effigies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/effigies/subscriptions","organizations_url":"https://api.github.com/users/effigies/orgs","repos_url":"https://api.github.com/users/effigies/repos","events_url":"https://api.github.com/users/effigies/events{/privacy}","received_events_url":"https://api.github.com/users/effigies/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/effigies/nibabel","description":"Python package to access a cacophony of neuro-imaging file formats","fork":true,"url":"https://api.github.com/repos/effigies/nibabel","forks_url":"https://api.github.com/repos/effigies/nibabel/forks","keys_url":"https://api.github.com/repos/effigies/nibabel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/effigies/nibabel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/effigies/nibabel/teams","hooks_url":"https://api.github.com/repos/effigies/nibabel/hooks","issue_events_url":"https://api.github.com/repos/effigies/nibabel/issues/events{/number}","events_url":"https://api.github.com/repos/effigies/nibabel/events","assignees_url":"https://api.github.com/repos/effigies/nibabel/assignees{/user}","branches_url":"https://api.github.com/repos/effigies/nibabel/branches{/branch}","tags_url":"https://api.github.com/repos/effigies/nibabel/tags","blobs_url":"https://api.github.com/repos/effigies/nibabel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/effigies/nibabel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/effigies/nibabel/git/refs{/sha}","trees_url":"https://api.github.com/repos/effigies/nibabel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/effigies/nibabel/statuses/{sha}","languages_url":"https://api.github.com/repos/effigies/nibabel/languages","stargazers_url":"https://api.github.com/repos/effigies/nibabel/stargazers","contributors_url":"https://api.github.com/repos/effigies/nibabel/contributors","subscribers_url":"https://api.github.com/repos/effigies/nibabel/subscribers","subscription_url":"https://api.github.com/repos/effigies/nibabel/subscription","commits_url":"https://api.github.com/repos/effigies/nibabel/commits{/sha}","git_commits_url":"https://api.github.com/repos/effigies/nibabel/git/commits{/sha}","comments_url":"https://api.github.com/repos/effigies/nibabel/comments{/number}","issue_comment_url":"https://api.github.com/repos/effigies/nibabel/issues/comments{/number}","contents_url":"https://api.github.com/repos/effigies/nibabel/contents/{+path}","compare_url":"https://api.github.com/repos/effigies/nibabel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/effigies/nibabel/merges","archive_url":"https://api.github.com/repos/effigies/nibabel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/effigies/nibabel/downloads","issues_url":"https://api.github.com/repos/effigies/nibabel/issues{/number}","pulls_url":"https://api.github.com/repos/effigies/nibabel/pulls{/number}","milestones_url":"https://api.github.com/repos/effigies/nibabel/milestones{/number}","notifications_url":"https://api.github.com/repos/effigies/nibabel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/effigies/nibabel/labels{/name}","releases_url":"https://api.github.com/repos/effigies/nibabel/releases{/id}","deployments_url":"https://api.github.com/repos/effigies/nibabel/deployments","created_at":"2012-06-25T18:44:10Z","updated_at":"2015-04-09T18:13:27Z","pushed_at":"2016-03-02T02:48:12Z","git_url":"git://github.com/effigies/nibabel.git","ssh_url":"git@github.com:effigies/nibabel.git","clone_url":"https://github.com/effigies/nibabel.git","svn_url":"https://github.com/effigies/nibabel","homepage":"http://nipy.org/nibabel/","size":8697,"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":"data_functor"}},"base":{"label":"nipy:master","ref":"master","sha":"b66d63b4ff35a23481d3ff3f80a7b87d5c85fa08","user":{"login":"nipy","id":233707,"avatar_url":"https://avatars.githubusercontent.com/u/233707?v=3","gravatar_id":"","url":"https://api.github.com/users/nipy","html_url":"https://github.com/nipy","followers_url":"https://api.github.com/users/nipy/followers","following_url":"https://api.github.com/users/nipy/following{/other_user}","gists_url":"https://api.github.com/users/nipy/gists{/gist_id}","starred_url":"https://api.github.com/users/nipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipy/subscriptions","organizations_url":"https://api.github.com/users/nipy/orgs","repos_url":"https://api.github.com/users/nipy/repos","events_url":"https://api.github.com/users/nipy/events{/privacy}","received_events_url":"https://api.github.com/users/nipy/received_events","type":"Organization","site_admin":false},"repo":{"id":791352,"name":"nibabel","full_name":"nipy/nibabel","owner":{"login":"nipy","id":233707,"avatar_url":"https://avatars.githubusercontent.com/u/233707?v=3","gravatar_id":"","url":"https://api.github.com/users/nipy","html_url":"https://github.com/nipy","followers_url":"https://api.github.com/users/nipy/followers","following_url":"https://api.github.com/users/nipy/following{/other_user}","gists_url":"https://api.github.com/users/nipy/gists{/gist_id}","starred_url":"https://api.github.com/users/nipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipy/subscriptions","organizations_url":"https://api.github.com/users/nipy/orgs","repos_url":"https://api.github.com/users/nipy/repos","events_url":"https://api.github.com/users/nipy/events{/privacy}","received_events_url":"https://api.github.com/users/nipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nipy/nibabel","description":"Python package to access a cacophony of neuro-imaging file formats","fork":false,"url":"https://api.github.com/repos/nipy/nibabel","forks_url":"https://api.github.com/repos/nipy/nibabel/forks","keys_url":"https://api.github.com/repos/nipy/nibabel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nipy/nibabel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nipy/nibabel/teams","hooks_url":"https://api.github.com/repos/nipy/nibabel/hooks","issue_events_url":"https://api.github.com/repos/nipy/nibabel/issues/events{/number}","events_url":"https://api.github.com/repos/nipy/nibabel/events","assignees_url":"https://api.github.com/repos/nipy/nibabel/assignees{/user}","branches_url":"https://api.github.com/repos/nipy/nibabel/branches{/branch}","tags_url":"https://api.github.com/repos/nipy/nibabel/tags","blobs_url":"https://api.github.com/repos/nipy/nibabel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nipy/nibabel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nipy/nibabel/git/refs{/sha}","trees_url":"https://api.github.com/repos/nipy/nibabel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nipy/nibabel/statuses/{sha}","languages_url":"https://api.github.com/repos/nipy/nibabel/languages","stargazers_url":"https://api.github.com/repos/nipy/nibabel/stargazers","contributors_url":"https://api.github.com/repos/nipy/nibabel/contributors","subscribers_url":"https://api.github.com/repos/nipy/nibabel/subscribers","subscription_url":"https://api.github.com/repos/nipy/nibabel/subscription","commits_url":"https://api.github.com/repos/nipy/nibabel/commits{/sha}","git_commits_url":"https://api.github.com/repos/nipy/nibabel/git/commits{/sha}","comments_url":"https://api.github.com/repos/nipy/nibabel/comments{/number}","issue_comment_url":"https://api.github.com/repos/nipy/nibabel/issues/comments{/number}","contents_url":"https://api.github.com/repos/nipy/nibabel/contents/{+path}","compare_url":"https://api.github.com/repos/nipy/nibabel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nipy/nibabel/merges","archive_url":"https://api.github.com/repos/nipy/nibabel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nipy/nibabel/downloads","issues_url":"https://api.github.com/repos/nipy/nibabel/issues{/number}","pulls_url":"https://api.github.com/repos/nipy/nibabel/pulls{/number}","milestones_url":"https://api.github.com/repos/nipy/nibabel/milestones{/number}","notifications_url":"https://api.github.com/repos/nipy/nibabel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nipy/nibabel/labels{/name}","releases_url":"https://api.github.com/repos/nipy/nibabel/releases{/id}","deployments_url":"https://api.github.com/repos/nipy/nibabel/deployments","created_at":"2010-07-22T16:28:30Z","updated_at":"2016-02-28T05:44:09Z","pushed_at":"2016-03-02T02:48:12Z","git_url":"git://github.com/nipy/nibabel.git","ssh_url":"git@github.com:nipy/nibabel.git","clone_url":"https://github.com/nipy/nibabel.git","svn_url":"https://github.com/nipy/nibabel","homepage":"http://nipy.org/nibabel/","size":19903,"stargazers_count":101,"watchers_count":101,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":102,"mirror_url":null,"open_issues_count":63,"forks":102,"open_issues":63,"watchers":101,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nipy/nibabel/pulls/414"},"html":{"href":"https://github.com/nipy/nibabel/pull/414"},"issue":{"href":"https://api.github.com/repos/nipy/nibabel/issues/414"},"comments":{"href":"https://api.github.com/repos/nipy/nibabel/issues/414/comments"},"review_comments":{"href":"https://api.github.com/repos/nipy/nibabel/pulls/414/comments"},"review_comment":{"href":"https://api.github.com/repos/nipy/nibabel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nipy/nibabel/pulls/414/commits"},"statuses":{"href":"https://api.github.com/repos/nipy/nibabel/statuses/32e01efcc924081593c346e8151499778c320fff"}}}}