{"action":"created","comment":{"url":"https://api.github.com/repos/geopandas/geopandas/pulls/comments/130727514","pull_request_review_id":53635489,"id":130727514,"diff_hunk":"@@ -0,0 +1,347 @@\n+\n+import numpy as np\n+\n+from pandas.core.internals import Block, NonConsolidatableMixIn\n+from pandas.core.common import is_null_slice\n+\n+\n+class GeometryBlock(NonConsolidatableMixIn, Block):\n+    \"\"\" implement a datetime64 block with a tz attribute \"\"\"\n+    __slots__ = ()\n+\n+    @property\n+    def _holder(self):\n+        from geopandas.vectorized import VectorizedGeometry\n+        return VectorizedGeometry\n+\n+    def __init__(self, values, placement, ndim=2, **kwargs):\n+\n+        if not isinstance(values, self._holder):\n+            raise TypeError(\"values must be a VectorizedGeometry object\")\n+\n+        super(GeometryBlock, self).__init__(values, placement=placement,\n+                                            ndim=ndim, **kwargs)\n+\n+    @property\n+    def _box_func(self):\n+        # TODO does not seems to be used at the moment (from the examples) ?\n+        print(\"I am boxed\")\n+        from shapely.geometry.base import geom_factory\n+        return geom_factory\n+\n+    # @property\n+    # def _na_value(self):\n+    #     return None\n+    #\n+    # @property\n+    # def fill_value(self):\n+    #     return tslib.iNaT\n+\n+    # TODO\n+    # def copy(self, deep=True, mgr=None):\n+    #     \"\"\" copy constructor \"\"\"\n+    #     values = self.values\n+    #     if deep:\n+    #         values = values.copy(deep=True)\n+    #     return self.make_block_same_class(values)\n+\n+    def external_values(self):\n+        \"\"\" we internally represent the data as a DatetimeIndex, but for\n+        external compat with ndarray, export as a ndarray of Timestamps\n+        \"\"\"\n+        #return np.asarray(self.values)\n+        print(\"I am densified (external_values, {} elements)\".format(len(self)))\n+        return self.values.to_dense()\n+\n+    def formatted_values(self, dtype=None):\n+        \"\"\" return an internal format, currently just the ndarray\n+        this should be the pure internal API format\n+        \"\"\"\n+        return self.to_dense()\n+\n+    def to_dense(self):\n+        print(\"I am densified ({} elements)\".format(len(self)))\n+        return self.values.to_dense().view()\n+\n+    def __getitem__(self, key):\n+        values = self.values[key]\n+        return GeometryBlock(values, placement=slice(0, len(values), 1),","path":"geopandas/_block.py","position":68,"original_position":68,"commit_id":"197846e70f16d0c7c8be163aeb1e5ff2ef9d2468","original_commit_id":"197846e70f16d0c7c8be163aeb1e5ff2ef9d2468","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars3.githubusercontent.com/u/306380?v=4","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"body":"    geopandas/tests/test_geoseries.py::TestSeries::test_fillna","created_at":"2017-08-01T21:02:37Z","updated_at":"2017-08-01T21:02:37Z","html_url":"https://github.com/geopandas/geopandas/pull/467#discussion_r130727514","pull_request_url":"https://api.github.com/repos/geopandas/geopandas/pulls/467","_links":{"self":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/comments/130727514"},"html":{"href":"https://github.com/geopandas/geopandas/pull/467#discussion_r130727514"},"pull_request":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/467"}}},"pull_request":{"url":"https://api.github.com/repos/geopandas/geopandas/pulls/467","id":130874625,"html_url":"https://github.com/geopandas/geopandas/pull/467","diff_url":"https://github.com/geopandas/geopandas/pull/467.diff","patch_url":"https://github.com/geopandas/geopandas/pull/467.patch","issue_url":"https://api.github.com/repos/geopandas/geopandas/issues/467","number":467,"state":"open","locked":false,"title":"WIP - Cythonize geometry series operations","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars3.githubusercontent.com/u/306380?v=4","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"body":"This cythonizes a class of geometry operations within geoseries.  It builds off of @jorisvandenbossche notebook in #430 by extending the set of operations and setting up a proper build environment.\r\n\r\nSome things to note\r\n\r\n1.  There is a Cython build setup provided by @eriknw\r\n2.  Cython code is only used if available, falling back on the previous Python solution\r\n3.  @wmay has another attempt at https://github.com/Toblerity/Shapely/issues/501\r\n4.  I get around a 50-100x speedup on a simple comparison\r\n5.  There are some inconsistencies between this and what shapely does that I haven't yet tracked won\r\n6.  There are still plenty of operations to do.  This just expands on @jorisvandenbossche 's work","created_at":"2017-07-17T14:48:59Z","updated_at":"2017-08-01T21:02:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a39e67f76b9348224bf052159bab698cbb6d9f01","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/geopandas/geopandas/pulls/467/commits","review_comments_url":"https://api.github.com/repos/geopandas/geopandas/pulls/467/comments","review_comment_url":"https://api.github.com/repos/geopandas/geopandas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geopandas/geopandas/issues/467/comments","statuses_url":"https://api.github.com/repos/geopandas/geopandas/statuses/197846e70f16d0c7c8be163aeb1e5ff2ef9d2468","head":{"label":"mrocklin:cythonize","ref":"cythonize","sha":"197846e70f16d0c7c8be163aeb1e5ff2ef9d2468","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars3.githubusercontent.com/u/306380?v=4","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"repo":{"id":97347151,"name":"geopandas","full_name":"mrocklin/geopandas","owner":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars3.githubusercontent.com/u/306380?v=4","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrocklin/geopandas","description":"Python tools for geographic data","fork":true,"url":"https://api.github.com/repos/mrocklin/geopandas","forks_url":"https://api.github.com/repos/mrocklin/geopandas/forks","keys_url":"https://api.github.com/repos/mrocklin/geopandas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrocklin/geopandas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrocklin/geopandas/teams","hooks_url":"https://api.github.com/repos/mrocklin/geopandas/hooks","issue_events_url":"https://api.github.com/repos/mrocklin/geopandas/issues/events{/number}","events_url":"https://api.github.com/repos/mrocklin/geopandas/events","assignees_url":"https://api.github.com/repos/mrocklin/geopandas/assignees{/user}","branches_url":"https://api.github.com/repos/mrocklin/geopandas/branches{/branch}","tags_url":"https://api.github.com/repos/mrocklin/geopandas/tags","blobs_url":"https://api.github.com/repos/mrocklin/geopandas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrocklin/geopandas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrocklin/geopandas/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrocklin/geopandas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrocklin/geopandas/statuses/{sha}","languages_url":"https://api.github.com/repos/mrocklin/geopandas/languages","stargazers_url":"https://api.github.com/repos/mrocklin/geopandas/stargazers","contributors_url":"https://api.github.com/repos/mrocklin/geopandas/contributors","subscribers_url":"https://api.github.com/repos/mrocklin/geopandas/subscribers","subscription_url":"https://api.github.com/repos/mrocklin/geopandas/subscription","commits_url":"https://api.github.com/repos/mrocklin/geopandas/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrocklin/geopandas/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrocklin/geopandas/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrocklin/geopandas/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrocklin/geopandas/contents/{+path}","compare_url":"https://api.github.com/repos/mrocklin/geopandas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrocklin/geopandas/merges","archive_url":"https://api.github.com/repos/mrocklin/geopandas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrocklin/geopandas/downloads","issues_url":"https://api.github.com/repos/mrocklin/geopandas/issues{/number}","pulls_url":"https://api.github.com/repos/mrocklin/geopandas/pulls{/number}","milestones_url":"https://api.github.com/repos/mrocklin/geopandas/milestones{/number}","notifications_url":"https://api.github.com/repos/mrocklin/geopandas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrocklin/geopandas/labels{/name}","releases_url":"https://api.github.com/repos/mrocklin/geopandas/releases{/id}","deployments_url":"https://api.github.com/repos/mrocklin/geopandas/deployments","created_at":"2017-07-15T23:08:09Z","updated_at":"2017-07-15T23:08:10Z","pushed_at":"2017-08-01T15:43:19Z","git_url":"git://github.com/mrocklin/geopandas.git","ssh_url":"git@github.com:mrocklin/geopandas.git","clone_url":"https://github.com/mrocklin/geopandas.git","svn_url":"https://github.com/mrocklin/geopandas","homepage":"","size":4952,"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,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"geopandas:master","ref":"master","sha":"1731e44b2df88d08adfbc09260dda86d3d35e91d","user":{"login":"geopandas","id":8130715,"avatar_url":"https://avatars2.githubusercontent.com/u/8130715?v=4","gravatar_id":"","url":"https://api.github.com/users/geopandas","html_url":"https://github.com/geopandas","followers_url":"https://api.github.com/users/geopandas/followers","following_url":"https://api.github.com/users/geopandas/following{/other_user}","gists_url":"https://api.github.com/users/geopandas/gists{/gist_id}","starred_url":"https://api.github.com/users/geopandas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geopandas/subscriptions","organizations_url":"https://api.github.com/users/geopandas/orgs","repos_url":"https://api.github.com/users/geopandas/repos","events_url":"https://api.github.com/users/geopandas/events{/privacy}","received_events_url":"https://api.github.com/users/geopandas/received_events","type":"Organization","site_admin":false},"repo":{"id":11002815,"name":"geopandas","full_name":"geopandas/geopandas","owner":{"login":"geopandas","id":8130715,"avatar_url":"https://avatars2.githubusercontent.com/u/8130715?v=4","gravatar_id":"","url":"https://api.github.com/users/geopandas","html_url":"https://github.com/geopandas","followers_url":"https://api.github.com/users/geopandas/followers","following_url":"https://api.github.com/users/geopandas/following{/other_user}","gists_url":"https://api.github.com/users/geopandas/gists{/gist_id}","starred_url":"https://api.github.com/users/geopandas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geopandas/subscriptions","organizations_url":"https://api.github.com/users/geopandas/orgs","repos_url":"https://api.github.com/users/geopandas/repos","events_url":"https://api.github.com/users/geopandas/events{/privacy}","received_events_url":"https://api.github.com/users/geopandas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geopandas/geopandas","description":"Python tools for geographic data","fork":false,"url":"https://api.github.com/repos/geopandas/geopandas","forks_url":"https://api.github.com/repos/geopandas/geopandas/forks","keys_url":"https://api.github.com/repos/geopandas/geopandas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geopandas/geopandas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geopandas/geopandas/teams","hooks_url":"https://api.github.com/repos/geopandas/geopandas/hooks","issue_events_url":"https://api.github.com/repos/geopandas/geopandas/issues/events{/number}","events_url":"https://api.github.com/repos/geopandas/geopandas/events","assignees_url":"https://api.github.com/repos/geopandas/geopandas/assignees{/user}","branches_url":"https://api.github.com/repos/geopandas/geopandas/branches{/branch}","tags_url":"https://api.github.com/repos/geopandas/geopandas/tags","blobs_url":"https://api.github.com/repos/geopandas/geopandas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geopandas/geopandas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geopandas/geopandas/git/refs{/sha}","trees_url":"https://api.github.com/repos/geopandas/geopandas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geopandas/geopandas/statuses/{sha}","languages_url":"https://api.github.com/repos/geopandas/geopandas/languages","stargazers_url":"https://api.github.com/repos/geopandas/geopandas/stargazers","contributors_url":"https://api.github.com/repos/geopandas/geopandas/contributors","subscribers_url":"https://api.github.com/repos/geopandas/geopandas/subscribers","subscription_url":"https://api.github.com/repos/geopandas/geopandas/subscription","commits_url":"https://api.github.com/repos/geopandas/geopandas/commits{/sha}","git_commits_url":"https://api.github.com/repos/geopandas/geopandas/git/commits{/sha}","comments_url":"https://api.github.com/repos/geopandas/geopandas/comments{/number}","issue_comment_url":"https://api.github.com/repos/geopandas/geopandas/issues/comments{/number}","contents_url":"https://api.github.com/repos/geopandas/geopandas/contents/{+path}","compare_url":"https://api.github.com/repos/geopandas/geopandas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geopandas/geopandas/merges","archive_url":"https://api.github.com/repos/geopandas/geopandas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geopandas/geopandas/downloads","issues_url":"https://api.github.com/repos/geopandas/geopandas/issues{/number}","pulls_url":"https://api.github.com/repos/geopandas/geopandas/pulls{/number}","milestones_url":"https://api.github.com/repos/geopandas/geopandas/milestones{/number}","notifications_url":"https://api.github.com/repos/geopandas/geopandas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geopandas/geopandas/labels{/name}","releases_url":"https://api.github.com/repos/geopandas/geopandas/releases{/id}","deployments_url":"https://api.github.com/repos/geopandas/geopandas/deployments","created_at":"2013-06-27T17:03:47Z","updated_at":"2017-08-01T19:54:42Z","pushed_at":"2017-08-01T15:43:21Z","git_url":"git://github.com/geopandas/geopandas.git","ssh_url":"git@github.com:geopandas/geopandas.git","clone_url":"https://github.com/geopandas/geopandas.git","svn_url":"https://github.com/geopandas/geopandas","homepage":"","size":4783,"stargazers_count":784,"watchers_count":784,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":157,"mirror_url":null,"open_issues_count":124,"forks":157,"open_issues":124,"watchers":784,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/467"},"html":{"href":"https://github.com/geopandas/geopandas/pull/467"},"issue":{"href":"https://api.github.com/repos/geopandas/geopandas/issues/467"},"comments":{"href":"https://api.github.com/repos/geopandas/geopandas/issues/467/comments"},"review_comments":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/467/comments"},"review_comment":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/467/commits"},"statuses":{"href":"https://api.github.com/repos/geopandas/geopandas/statuses/197846e70f16d0c7c8be163aeb1e5ff2ef9d2468"}}}}
{"actor":{"display_login":"mrocklin"}}