{"action":"created","comment":{"url":"https://api.github.com/repos/vincentlab/PyFR/pulls/comments/35444439","id":35444439,"diff_hunk":"@@ -0,0 +1,63 @@\n+# -*- coding: utf-8 -*-\n+\n+from collections import OrderedDict\n+\n+import numpy as np\n+\n+from pyfr.plugins.base import BasePlugin\n+\n+\n+class AveragePlugin(BasePlugin):\n+    name = 'average'\n+    systems = ['*']\n+\n+    def __init__(self, *args, **kwargs):\n+        super().__init__(*args, **kwargs)\n+        self.nsteps = self.cfg.getint(self.cfgsect, 'nsteps')\n+        self.writeskip = self.cfg.getint(self.cfgsect, 'writeskip')\n+        self.tout = list(args[0].tout)\n+        self.averages = []\n+        self.solnprev = None\n+        self.tprev = None\n+        self.dtprev = 0\n+        self.prevwrite = args[0].tcurr\n+        self.avglist = OrderedDict()\n+        for (e, p), (name, shape) in args[0].sollist.items():\n+            self.avglist[e + '_avg', p] = (name + '_avg', shape)\n+\n+    def __call__(self, intg):\n+        if not len(self.tout):\n+            return\n+\n+        if (intg.nacptsteps % self.nsteps == 0) or\\","path":"pyfr/plugins/average.py","position":32,"original_position":32,"commit_id":"4233ae2d57be096074a5713d7303cb0379ea7db9","original_commit_id":"4233ae2d57be096074a5713d7303cb0379ea7db9","user":{"login":"FreddieWitherden","id":528611,"avatar_url":"https://avatars.githubusercontent.com/u/528611?v=3","gravatar_id":"","url":"https://api.github.com/users/FreddieWitherden","html_url":"https://github.com/FreddieWitherden","followers_url":"https://api.github.com/users/FreddieWitherden/followers","following_url":"https://api.github.com/users/FreddieWitherden/following{/other_user}","gists_url":"https://api.github.com/users/FreddieWitherden/gists{/gist_id}","starred_url":"https://api.github.com/users/FreddieWitherden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreddieWitherden/subscriptions","organizations_url":"https://api.github.com/users/FreddieWitherden/orgs","repos_url":"https://api.github.com/users/FreddieWitherden/repos","events_url":"https://api.github.com/users/FreddieWitherden/events{/privacy}","received_events_url":"https://api.github.com/users/FreddieWitherden/received_events","type":"User","site_admin":false},"body":"Use of `\\` for line continuation.","created_at":"2015-07-24T17:20:57Z","updated_at":"2015-07-24T17:20:57Z","html_url":"https://github.com/vincentlab/PyFR/pull/69#discussion_r35444439","pull_request_url":"https://api.github.com/repos/vincentlab/PyFR/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/vincentlab/PyFR/pulls/comments/35444439"},"html":{"href":"https://github.com/vincentlab/PyFR/pull/69#discussion_r35444439"},"pull_request":{"href":"https://api.github.com/repos/vincentlab/PyFR/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/vincentlab/PyFR/pulls/69","id":40796120,"html_url":"https://github.com/vincentlab/PyFR/pull/69","diff_url":"https://github.com/vincentlab/PyFR/pull/69.diff","patch_url":"https://github.com/vincentlab/PyFR/pull/69.patch","issue_url":"https://api.github.com/repos/vincentlab/PyFR/issues/69","number":69,"state":"open","locked":false,"title":"This implements an averaging plugin.","user":{"login":"iyer-arvind","id":1291850,"avatar_url":"https://avatars.githubusercontent.com/u/1291850?v=3","gravatar_id":"","url":"https://api.github.com/users/iyer-arvind","html_url":"https://github.com/iyer-arvind","followers_url":"https://api.github.com/users/iyer-arvind/followers","following_url":"https://api.github.com/users/iyer-arvind/following{/other_user}","gists_url":"https://api.github.com/users/iyer-arvind/gists{/gist_id}","starred_url":"https://api.github.com/users/iyer-arvind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iyer-arvind/subscriptions","organizations_url":"https://api.github.com/users/iyer-arvind/orgs","repos_url":"https://api.github.com/users/iyer-arvind/repos","events_url":"https://api.github.com/users/iyer-arvind/events{/privacy}","received_events_url":"https://api.github.com/users/iyer-arvind/received_events","type":"User","site_admin":false},"body":"This implements an averaging plugin which performs windowed averaging\r\nif the solution every 'nsteps' iterations. The output is written to a\r\nseparate file with _avg.pyfrs ending. The writing is skipped every\r\n'writeskip' iterations with respect to the writing of the solutions.\r\nThis makes use of the existing infrastructure of file writing, hence the\r\nserial-h5 options under soln-output influences this plugin writer too.","created_at":"2015-07-24T17:15:34Z","updated_at":"2015-07-24T17:20:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7121e1cb8e5f7b435597fbd208cda85ff1c851a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vincentlab/PyFR/pulls/69/commits","review_comments_url":"https://api.github.com/repos/vincentlab/PyFR/pulls/69/comments","review_comment_url":"https://api.github.com/repos/vincentlab/PyFR/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vincentlab/PyFR/issues/69/comments","statuses_url":"https://api.github.com/repos/vincentlab/PyFR/statuses/4233ae2d57be096074a5713d7303cb0379ea7db9","head":{"label":"iyer-arvind:plugins/average","ref":"plugins/average","sha":"4233ae2d57be096074a5713d7303cb0379ea7db9","user":{"login":"iyer-arvind","id":1291850,"avatar_url":"https://avatars.githubusercontent.com/u/1291850?v=3","gravatar_id":"","url":"https://api.github.com/users/iyer-arvind","html_url":"https://github.com/iyer-arvind","followers_url":"https://api.github.com/users/iyer-arvind/followers","following_url":"https://api.github.com/users/iyer-arvind/following{/other_user}","gists_url":"https://api.github.com/users/iyer-arvind/gists{/gist_id}","starred_url":"https://api.github.com/users/iyer-arvind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iyer-arvind/subscriptions","organizations_url":"https://api.github.com/users/iyer-arvind/orgs","repos_url":"https://api.github.com/users/iyer-arvind/repos","events_url":"https://api.github.com/users/iyer-arvind/events{/privacy}","received_events_url":"https://api.github.com/users/iyer-arvind/received_events","type":"User","site_admin":false},"repo":{"id":28479588,"name":"PyFR","full_name":"iyer-arvind/PyFR","owner":{"login":"iyer-arvind","id":1291850,"avatar_url":"https://avatars.githubusercontent.com/u/1291850?v=3","gravatar_id":"","url":"https://api.github.com/users/iyer-arvind","html_url":"https://github.com/iyer-arvind","followers_url":"https://api.github.com/users/iyer-arvind/followers","following_url":"https://api.github.com/users/iyer-arvind/following{/other_user}","gists_url":"https://api.github.com/users/iyer-arvind/gists{/gist_id}","starred_url":"https://api.github.com/users/iyer-arvind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iyer-arvind/subscriptions","organizations_url":"https://api.github.com/users/iyer-arvind/orgs","repos_url":"https://api.github.com/users/iyer-arvind/repos","events_url":"https://api.github.com/users/iyer-arvind/events{/privacy}","received_events_url":"https://api.github.com/users/iyer-arvind/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iyer-arvind/PyFR","description":"PyFR","fork":true,"url":"https://api.github.com/repos/iyer-arvind/PyFR","forks_url":"https://api.github.com/repos/iyer-arvind/PyFR/forks","keys_url":"https://api.github.com/repos/iyer-arvind/PyFR/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iyer-arvind/PyFR/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iyer-arvind/PyFR/teams","hooks_url":"https://api.github.com/repos/iyer-arvind/PyFR/hooks","issue_events_url":"https://api.github.com/repos/iyer-arvind/PyFR/issues/events{/number}","events_url":"https://api.github.com/repos/iyer-arvind/PyFR/events","assignees_url":"https://api.github.com/repos/iyer-arvind/PyFR/assignees{/user}","branches_url":"https://api.github.com/repos/iyer-arvind/PyFR/branches{/branch}","tags_url":"https://api.github.com/repos/iyer-arvind/PyFR/tags","blobs_url":"https://api.github.com/repos/iyer-arvind/PyFR/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iyer-arvind/PyFR/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iyer-arvind/PyFR/git/refs{/sha}","trees_url":"https://api.github.com/repos/iyer-arvind/PyFR/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iyer-arvind/PyFR/statuses/{sha}","languages_url":"https://api.github.com/repos/iyer-arvind/PyFR/languages","stargazers_url":"https://api.github.com/repos/iyer-arvind/PyFR/stargazers","contributors_url":"https://api.github.com/repos/iyer-arvind/PyFR/contributors","subscribers_url":"https://api.github.com/repos/iyer-arvind/PyFR/subscribers","subscription_url":"https://api.github.com/repos/iyer-arvind/PyFR/subscription","commits_url":"https://api.github.com/repos/iyer-arvind/PyFR/commits{/sha}","git_commits_url":"https://api.github.com/repos/iyer-arvind/PyFR/git/commits{/sha}","comments_url":"https://api.github.com/repos/iyer-arvind/PyFR/comments{/number}","issue_comment_url":"https://api.github.com/repos/iyer-arvind/PyFR/issues/comments{/number}","contents_url":"https://api.github.com/repos/iyer-arvind/PyFR/contents/{+path}","compare_url":"https://api.github.com/repos/iyer-arvind/PyFR/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iyer-arvind/PyFR/merges","archive_url":"https://api.github.com/repos/iyer-arvind/PyFR/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iyer-arvind/PyFR/downloads","issues_url":"https://api.github.com/repos/iyer-arvind/PyFR/issues{/number}","pulls_url":"https://api.github.com/repos/iyer-arvind/PyFR/pulls{/number}","milestones_url":"https://api.github.com/repos/iyer-arvind/PyFR/milestones{/number}","notifications_url":"https://api.github.com/repos/iyer-arvind/PyFR/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iyer-arvind/PyFR/labels{/name}","releases_url":"https://api.github.com/repos/iyer-arvind/PyFR/releases{/id}","created_at":"2014-12-25T11:09:13Z","updated_at":"2015-05-07T14:56:27Z","pushed_at":"2015-07-24T17:13:17Z","git_url":"git://github.com/iyer-arvind/PyFR.git","ssh_url":"git@github.com:iyer-arvind/PyFR.git","clone_url":"https://github.com/iyer-arvind/PyFR.git","svn_url":"https://github.com/iyer-arvind/PyFR","homepage":"","size":2173,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"vincentlab:develop","ref":"develop","sha":"cee08cd29a3c27367e40978736935590ee2fe8a2","user":{"login":"vincentlab","id":3252468,"avatar_url":"https://avatars.githubusercontent.com/u/3252468?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentlab","html_url":"https://github.com/vincentlab","followers_url":"https://api.github.com/users/vincentlab/followers","following_url":"https://api.github.com/users/vincentlab/following{/other_user}","gists_url":"https://api.github.com/users/vincentlab/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentlab/subscriptions","organizations_url":"https://api.github.com/users/vincentlab/orgs","repos_url":"https://api.github.com/users/vincentlab/repos","events_url":"https://api.github.com/users/vincentlab/events{/privacy}","received_events_url":"https://api.github.com/users/vincentlab/received_events","type":"Organization","site_admin":false},"repo":{"id":7652671,"name":"PyFR","full_name":"vincentlab/PyFR","owner":{"login":"vincentlab","id":3252468,"avatar_url":"https://avatars.githubusercontent.com/u/3252468?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentlab","html_url":"https://github.com/vincentlab","followers_url":"https://api.github.com/users/vincentlab/followers","following_url":"https://api.github.com/users/vincentlab/following{/other_user}","gists_url":"https://api.github.com/users/vincentlab/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentlab/subscriptions","organizations_url":"https://api.github.com/users/vincentlab/orgs","repos_url":"https://api.github.com/users/vincentlab/repos","events_url":"https://api.github.com/users/vincentlab/events{/privacy}","received_events_url":"https://api.github.com/users/vincentlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vincentlab/PyFR","description":"PyFR","fork":false,"url":"https://api.github.com/repos/vincentlab/PyFR","forks_url":"https://api.github.com/repos/vincentlab/PyFR/forks","keys_url":"https://api.github.com/repos/vincentlab/PyFR/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vincentlab/PyFR/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vincentlab/PyFR/teams","hooks_url":"https://api.github.com/repos/vincentlab/PyFR/hooks","issue_events_url":"https://api.github.com/repos/vincentlab/PyFR/issues/events{/number}","events_url":"https://api.github.com/repos/vincentlab/PyFR/events","assignees_url":"https://api.github.com/repos/vincentlab/PyFR/assignees{/user}","branches_url":"https://api.github.com/repos/vincentlab/PyFR/branches{/branch}","tags_url":"https://api.github.com/repos/vincentlab/PyFR/tags","blobs_url":"https://api.github.com/repos/vincentlab/PyFR/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vincentlab/PyFR/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vincentlab/PyFR/git/refs{/sha}","trees_url":"https://api.github.com/repos/vincentlab/PyFR/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vincentlab/PyFR/statuses/{sha}","languages_url":"https://api.github.com/repos/vincentlab/PyFR/languages","stargazers_url":"https://api.github.com/repos/vincentlab/PyFR/stargazers","contributors_url":"https://api.github.com/repos/vincentlab/PyFR/contributors","subscribers_url":"https://api.github.com/repos/vincentlab/PyFR/subscribers","subscription_url":"https://api.github.com/repos/vincentlab/PyFR/subscription","commits_url":"https://api.github.com/repos/vincentlab/PyFR/commits{/sha}","git_commits_url":"https://api.github.com/repos/vincentlab/PyFR/git/commits{/sha}","comments_url":"https://api.github.com/repos/vincentlab/PyFR/comments{/number}","issue_comment_url":"https://api.github.com/repos/vincentlab/PyFR/issues/comments{/number}","contents_url":"https://api.github.com/repos/vincentlab/PyFR/contents/{+path}","compare_url":"https://api.github.com/repos/vincentlab/PyFR/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vincentlab/PyFR/merges","archive_url":"https://api.github.com/repos/vincentlab/PyFR/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vincentlab/PyFR/downloads","issues_url":"https://api.github.com/repos/vincentlab/PyFR/issues{/number}","pulls_url":"https://api.github.com/repos/vincentlab/PyFR/pulls{/number}","milestones_url":"https://api.github.com/repos/vincentlab/PyFR/milestones{/number}","notifications_url":"https://api.github.com/repos/vincentlab/PyFR/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vincentlab/PyFR/labels{/name}","releases_url":"https://api.github.com/repos/vincentlab/PyFR/releases{/id}","created_at":"2013-01-16T19:53:24Z","updated_at":"2015-07-17T10:58:00Z","pushed_at":"2015-07-24T17:15:35Z","git_url":"git://github.com/vincentlab/PyFR.git","ssh_url":"git@github.com:vincentlab/PyFR.git","clone_url":"https://github.com/vincentlab/PyFR.git","svn_url":"https://github.com/vincentlab/PyFR","homepage":"","size":3824,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":5,"forks":27,"open_issues":5,"watchers":27,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/vincentlab/PyFR/pulls/69"},"html":{"href":"https://github.com/vincentlab/PyFR/pull/69"},"issue":{"href":"https://api.github.com/repos/vincentlab/PyFR/issues/69"},"comments":{"href":"https://api.github.com/repos/vincentlab/PyFR/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/vincentlab/PyFR/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/vincentlab/PyFR/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vincentlab/PyFR/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/vincentlab/PyFR/statuses/4233ae2d57be096074a5713d7303cb0379ea7db9"}}}}