payload: {"action":"created","comment":{"url":"https://api.github.com/repos/stfc/PSyclone/pulls/comments/322812461","pull_request_review_id":286242172,"id":322812461,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyMjgxMjQ2MQ==","diff_hunk":"@@ -36,58 +36,55 @@\n '''Example wrapper to run PSyclone generated SIR code in DAWN.'''\n \n import textwrap\n-import sys\n-import argparse\n-import ctypes\n import os.path\n from optparse import OptionParser\n-from ctypes import *\n-from config import __dawn_install_module__, __dawn_install_dawnclib__\n+from ctypes import c_char_p, CDLL\n+from config import __dawn_install_dawnclib__\n from dawn import *\n from dawn import sir_printer\n \n-dawn = CDLL(__dawn_install_dawnclib__)\n+DAWN = CDLL(__dawn_install_dawnclib__)\n \n # PSyclone code start\n # PSyclone code end\n \n-parser = OptionParser()\n-parser.add_option(\"-v\", \"--verbose\",\n+PARSER = OptionParser()\n+PARSER.add_option(\"-v\", \"--verbose\",\n                   action=\"store_true\", dest=\"verbose\", default=False,\n                   help=\"print the SIR\")\n \n-(options, args) = parser.parse_args()\n+(OPTIONS, _) = PARSER.parse_args()\n \n \n-## Print the SIR to stdout only in verbose mode\n-if options.verbose:\n+# Print the SIR to stdout only in verbose mode\n+if OPTIONS.verbose:\n     T = textwrap.TextWrapper(initial_indent=' '*1, width=120,\n                              subsequent_indent=' '*1)\n-    des = sir_printer.SIRPrinter()\n+    DES = sir_printer.SIRPrinter()\n \n-    #  des.visitGlobalVariables(hir.global_variables)\n+    # DES.visit_global_variables(hir.global_variables)\n \n     for stencil in hir.stencils:\n-        des.visitStencil(stencil)\n+        DES.visit_stencil(stencil)\n \n # serialize the hir to pass it to the compiler\n-hirstr = hir.SerializeToString()\n+HIR_STR = hir.SerializeToString()\n \n # create the options to control the compiler\n-options = dawn.dawnOptionsCreate()\n+DAWN_OPTIONS = DAWN.dawnOptionsCreate()\n # we set the backend of the compiler to cuda\n-backend = dawn.dawnOptionsEntryCreateString(\"cuda\".encode('utf-8'))\n-dawn.dawnOptionsSet(options, \"Backend\".encode('utf-8'), backend)\n+BACKEND = DAWN.dawnOptionsEntryCreateString(\"cuda\".encode('utf-8'))\n+DAWN.dawnOptionsSet(DAWN_OPTIONS, \"Backend\".encode('utf-8'), BACKEND)\n \n # call the compiler that generates a translation unit\n-tu = dawn.dawnCompile(hirstr, len(hirstr), options)\n-b_stencilName = stencilname.encode('utf-8')\n+TRANS_UNIT = DAWN.dawnCompile(HIR_STR, len(HIR_STR), DAWN_OPTIONS)\n+B_STENCIL_NAME = stencil_name.encode('utf-8')\n # get the code of the translation unit for the given stencil\n-code = dawn.dawnTranslationUnitGetStencil(tu, b_stencilName)\n+CODE = DAWN.dawnTranslationUnitGetStencil(TRANS_UNIT, B_STENCIL_NAME)\n \n # write to file\n-f = open(os.path.dirname(os.path.realpath(__file__)) +\n-         \"/data/\" + stencilname + \".cpp\", \"w\")\n-f.write(ctypes.c_char_p(code).value.decode(\"utf-8\"))\n+MY_FILE = open(os.path.join(os.path.dirname(os.path.realpath(__file__)),\n+               stencil_name + \".cpp\"), \"w\")","path":"examples/nemo/eg4/dawn_script.py","position":87,"original_position":76,"commit_id":"ae973ec2b8172ff386dbdf2eb4a0912287eb6bb0","original_commit_id":"ae973ec2b8172ff386dbdf2eb4a0912287eb6bb0","user":{"login":"rupertford","id":7383165,"node_id":"MDQ6VXNlcjczODMxNjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7383165?v=4","gravatar_id":"","url":"https://api.github.com/users/rupertford","html_url":"https://github.com/rupertford","followers_url":"https://api.github.com/users/rupertford/followers","following_url":"https://api.github.com/users/rupertford/following{/other_user}","gists_url":"https://api.github.com/users/rupertford/gists{/gist_id}","starred_url":"https://api.github.com/users/rupertford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupertford/subscriptions","organizations_url":"https://api.github.com/users/rupertford/orgs","repos_url":"https://api.github.com/users/rupertford/repos","events_url":"https://api.github.com/users/rupertford/events{/privacy}","received_events_url":"https://api.github.com/users/rupertford/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2019-09-10T15:28:19Z","updated_at":"2019-09-10T15:28:19Z","html_url":"https://github.com/stfc/PSyclone/pull/466#discussion_r322812461","pull_request_url":"https://api.github.com/repos/stfc/PSyclone/pulls/466","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/stfc/PSyclone/pulls/comments/322812461"},"html":{"href":"https://github.com/stfc/PSyclone/pull/466#discussion_r322812461"},"pull_request":{"href":"https://api.github.com/repos/stfc/PSyclone/pulls/466"}},"in_reply_to_id":322631606},"pull_request":{"url":"https://api.github.com/repos/stfc/PSyclone/pulls/466","id":305208165,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA1MjA4MTY1","html_url":"https://github.com/stfc/PSyclone/pull/466","diff_url":"https://github.com/stfc/PSyclone/pull/466.diff","patch_url":"https://github.com/stfc/PSyclone/pull/466.patch","issue_url":"https://api.github.com/repos/stfc/PSyclone/issues/466","number":466,"state":"open","locked":false,"title":"PSyIR to SIR","user":{"login":"rupertford","id":7383165,"node_id":"MDQ6VXNlcjczODMxNjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7383165?v=4","gravatar_id":"","url":"https://api.github.com/users/rupertford","html_url":"https://github.com/rupertford","followers_url":"https://api.github.com/users/rupertford/followers","following_url":"https://api.github.com/users/rupertford/following{/other_user}","gists_url":"https://api.github.com/users/rupertford/gists{/gist_id}","starred_url":"https://api.github.com/users/rupertford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupertford/subscriptions","organizations_url":"https://api.github.com/users/rupertford/orgs","repos_url":"https://api.github.com/users/rupertford/repos","events_url":"https://api.github.com/users/rupertford/events{/privacy}","received_events_url":"https://api.github.com/users/rupertford/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-08-07T15:35:33Z","updated_at":"2019-09-10T15:28:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e29c6816411b62237c2a720c5f78923284a43e1","assignee":{"login":"rupertford","id":7383165,"node_id":"MDQ6VXNlcjczODMxNjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7383165?v=4","gravatar_id":"","url":"https://api.github.com/users/rupertford","html_url":"https://github.com/rupertford","followers_url":"https://api.github.com/users/rupertford/followers","following_url":"https://api.github.com/users/rupertford/following{/other_user}","gists_url":"https://api.github.com/users/rupertford/gists{/gist_id}","starred_url":"https://api.github.com/users/rupertford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupertford/subscriptions","organizations_url":"https://api.github.com/users/rupertford/orgs","repos_url":"https://api.github.com/users/rupertford/repos","events_url":"https://api.github.com/users/rupertford/events{/privacy}","received_events_url":"https://api.github.com/users/rupertford/received_events","type":"User","site_admin":false},"assignees":[{"login":"rupertford","id":7383165,"node_id":"MDQ6VXNlcjczODMxNjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7383165?v=4","gravatar_id":"","url":"https://api.github.com/users/rupertford","html_url":"https://github.com/rupertford","followers_url":"https://api.github.com/users/rupertford/followers","following_url":"https://api.github.com/users/rupertford/following{/other_user}","gists_url":"https://api.github.com/users/rupertford/gists{/gist_id}","starred_url":"https://api.github.com/users/rupertford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupertford/subscriptions","organizations_url":"https://api.github.com/users/rupertford/orgs","repos_url":"https://api.github.com/users/rupertford/repos","events_url":"https://api.github.com/users/rupertford/events{/privacy}","received_events_url":"https://api.github.com/users/rupertford/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"sergisiso","id":1449555,"node_id":"MDQ6VXNlcjE0NDk1NTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1449555?v=4","gravatar_id":"","url":"https://api.github.com/users/sergisiso","html_url":"https://github.com/sergisiso","followers_url":"https://api.github.com/users/sergisiso/followers","following_url":"https://api.github.com/users/sergisiso/following{/other_user}","gists_url":"https://api.github.com/users/sergisiso/gists{/gist_id}","starred_url":"https://api.github.com/users/sergisiso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergisiso/subscriptions","organizations_url":"https://api.github.com/users/sergisiso/orgs","repos_url":"https://api.github.com/users/sergisiso/repos","events_url":"https://api.github.com/users/sergisiso/events{/privacy}","received_events_url":"https://api.github.com/users/sergisiso/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":801586449,"node_id":"MDU6TGFiZWw4MDE1ODY0NDk=","url":"https://api.github.com/repos/stfc/PSyclone/labels/reviewed%20with%20actions","name":"reviewed with actions","color":"14e2b9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/stfc/PSyclone/pulls/466/commits","review_comments_url":"https://api.github.com/repos/stfc/PSyclone/pulls/466/comments","review_comment_url":"https://api.github.com/repos/stfc/PSyclone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stfc/PSyclone/issues/466/comments","statuses_url":"https://api.github.com/repos/stfc/PSyclone/statuses/ae973ec2b8172ff386dbdf2eb4a0912287eb6bb0","head":{"label":"stfc:sir_backend","ref":"sir_backend","sha":"ae973ec2b8172ff386dbdf2eb4a0912287eb6bb0","user":{"login":"stfc","id":3727936,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3Mjc5MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/3727936?v=4","gravatar_id":"","url":"https://api.github.com/users/stfc","html_url":"https://github.com/stfc","followers_url":"https://api.github.com/users/stfc/followers","following_url":"https://api.github.com/users/stfc/following{/other_user}","gists_url":"https://api.github.com/users/stfc/gists{/gist_id}","starred_url":"https://api.github.com/users/stfc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stfc/subscriptions","organizations_url":"https://api.github.com/users/stfc/orgs","repos_url":"https://api.github.com/users/stfc/repos","events_url":"https://api.github.com/users/stfc/events{/privacy}","received_events_url":"https://api.github.com/users/stfc/received_events","type":"Organization","site_admin":false},"repo":{"id":83541466,"node_id":"MDEwOlJlcG9zaXRvcnk4MzU0MTQ2Ng==","name":"PSyclone","full_name":"stfc/PSyclone","private":false,"owner":{"login":"stfc","id":3727936,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3Mjc5MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/3727936?v=4","gravatar_id":"","url":"https://api.github.com/users/stfc","html_url":"https://github.com/stfc","followers_url":"https://api.github.com/users/stfc/followers","following_url":"https://api.github.com/users/stfc/following{/other_user}","gists_url":"https://api.github.com/users/stfc/gists{/gist_id}","starred_url":"https://api.github.com/users/stfc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stfc/subscriptions","organizations_url":"https://api.github.com/users/stfc/orgs","repos_url":"https://api.github.com/users/stfc/repos","events_url":"https://api.github.com/users/stfc/events{/privacy}","received_events_url":"https://api.github.com/users/stfc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/stfc/PSyclone","description":"Domain-specific compiler for Finite Difference/Volume/Element Earth-system models in Fortran","fork":false,"url":"https://api.github.com/repos/stfc/PSyclone","forks_url":"https://api.github.com/repos/stfc/PSyclone/forks","keys_url":"https://api.github.com/repos/stfc/PSyclone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stfc/PSyclone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stfc/PSyclone/teams","hooks_url":"https://api.github.com/repos/stfc/PSyclone/hooks","issue_events_url":"https://api.github.com/repos/stfc/PSyclone/issues/events{/number}","events_url":"https://api.github.com/repos/stfc/PSyclone/events","assignees_url":"https://api.github.com/repos/stfc/PSyclone/assignees{/user}","branches_url":"https://api.github.com/repos/stfc/PSyclone/branches{/branch}","tags_url":"https://api.github.com/repos/stfc/PSyclone/tags","blobs_url":"https://api.github.com/repos/stfc/PSyclone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stfc/PSyclone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stfc/PSyclone/git/refs{/sha}","trees_url":"https://api.github.com/repos/stfc/PSyclone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stfc/PSyclone/statuses/{sha}","languages_url":"https://api.github.com/repos/stfc/PSyclone/languages","stargazers_url":"https://api.github.com/repos/stfc/PSyclone/stargazers","contributors_url":"https://api.github.com/repos/stfc/PSyclone/contributors","subscribers_url":"https://api.github.com/repos/stfc/PSyclone/subscribers","subscription_url":"https://api.github.com/repos/stfc/PSyclone/subscription","commits_url":"https://api.github.com/repos/stfc/PSyclone/commits{/sha}","git_commits_url":"https://api.github.com/repos/stfc/PSyclone/git/commits{/sha}","comments_url":"https://api.github.com/repos/stfc/PSyclone/comments{/number}","issue_comment_url":"https://api.github.com/repos/stfc/PSyclone/issues/comments{/number}","contents_url":"https://api.github.com/repos/stfc/PSyclone/contents/{+path}","compare_url":"https://api.github.com/repos/stfc/PSyclone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stfc/PSyclone/merges","archive_url":"https://api.github.com/repos/stfc/PSyclone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stfc/PSyclone/downloads","issues_url":"https://api.github.com/repos/stfc/PSyclone/issues{/number}","pulls_url":"https://api.github.com/repos/stfc/PSyclone/pulls{/number}","milestones_url":"https://api.github.com/repos/stfc/PSyclone/milestones{/number}","notifications_url":"https://api.github.com/repos/stfc/PSyclone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stfc/PSyclone/labels{/name}","releases_url":"https://api.github.com/repos/stfc/PSyclone/releases{/id}","deployments_url":"https://api.github.com/repos/stfc/PSyclone/deployments","created_at":"2017-03-01T10:17:58Z","updated_at":"2019-09-05T16:03:15Z","pushed_at":"2019-09-10T15:05:13Z","git_url":"git://github.com/stfc/PSyclone.git","ssh_url":"git@github.com:stfc/PSyclone.git","clone_url":"https://github.com/stfc/PSyclone.git","svn_url":"https://github.com/stfc/PSyclone","homepage":null,"size":67800,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":161,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5,"open_issues":161,"watchers":27,"default_branch":"master"}},"base":{"label":"stfc:master","ref":"master","sha":"4b23936338a69702d4f28bf30b75fdd859ea10d3","user":{"login":"stfc","id":3727936,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3Mjc5MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/3727936?v=4","gravatar_id":"","url":"https://api.github.com/users/stfc","html_url":"https://github.com/stfc","followers_url":"https://api.github.com/users/stfc/followers","following_url":"https://api.github.com/users/stfc/following{/other_user}","gists_url":"https://api.github.com/users/stfc/gists{/gist_id}","starred_url":"https://api.github.com/users/stfc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stfc/subscriptions","organizations_url":"https://api.github.com/users/stfc/orgs","repos_url":"https://api.github.com/users/stfc/repos","events_url":"https://api.github.com/users/stfc/events{/privacy}","received_events_url":"https://api.github.com/users/stfc/received_events","type":"Organization","site_admin":false},"repo":{"id":83541466,"node_id":"MDEwOlJlcG9zaXRvcnk4MzU0MTQ2Ng==","name":"PSyclone","full_name":"stfc/PSyclone","private":false,"owner":{"login":"stfc","id":3727936,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3Mjc5MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/3727936?v=4","gravatar_id":"","url":"https://api.github.com/users/stfc","html_url":"https://github.com/stfc","followers_url":"https://api.github.com/users/stfc/followers","following_url":"https://api.github.com/users/stfc/following{/other_user}","gists_url":"https://api.github.com/users/stfc/gists{/gist_id}","starred_url":"https://api.github.com/users/stfc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stfc/subscriptions","organizations_url":"https://api.github.com/users/stfc/orgs","repos_url":"https://api.github.com/users/stfc/repos","events_url":"https://api.github.com/users/stfc/events{/privacy}","received_events_url":"https://api.github.com/users/stfc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/stfc/PSyclone","description":"Domain-specific compiler for Finite Difference/Volume/Element Earth-system models in Fortran","fork":false,"url":"https://api.github.com/repos/stfc/PSyclone","forks_url":"https://api.github.com/repos/stfc/PSyclone/forks","keys_url":"https://api.github.com/repos/stfc/PSyclone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stfc/PSyclone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stfc/PSyclone/teams","hooks_url":"https://api.github.com/repos/stfc/PSyclone/hooks","issue_events_url":"https://api.github.com/repos/stfc/PSyclone/issues/events{/number}","events_url":"https://api.github.com/repos/stfc/PSyclone/events","assignees_url":"https://api.github.com/repos/stfc/PSyclone/assignees{/user}","branches_url":"https://api.github.com/repos/stfc/PSyclone/branches{/branch}","tags_url":"https://api.github.com/repos/stfc/PSyclone/tags","blobs_url":"https://api.github.com/repos/stfc/PSyclone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stfc/PSyclone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stfc/PSyclone/git/refs{/sha}","trees_url":"https://api.github.com/repos/stfc/PSyclone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stfc/PSyclone/statuses/{sha}","languages_url":"https://api.github.com/repos/stfc/PSyclone/languages","stargazers_url":"https://api.github.com/repos/stfc/PSyclone/stargazers","contributors_url":"https://api.github.com/repos/stfc/PSyclone/contributors","subscribers_url":"https://api.github.com/repos/stfc/PSyclone/subscribers","subscription_url":"https://api.github.com/repos/stfc/PSyclone/subscription","commits_url":"https://api.github.com/repos/stfc/PSyclone/commits{/sha}","git_commits_url":"https://api.github.com/repos/stfc/PSyclone/git/commits{/sha}","comments_url":"https://api.github.com/repos/stfc/PSyclone/comments{/number}","issue_comment_url":"https://api.github.com/repos/stfc/PSyclone/issues/comments{/number}","contents_url":"https://api.github.com/repos/stfc/PSyclone/contents/{+path}","compare_url":"https://api.github.com/repos/stfc/PSyclone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stfc/PSyclone/merges","archive_url":"https://api.github.com/repos/stfc/PSyclone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stfc/PSyclone/downloads","issues_url":"https://api.github.com/repos/stfc/PSyclone/issues{/number}","pulls_url":"https://api.github.com/repos/stfc/PSyclone/pulls{/number}","milestones_url":"https://api.github.com/repos/stfc/PSyclone/milestones{/number}","notifications_url":"https://api.github.com/repos/stfc/PSyclone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stfc/PSyclone/labels{/name}","releases_url":"https://api.github.com/repos/stfc/PSyclone/releases{/id}","deployments_url":"https://api.github.com/repos/stfc/PSyclone/deployments","created_at":"2017-03-01T10:17:58Z","updated_at":"2019-09-05T16:03:15Z","pushed_at":"2019-09-10T15:05:13Z","git_url":"git://github.com/stfc/PSyclone.git","ssh_url":"git@github.com:stfc/PSyclone.git","clone_url":"https://github.com/stfc/PSyclone.git","svn_url":"https://github.com/stfc/PSyclone","homepage":null,"size":67800,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":161,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5,"open_issues":161,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stfc/PSyclone/pulls/466"},"html":{"href":"https://github.com/stfc/PSyclone/pull/466"},"issue":{"href":"https://api.github.com/repos/stfc/PSyclone/issues/466"},"comments":{"href":"https://api.github.com/repos/stfc/PSyclone/issues/466/comments"},"review_comments":{"href":"https://api.github.com/repos/stfc/PSyclone/pulls/466/comments"},"review_comment":{"href":"https://api.github.com/repos/stfc/PSyclone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stfc/PSyclone/pulls/466/commits"},"statuses":{"href":"https://api.github.com/repos/stfc/PSyclone/statuses/ae973ec2b8172ff386dbdf2eb4a0912287eb6bb0"}},"author_association":"COLLABORATOR"}}
other: {"actor":{"display_login":"rupertford"}}