{"action":"created","comment":{"url":"https://api.github.com/repos/opesci/devito/pulls/comments/239491129","pull_request_review_id":182288786,"id":239491129,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTQ5MTEyOQ==","diff_hunk":"@@ -0,0 +1,74 @@\n+from devito import Dimension, TimeFunction\n+from devito.symbolics import Macro\n+from devito.types import Indexed, Array\n+\n+from devito.ops.utils import namespace\n+\n+\n+class OPSNodeFactory():\n+    \"\"\"\n+    Generates OPS nodes for building an OPS expression.\n+\n+    Examples\n+    --------\n+    >>> a = OPSNodeFactory()\n+    >>> a.new_symbol('symbol_name')\n+    symbol_name\n+    \"\"\"\n+\n+    def __init__(self):\n+        self.ops_grids = {}\n+\n+    def new_grid(self, indexed):\n+        \"\"\"\n+        Creates an :class:`Indexed` node using OPS representation.\n+        If the pair grid name and time dimension were alredy created, it will return\n+        the stored value associated with this pair.\n+\n+        Parameters\n+        ----------\n+        indexed : :class:`Indexed`\n+            Indexed object using devito representation.\n+\n+        Returns\n+        -------\n+        :class:`Indexed`\n+            Indexed node using OPS representation.\n+        \"\"\"\n+\n+        def getDimensionsDisplacement(dimension):\n+            if dimension.is_Symbol:\n+                if dimension.is_Dimension:\n+                    return 0\n+                return dimension\n+            elif dimension.is_Integer:\n+                return dimension\n+            else:\n+                lhs, rhs = dimension.as_two_terms()\n+                return getDimensionsDisplacement(lhs) + getDimensionsDisplacement(rhs)\n+\n+        # Builds the grid identifier.\n+        grid_id = '%s%s' % (indexed.name, indexed.indices[TimeFunction._time_position])\n+\n+        if grid_id not in self.ops_grids:\n+            # Creates the indexed object.\n+            grid = Array(name=grid_id,\n+                         dimensions=[Dimension(name=namespace['ops_acc'])],\n+                         dtype=indexed.dtype)\n+\n+            self.ops_grids[grid_id] = grid\n+        else:\n+            grid = self.ops_grids[grid_id]\n+\n+        space_dim = [e for i, e in enumerate(","path":"devito/ops/node_factory.py","position":63,"original_position":63,"commit_id":"3f95f5f2b2e09923c32f792751fef9519a5c1068","original_commit_id":"3f95f5f2b2e09923c32f792751fef9519a5c1068","user":{"login":"FabioLuporini","id":478143,"node_id":"MDQ6VXNlcjQ3ODE0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/478143?v=4","gravatar_id":"","url":"https://api.github.com/users/FabioLuporini","html_url":"https://github.com/FabioLuporini","followers_url":"https://api.github.com/users/FabioLuporini/followers","following_url":"https://api.github.com/users/FabioLuporini/following{/other_user}","gists_url":"https://api.github.com/users/FabioLuporini/gists{/gist_id}","starred_url":"https://api.github.com/users/FabioLuporini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FabioLuporini/subscriptions","organizations_url":"https://api.github.com/users/FabioLuporini/orgs","repos_url":"https://api.github.com/users/FabioLuporini/repos","events_url":"https://api.github.com/users/FabioLuporini/events{/privacy}","received_events_url":"https://api.github.com/users/FabioLuporini/received_events","type":"User","site_admin":false},"body":"I was confused by the variable name, then. Can you rather call it `space_indices`","created_at":"2018-12-06T15:17:38Z","updated_at":"2018-12-06T15:17:39Z","html_url":"https://github.com/opesci/devito/pull/722#discussion_r239491129","pull_request_url":"https://api.github.com/repos/opesci/devito/pulls/722","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/opesci/devito/pulls/comments/239491129"},"html":{"href":"https://github.com/opesci/devito/pull/722#discussion_r239491129"},"pull_request":{"href":"https://api.github.com/repos/opesci/devito/pulls/722"}},"in_reply_to_id":239360033},"pull_request":{"url":"https://api.github.com/repos/opesci/devito/pulls/722","id":233704920,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNzA0OTIw","html_url":"https://github.com/opesci/devito/pull/722","diff_url":"https://github.com/opesci/devito/pull/722.diff","patch_url":"https://github.com/opesci/devito/pull/722.patch","issue_url":"https://api.github.com/repos/opesci/devito/issues/722","number":722,"state":"open","locked":false,"title":"OPS expressions","user":{"login":"vmickus","id":3579129,"node_id":"MDQ6VXNlcjM1NzkxMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/3579129?v=4","gravatar_id":"","url":"https://api.github.com/users/vmickus","html_url":"https://github.com/vmickus","followers_url":"https://api.github.com/users/vmickus/followers","following_url":"https://api.github.com/users/vmickus/following{/other_user}","gists_url":"https://api.github.com/users/vmickus/gists{/gist_id}","starred_url":"https://api.github.com/users/vmickus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmickus/subscriptions","organizations_url":"https://api.github.com/users/vmickus/orgs","repos_url":"https://api.github.com/users/vmickus/repos","events_url":"https://api.github.com/users/vmickus/events{/privacy}","received_events_url":"https://api.github.com/users/vmickus/received_events","type":"User","site_admin":false},"body":"Changed location of find_offloadable_trees.\r\nCreated simple test for ops expressions.","created_at":"2018-11-26T21:37:57Z","updated_at":"2018-12-06T15:17:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9417890555bcec3920c67867cbf2e0019ad44213","assignee":{"login":"georgebisbas","id":19509795,"node_id":"MDQ6VXNlcjE5NTA5Nzk1","avatar_url":"https://avatars3.githubusercontent.com/u/19509795?v=4","gravatar_id":"","url":"https://api.github.com/users/georgebisbas","html_url":"https://github.com/georgebisbas","followers_url":"https://api.github.com/users/georgebisbas/followers","following_url":"https://api.github.com/users/georgebisbas/following{/other_user}","gists_url":"https://api.github.com/users/georgebisbas/gists{/gist_id}","starred_url":"https://api.github.com/users/georgebisbas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgebisbas/subscriptions","organizations_url":"https://api.github.com/users/georgebisbas/orgs","repos_url":"https://api.github.com/users/georgebisbas/repos","events_url":"https://api.github.com/users/georgebisbas/events{/privacy}","received_events_url":"https://api.github.com/users/georgebisbas/received_events","type":"User","site_admin":false},"assignees":[{"login":"georgebisbas","id":19509795,"node_id":"MDQ6VXNlcjE5NTA5Nzk1","avatar_url":"https://avatars3.githubusercontent.com/u/19509795?v=4","gravatar_id":"","url":"https://api.github.com/users/georgebisbas","html_url":"https://github.com/georgebisbas","followers_url":"https://api.github.com/users/georgebisbas/followers","following_url":"https://api.github.com/users/georgebisbas/following{/other_user}","gists_url":"https://api.github.com/users/georgebisbas/gists{/gist_id}","starred_url":"https://api.github.com/users/georgebisbas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgebisbas/subscriptions","organizations_url":"https://api.github.com/users/georgebisbas/orgs","repos_url":"https://api.github.com/users/georgebisbas/repos","events_url":"https://api.github.com/users/georgebisbas/events{/privacy}","received_events_url":"https://api.github.com/users/georgebisbas/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opesci/devito/pulls/722/commits","review_comments_url":"https://api.github.com/repos/opesci/devito/pulls/722/comments","review_comment_url":"https://api.github.com/repos/opesci/devito/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opesci/devito/issues/722/comments","statuses_url":"https://api.github.com/repos/opesci/devito/statuses/3f95f5f2b2e09923c32f792751fef9519a5c1068","head":{"label":"vmickus:ops-expressions","ref":"ops-expressions","sha":"3f95f5f2b2e09923c32f792751fef9519a5c1068","user":{"login":"vmickus","id":3579129,"node_id":"MDQ6VXNlcjM1NzkxMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/3579129?v=4","gravatar_id":"","url":"https://api.github.com/users/vmickus","html_url":"https://github.com/vmickus","followers_url":"https://api.github.com/users/vmickus/followers","following_url":"https://api.github.com/users/vmickus/following{/other_user}","gists_url":"https://api.github.com/users/vmickus/gists{/gist_id}","starred_url":"https://api.github.com/users/vmickus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmickus/subscriptions","organizations_url":"https://api.github.com/users/vmickus/orgs","repos_url":"https://api.github.com/users/vmickus/repos","events_url":"https://api.github.com/users/vmickus/events{/privacy}","received_events_url":"https://api.github.com/users/vmickus/received_events","type":"User","site_admin":false},"repo":{"id":136219995,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYyMTk5OTU=","name":"devito","full_name":"vmickus/devito","private":false,"owner":{"login":"vmickus","id":3579129,"node_id":"MDQ6VXNlcjM1NzkxMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/3579129?v=4","gravatar_id":"","url":"https://api.github.com/users/vmickus","html_url":"https://github.com/vmickus","followers_url":"https://api.github.com/users/vmickus/followers","following_url":"https://api.github.com/users/vmickus/following{/other_user}","gists_url":"https://api.github.com/users/vmickus/gists{/gist_id}","starred_url":"https://api.github.com/users/vmickus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmickus/subscriptions","organizations_url":"https://api.github.com/users/vmickus/orgs","repos_url":"https://api.github.com/users/vmickus/repos","events_url":"https://api.github.com/users/vmickus/events{/privacy}","received_events_url":"https://api.github.com/users/vmickus/received_events","type":"User","site_admin":false},"html_url":"https://github.com/vmickus/devito","description":"Code generation framework for automated finite difference computation","fork":true,"url":"https://api.github.com/repos/vmickus/devito","forks_url":"https://api.github.com/repos/vmickus/devito/forks","keys_url":"https://api.github.com/repos/vmickus/devito/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmickus/devito/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmickus/devito/teams","hooks_url":"https://api.github.com/repos/vmickus/devito/hooks","issue_events_url":"https://api.github.com/repos/vmickus/devito/issues/events{/number}","events_url":"https://api.github.com/repos/vmickus/devito/events","assignees_url":"https://api.github.com/repos/vmickus/devito/assignees{/user}","branches_url":"https://api.github.com/repos/vmickus/devito/branches{/branch}","tags_url":"https://api.github.com/repos/vmickus/devito/tags","blobs_url":"https://api.github.com/repos/vmickus/devito/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmickus/devito/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmickus/devito/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmickus/devito/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmickus/devito/statuses/{sha}","languages_url":"https://api.github.com/repos/vmickus/devito/languages","stargazers_url":"https://api.github.com/repos/vmickus/devito/stargazers","contributors_url":"https://api.github.com/repos/vmickus/devito/contributors","subscribers_url":"https://api.github.com/repos/vmickus/devito/subscribers","subscription_url":"https://api.github.com/repos/vmickus/devito/subscription","commits_url":"https://api.github.com/repos/vmickus/devito/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmickus/devito/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmickus/devito/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmickus/devito/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmickus/devito/contents/{+path}","compare_url":"https://api.github.com/repos/vmickus/devito/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmickus/devito/merges","archive_url":"https://api.github.com/repos/vmickus/devito/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmickus/devito/downloads","issues_url":"https://api.github.com/repos/vmickus/devito/issues{/number}","pulls_url":"https://api.github.com/repos/vmickus/devito/pulls{/number}","milestones_url":"https://api.github.com/repos/vmickus/devito/milestones{/number}","notifications_url":"https://api.github.com/repos/vmickus/devito/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmickus/devito/labels{/name}","releases_url":"https://api.github.com/repos/vmickus/devito/releases{/id}","deployments_url":"https://api.github.com/repos/vmickus/devito/deployments","created_at":"2018-06-05T18:42:29Z","updated_at":"2018-12-06T14:22:33Z","pushed_at":"2018-12-06T14:22:23Z","git_url":"git://github.com/vmickus/devito.git","ssh_url":"git@github.com:vmickus/devito.git","clone_url":"https://github.com/vmickus/devito.git","svn_url":"https://github.com/vmickus/devito","homepage":"http://www.devitoproject.org","size":62189,"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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opesci:master","ref":"master","sha":"7007690e7ff913d4bbf2ca0361705fb198c5121b","user":{"login":"opesci","id":10018551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDE4NTUx","avatar_url":"https://avatars1.githubusercontent.com/u/10018551?v=4","gravatar_id":"","url":"https://api.github.com/users/opesci","html_url":"https://github.com/opesci","followers_url":"https://api.github.com/users/opesci/followers","following_url":"https://api.github.com/users/opesci/following{/other_user}","gists_url":"https://api.github.com/users/opesci/gists{/gist_id}","starred_url":"https://api.github.com/users/opesci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opesci/subscriptions","organizations_url":"https://api.github.com/users/opesci/orgs","repos_url":"https://api.github.com/users/opesci/repos","events_url":"https://api.github.com/users/opesci/events{/privacy}","received_events_url":"https://api.github.com/users/opesci/received_events","type":"Organization","site_admin":false},"repo":{"id":54585666,"node_id":"MDEwOlJlcG9zaXRvcnk1NDU4NTY2Ng==","name":"devito","full_name":"opesci/devito","private":false,"owner":{"login":"opesci","id":10018551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDE4NTUx","avatar_url":"https://avatars1.githubusercontent.com/u/10018551?v=4","gravatar_id":"","url":"https://api.github.com/users/opesci","html_url":"https://github.com/opesci","followers_url":"https://api.github.com/users/opesci/followers","following_url":"https://api.github.com/users/opesci/following{/other_user}","gists_url":"https://api.github.com/users/opesci/gists{/gist_id}","starred_url":"https://api.github.com/users/opesci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opesci/subscriptions","organizations_url":"https://api.github.com/users/opesci/orgs","repos_url":"https://api.github.com/users/opesci/repos","events_url":"https://api.github.com/users/opesci/events{/privacy}","received_events_url":"https://api.github.com/users/opesci/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/opesci/devito","description":"Code generation framework for automated finite difference computation","fork":false,"url":"https://api.github.com/repos/opesci/devito","forks_url":"https://api.github.com/repos/opesci/devito/forks","keys_url":"https://api.github.com/repos/opesci/devito/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opesci/devito/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opesci/devito/teams","hooks_url":"https://api.github.com/repos/opesci/devito/hooks","issue_events_url":"https://api.github.com/repos/opesci/devito/issues/events{/number}","events_url":"https://api.github.com/repos/opesci/devito/events","assignees_url":"https://api.github.com/repos/opesci/devito/assignees{/user}","branches_url":"https://api.github.com/repos/opesci/devito/branches{/branch}","tags_url":"https://api.github.com/repos/opesci/devito/tags","blobs_url":"https://api.github.com/repos/opesci/devito/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opesci/devito/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opesci/devito/git/refs{/sha}","trees_url":"https://api.github.com/repos/opesci/devito/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opesci/devito/statuses/{sha}","languages_url":"https://api.github.com/repos/opesci/devito/languages","stargazers_url":"https://api.github.com/repos/opesci/devito/stargazers","contributors_url":"https://api.github.com/repos/opesci/devito/contributors","subscribers_url":"https://api.github.com/repos/opesci/devito/subscribers","subscription_url":"https://api.github.com/repos/opesci/devito/subscription","commits_url":"https://api.github.com/repos/opesci/devito/commits{/sha}","git_commits_url":"https://api.github.com/repos/opesci/devito/git/commits{/sha}","comments_url":"https://api.github.com/repos/opesci/devito/comments{/number}","issue_comment_url":"https://api.github.com/repos/opesci/devito/issues/comments{/number}","contents_url":"https://api.github.com/repos/opesci/devito/contents/{+path}","compare_url":"https://api.github.com/repos/opesci/devito/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opesci/devito/merges","archive_url":"https://api.github.com/repos/opesci/devito/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opesci/devito/downloads","issues_url":"https://api.github.com/repos/opesci/devito/issues{/number}","pulls_url":"https://api.github.com/repos/opesci/devito/pulls{/number}","milestones_url":"https://api.github.com/repos/opesci/devito/milestones{/number}","notifications_url":"https://api.github.com/repos/opesci/devito/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opesci/devito/labels{/name}","releases_url":"https://api.github.com/repos/opesci/devito/releases{/id}","deployments_url":"https://api.github.com/repos/opesci/devito/deployments","created_at":"2016-03-23T18:59:49Z","updated_at":"2018-12-05T13:02:57Z","pushed_at":"2018-12-06T15:08:05Z","git_url":"git://github.com/opesci/devito.git","ssh_url":"git@github.com:opesci/devito.git","clone_url":"https://github.com/opesci/devito.git","svn_url":"https://github.com/opesci/devito","homepage":"http://www.devitoproject.org","size":72671,"stargazers_count":81,"watchers_count":81,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":40,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":33,"open_issues":40,"watchers":81,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opesci/devito/pulls/722"},"html":{"href":"https://github.com/opesci/devito/pull/722"},"issue":{"href":"https://api.github.com/repos/opesci/devito/issues/722"},"comments":{"href":"https://api.github.com/repos/opesci/devito/issues/722/comments"},"review_comments":{"href":"https://api.github.com/repos/opesci/devito/pulls/722/comments"},"review_comment":{"href":"https://api.github.com/repos/opesci/devito/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opesci/devito/pulls/722/commits"},"statuses":{"href":"https://api.github.com/repos/opesci/devito/statuses/3f95f5f2b2e09923c32f792751fef9519a5c1068"}},"author_association":"NONE"}}
{"actor":{"display_login":"FabioLuporini"}}