GitHub PullRequestReviewCommentEvent at 2014-06-26 01:53:25
Repository: xray
Actor: shoyer
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/xray/xray/pulls/comments/14222443","id":14222443,"diff_hunk":"@@ -275,3 +278,67 @@ def test_incompatible_attributes(self):\n         for var in invalid_vars:\n             with self.assertRaises(ValueError):\n                 conventions.encode_cf_variable(var)\n+\n+\n+@conventions.cf_encoded\n+class CFEncodedInMemoryStore(InMemoryDataStore):\n+    pass\n+\n+\n+class TestCFEncodedDataStore(CFEncodedDataTest, TestCase):\n+    @contextlib.contextmanager\n+    def create_store(self):\n+        yield CFEncodedInMemoryStore()\n+\n+    @contextlib.contextmanager\n+    def roundtrip(self, data, **kwargs):\n+        store = CFEncodedInMemoryStore(**kwargs)\n+        store.store(data)\n+        yield Dataset.load_store(store, decoder=None)\n+\n+\n+class NullWrapper(utils.NDArrayMixin):\n+    \"\"\"\n+    Just for testing, this lets us create a numpy array directly\n+    but make it look like its not in memory yet.\n+    \"\"\"\n+    def __init__(self, array):\n+        self.array = array\n+\n+    def __getitem__(self, key):\n+        return self.array[indexing.orthogonal_indexer(key, self.shape)]\n+\n+\n+def lazy_identity(x):\n+    \"\"\"\n+    Given a data store this wraps each variable in a NullWrapper so that\n+    it appears to be out of memory.\n+    \"\"\"\n+    variables = {k: Variable(v.dimensions,\n+                             NullWrapper(v.values),\n+                             v.attrs) for k, v in x.variables.iteritems()}\n+    return InMemoryDataStore({'variables': variables,\n+                              'attributes': x.attrs})\n+\n+\n+@conventions.encoding_decorator(lambda x: x, lazy_identity)","path":"test/test_conventions.py","position":61,"original_position":61,"commit_id":"134d5ba9f6b44cb4298b374e91ce7da6a19fd8dc","original_commit_id":"134d5ba9f6b44cb4298b374e91ce7da6a19fd8dc","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?","gravatar_id":"93a76a800ef6c5919baa8ba91120ee98","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"body":"decorator + inheritance feels like one more step than necessary...","created_at":"2014-06-26T01:53:25Z","updated_at":"2014-06-26T01:53:25Z","html_url":"https://github.com/xray/xray/pull/175#discussion_r14222443","pull_request_url":"https://api.github.com/repos/xray/xray/pulls/175","_links":{"self":{"href":"https://api.github.com/repos/xray/xray/pulls/comments/14222443"},"html":{"href":"https://github.com/xray/xray/pull/175#discussion_r14222443"},"pull_request":{"href":"https://api.github.com/repos/xray/xray/pulls/175"}}},"pull_request":{"url":"https://api.github.com/repos/xray/xray/pulls/175","id":17582684,"html_url":"https://github.com/xray/xray/pull/175","diff_url":"https://github.com/xray/xray/pull/175.diff","patch_url":"https://github.com/xray/xray/pull/175.patch","issue_url":"https://api.github.com/repos/xray/xray/issues/175","number":175,"state":"open","title":"Modular encoding","user":{"login":"akleeman","id":514053,"avatar_url":"https://avatars.githubusercontent.com/u/514053?","gravatar_id":"234b285cd08ba87456e20f4a98769a4d","url":"https://api.github.com/users/akleeman","html_url":"https://github.com/akleeman","followers_url":"https://api.github.com/users/akleeman/followers","following_url":"https://api.github.com/users/akleeman/following{/other_user}","gists_url":"https://api.github.com/users/akleeman/gists{/gist_id}","starred_url":"https://api.github.com/users/akleeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akleeman/subscriptions","organizations_url":"https://api.github.com/users/akleeman/orgs","repos_url":"https://api.github.com/users/akleeman/repos","events_url":"https://api.github.com/users/akleeman/events{/privacy}","received_events_url":"https://api.github.com/users/akleeman/received_events","type":"User","site_admin":false},"body":"Restructured Backends to make CF conventions handling consistent.\r\n\r\nAmong other things this includes:\r\n- EncodedDataStores which can wrap other stores and allow\r\n  for modular encoding/decoding.\r\n- Trivial indices ds['x'] = ('x', np.arange(10)) are no longer\r\n  stored on disk and are only created when accessed.\r\n- AbstractDataStore API change.  Shouldn't effect external users.\r\n- missing_value attributes now function like _FillValue\r\n\r\nAll current tests are passing (though it could use more new ones).","created_at":"2014-06-25T10:37:41Z","updated_at":"2014-06-26T01:53:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"676a05aaa20fc74957bd029616ab21fb5b7c74e7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xray/xray/pulls/175/commits","review_comments_url":"https://api.github.com/repos/xray/xray/pulls/175/comments","review_comment_url":"https://api.github.com/repos/xray/xray/pulls/comments/{number}","comments_url":"https://api.github.com/repos/xray/xray/issues/175/comments","statuses_url":"https://api.github.com/repos/xray/xray/statuses/134d5ba9f6b44cb4298b374e91ce7da6a19fd8dc","head":{"label":"akleeman:modular-encoding","ref":"modular-encoding","sha":"134d5ba9f6b44cb4298b374e91ce7da6a19fd8dc","user":{"login":"akleeman","id":514053,"avatar_url":"https://avatars.githubusercontent.com/u/514053?","gravatar_id":"234b285cd08ba87456e20f4a98769a4d","url":"https://api.github.com/users/akleeman","html_url":"https://github.com/akleeman","followers_url":"https://api.github.com/users/akleeman/followers","following_url":"https://api.github.com/users/akleeman/following{/other_user}","gists_url":"https://api.github.com/users/akleeman/gists{/gist_id}","starred_url":"https://api.github.com/users/akleeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akleeman/subscriptions","organizations_url":"https://api.github.com/users/akleeman/orgs","repos_url":"https://api.github.com/users/akleeman/repos","events_url":"https://api.github.com/users/akleeman/events{/privacy}","received_events_url":"https://api.github.com/users/akleeman/received_events","type":"User","site_admin":false},"repo":{"id":19699545,"name":"xray","full_name":"akleeman/xray","owner":{"login":"akleeman","id":514053,"avatar_url":"https://avatars.githubusercontent.com/u/514053?","gravatar_id":"234b285cd08ba87456e20f4a98769a4d","url":"https://api.github.com/users/akleeman","html_url":"https://github.com/akleeman","followers_url":"https://api.github.com/users/akleeman/followers","following_url":"https://api.github.com/users/akleeman/following{/other_user}","gists_url":"https://api.github.com/users/akleeman/gists{/gist_id}","starred_url":"https://api.github.com/users/akleeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akleeman/subscriptions","organizations_url":"https://api.github.com/users/akleeman/orgs","repos_url":"https://api.github.com/users/akleeman/repos","events_url":"https://api.github.com/users/akleeman/events{/privacy}","received_events_url":"https://api.github.com/users/akleeman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akleeman/xray","description":"Extended arrays for working with scientific datasets in Python. http://xray.readthedocs.org","fork":true,"url":"https://api.github.com/repos/akleeman/xray","forks_url":"https://api.github.com/repos/akleeman/xray/forks","keys_url":"https://api.github.com/repos/akleeman/xray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akleeman/xray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akleeman/xray/teams","hooks_url":"https://api.github.com/repos/akleeman/xray/hooks","issue_events_url":"https://api.github.com/repos/akleeman/xray/issues/events{/number}","events_url":"https://api.github.com/repos/akleeman/xray/events","assignees_url":"https://api.github.com/repos/akleeman/xray/assignees{/user}","branches_url":"https://api.github.com/repos/akleeman/xray/branches{/branch}","tags_url":"https://api.github.com/repos/akleeman/xray/tags","blobs_url":"https://api.github.com/repos/akleeman/xray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akleeman/xray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akleeman/xray/git/refs{/sha}","trees_url":"https://api.github.com/repos/akleeman/xray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akleeman/xray/statuses/{sha}","languages_url":"https://api.github.com/repos/akleeman/xray/languages","stargazers_url":"https://api.github.com/repos/akleeman/xray/stargazers","contributors_url":"https://api.github.com/repos/akleeman/xray/contributors","subscribers_url":"https://api.github.com/repos/akleeman/xray/subscribers","subscription_url":"https://api.github.com/repos/akleeman/xray/subscription","commits_url":"https://api.github.com/repos/akleeman/xray/commits{/sha}","git_commits_url":"https://api.github.com/repos/akleeman/xray/git/commits{/sha}","comments_url":"https://api.github.com/repos/akleeman/xray/comments{/number}","issue_comment_url":"https://api.github.com/repos/akleeman/xray/issues/comments/{number}","contents_url":"https://api.github.com/repos/akleeman/xray/contents/{+path}","compare_url":"https://api.github.com/repos/akleeman/xray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akleeman/xray/merges","archive_url":"https://api.github.com/repos/akleeman/xray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akleeman/xray/downloads","issues_url":"https://api.github.com/repos/akleeman/xray/issues{/number}","pulls_url":"https://api.github.com/repos/akleeman/xray/pulls{/number}","milestones_url":"https://api.github.com/repos/akleeman/xray/milestones{/number}","notifications_url":"https://api.github.com/repos/akleeman/xray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akleeman/xray/labels{/name}","releases_url":"https://api.github.com/repos/akleeman/xray/releases{/id}","created_at":"2014-05-12T13:23:20Z","updated_at":"2014-06-25T09:41:38Z","pushed_at":"2014-06-25T16:22:23Z","git_url":"git://github.com/akleeman/xray.git","ssh_url":"git@github.com:akleeman/xray.git","clone_url":"https://github.com/akleeman/xray.git","svn_url":"https://github.com/akleeman/xray","homepage":"","size":1494,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"xray:master","ref":"master","sha":"7e0e7b1f2b3663c9fddb7b9f1767e4e7f744d19c","user":{"login":"xray","id":7505795,"avatar_url":"https://avatars.githubusercontent.com/u/7505795?","gravatar_id":null,"url":"https://api.github.com/users/xray","html_url":"https://github.com/xray","followers_url":"https://api.github.com/users/xray/followers","following_url":"https://api.github.com/users/xray/following{/other_user}","gists_url":"https://api.github.com/users/xray/gists{/gist_id}","starred_url":"https://api.github.com/users/xray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xray/subscriptions","organizations_url":"https://api.github.com/users/xray/orgs","repos_url":"https://api.github.com/users/xray/repos","events_url":"https://api.github.com/users/xray/events{/privacy}","received_events_url":"https://api.github.com/users/xray/received_events","type":"Organization","site_admin":false},"repo":{"id":13221727,"name":"xray","full_name":"xray/xray","owner":{"login":"xray","id":7505795,"avatar_url":"https://avatars.githubusercontent.com/u/7505795?","gravatar_id":null,"url":"https://api.github.com/users/xray","html_url":"https://github.com/xray","followers_url":"https://api.github.com/users/xray/followers","following_url":"https://api.github.com/users/xray/following{/other_user}","gists_url":"https://api.github.com/users/xray/gists{/gist_id}","starred_url":"https://api.github.com/users/xray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xray/subscriptions","organizations_url":"https://api.github.com/users/xray/orgs","repos_url":"https://api.github.com/users/xray/repos","events_url":"https://api.github.com/users/xray/events{/privacy}","received_events_url":"https://api.github.com/users/xray/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xray/xray","description":"Extended arrays for working with scientific datasets in Python.","fork":false,"url":"https://api.github.com/repos/xray/xray","forks_url":"https://api.github.com/repos/xray/xray/forks","keys_url":"https://api.github.com/repos/xray/xray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xray/xray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xray/xray/teams","hooks_url":"https://api.github.com/repos/xray/xray/hooks","issue_events_url":"https://api.github.com/repos/xray/xray/issues/events{/number}","events_url":"https://api.github.com/repos/xray/xray/events","assignees_url":"https://api.github.com/repos/xray/xray/assignees{/user}","branches_url":"https://api.github.com/repos/xray/xray/branches{/branch}","tags_url":"https://api.github.com/repos/xray/xray/tags","blobs_url":"https://api.github.com/repos/xray/xray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xray/xray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xray/xray/git/refs{/sha}","trees_url":"https://api.github.com/repos/xray/xray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xray/xray/statuses/{sha}","languages_url":"https://api.github.com/repos/xray/xray/languages","stargazers_url":"https://api.github.com/repos/xray/xray/stargazers","contributors_url":"https://api.github.com/repos/xray/xray/contributors","subscribers_url":"https://api.github.com/repos/xray/xray/subscribers","subscription_url":"https://api.github.com/repos/xray/xray/subscription","commits_url":"https://api.github.com/repos/xray/xray/commits{/sha}","git_commits_url":"https://api.github.com/repos/xray/xray/git/commits{/sha}","comments_url":"https://api.github.com/repos/xray/xray/comments{/number}","issue_comment_url":"https://api.github.com/repos/xray/xray/issues/comments/{number}","contents_url":"https://api.github.com/repos/xray/xray/contents/{+path}","compare_url":"https://api.github.com/repos/xray/xray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xray/xray/merges","archive_url":"https://api.github.com/repos/xray/xray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xray/xray/downloads","issues_url":"https://api.github.com/repos/xray/xray/issues{/number}","pulls_url":"https://api.github.com/repos/xray/xray/pulls{/number}","milestones_url":"https://api.github.com/repos/xray/xray/milestones{/number}","notifications_url":"https://api.github.com/repos/xray/xray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xray/xray/labels{/name}","releases_url":"https://api.github.com/repos/xray/xray/releases{/id}","created_at":"2013-09-30T17:21:10Z","updated_at":"2014-06-25T07:37:37Z","pushed_at":"2014-06-25T07:37:36Z","git_url":"git://github.com/xray/xray.git","ssh_url":"git@github.com:xray/xray.git","clone_url":"https://github.com/xray/xray.git","svn_url":"https://github.com/xray/xray","homepage":"http://xray.readthedocs.org","size":6187,"stargazers_count":35,"watchers_count":35,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":8,"mirror_url":null,"open_issues_count":23,"forks":8,"open_issues":23,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xray/xray/pulls/175"},"html":{"href":"https://github.com/xray/xray/pull/175"},"issue":{"href":"https://api.github.com/repos/xray/xray/issues/175"},"comments":{"href":"https://api.github.com/repos/xray/xray/issues/175/comments"},"review_comments":{"href":"https://api.github.com/repos/xray/xray/pulls/175/comments"},"review_comment":{"href":"https://api.github.com/repos/xray/xray/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/xray/xray/pulls/175/commits"},"statuses":{"href":"https://api.github.com/repos/xray/xray/statuses/134d5ba9f6b44cb4298b374e91ce7da6a19fd8dc"}}}}