GitHub PullRequestReviewCommentEvent at 2014-12-10 16:16:10
Repository: uber_analytics
Actor: EliAndrewC
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/magfest/uber_analytics/pulls/comments/21613753","id":21613753,"diff_hunk":"@@ -0,0 +1,124 @@\n+from uber.common import *\n+from sqlalchemy.sql.expression import literal\n+\n+class RegistrationDataOneYear:\n+    def __init__(self):\n+        self.event_name = \"\"\n+\n+        # what is the final day of this event (i.e. Sunday of a Fri->Sun festival)\n+        self.end_date = \"\"\n+\n+        # this holds how many registrations were taken each day starting at 365 days from the end date of the event.\n+        # this array is in chronological order and does not skip days.\n+        #\n+        # examples:\n+        # registrations_per_day[0]   is the #regs that were taken on end_date-365 (1 year before the event)\n+        # .....\n+        # registrations_per_day[362] is the #regs that were taken on end_date-2 (2 days before the end date)\n+        # registrations_per_day[363] is the #regs that were taken on end_date-1 (the day before the end date)\n+        # registrations_per_day[364] is the #regs that were taken on end_date\n+        self.registrations_per_day = []\n+\n+        # same as above, but, contains a cumulative sum of the same data\n+        self.registrations_per_day_cumulative_sum = []\n+\n+        self.num_days_to_report = 365\n+\n+    def query_current_year(self, session):\n+        self.event_name = EVENT_NAME_AND_YEAR\n+\n+        # TODO: we're hacking the timezone info out of ESCHATON (final day of event). probably not the right thing to do\n+        self.end_date = DATES['ESCHATON'].replace(hour=0, minute=0, second=0, microsecond=0, tzinfo=None)","path":"uber_analytics/graphs.py","position":31,"original_position":31,"commit_id":"acdc79d681d8798ff691ab2dbff5ca4e152f26d6","original_commit_id":"acdc79d681d8798ff691ab2dbff5ca4e152f26d6","user":{"login":"EliAndrewC","id":651592,"avatar_url":"https://avatars.githubusercontent.com/u/651592?v=3","gravatar_id":"","url":"https://api.github.com/users/EliAndrewC","html_url":"https://github.com/EliAndrewC","followers_url":"https://api.github.com/users/EliAndrewC/followers","following_url":"https://api.github.com/users/EliAndrewC/following{/other_user}","gists_url":"https://api.github.com/users/EliAndrewC/gists{/gist_id}","starred_url":"https://api.github.com/users/EliAndrewC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EliAndrewC/subscriptions","organizations_url":"https://api.github.com/users/EliAndrewC/orgs","repos_url":"https://api.github.com/users/EliAndrewC/repos","events_url":"https://api.github.com/users/EliAndrewC/events{/privacy}","received_events_url":"https://api.github.com/users/EliAndrewC/received_events","type":"User","site_admin":false},"body":"Oh, you're right!  My bad, yeah this is fine.\r\n\r\nStylistically, you should still just say ``ESCHATON`` instead of ``DATES['ESCHATON']`` but that's just a naming preference.","created_at":"2014-12-10T16:16:10Z","updated_at":"2014-12-10T16:16:10Z","html_url":"https://github.com/magfest/uber_analytics/pull/2#discussion_r21613753","pull_request_url":"https://api.github.com/repos/magfest/uber_analytics/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/magfest/uber_analytics/pulls/comments/21613753"},"html":{"href":"https://github.com/magfest/uber_analytics/pull/2#discussion_r21613753"},"pull_request":{"href":"https://api.github.com/repos/magfest/uber_analytics/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/magfest/uber_analytics/pulls/2","id":25182519,"html_url":"https://github.com/magfest/uber_analytics/pull/2","diff_url":"https://github.com/magfest/uber_analytics/pull/2.diff","patch_url":"https://github.com/magfest/uber_analytics/pull/2.patch","issue_url":"https://api.github.com/repos/magfest/uber_analytics/issues/2","number":2,"state":"closed","locked":false,"title":"Analytics plugin first pass","user":{"login":"binary1230","id":5413064,"avatar_url":"https://avatars.githubusercontent.com/u/5413064?v=3","gravatar_id":"","url":"https://api.github.com/users/binary1230","html_url":"https://github.com/binary1230","followers_url":"https://api.github.com/users/binary1230/followers","following_url":"https://api.github.com/users/binary1230/following{/other_user}","gists_url":"https://api.github.com/users/binary1230/gists{/gist_id}","starred_url":"https://api.github.com/users/binary1230/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binary1230/subscriptions","organizations_url":"https://api.github.com/users/binary1230/orgs","repos_url":"https://api.github.com/users/binary1230/repos","events_url":"https://api.github.com/users/binary1230/events{/privacy}","received_events_url":"https://api.github.com/users/binary1230/received_events","type":"User","site_admin":false},"body":"OK, I think this is ready to merge for-realz.\r\n\r\nAnalytics plugin for ubersystem, should be able to drop in for both AC and Magfest no problem.\r\n\r\nThis is also the first real UI-heavy, database-heavy plugin to be used and those functionalities all seem to work well, which is awesome.\r\n\r\nThis displays graphs of paying attendance. Excludes: paying dealers, comp'd staff/vip/guest/etc badges, refunded badges.  We want to know how many badges were purchased by the actual general public.\r\n\r\nOff the shelf, this plugin displays only the live registration data on a graph (which, is the main point and is super-useful).\r\n\r\nHowever, if you have historical data, you simply drop a json file with the old data in a particular dir in your deploy, and it will merge that with the live data.\r\n\r\nThere's a few hacky things here (i.e. ANYTHING to do with UI design, responsive, making it look pretty, CSS, etc because I have no patience for that).\r\n\r\n@EliAndrewC I'd appreciate a good hard look at my __init__.py to make sure I'm not doing anything too dumb in there with mounting the app config/etc.","created_at":"2014-11-28T08:20:42Z","updated_at":"2014-12-10T16:16:10Z","closed_at":"2014-11-28T15:51:55Z","merged_at":"2014-11-28T15:51:55Z","merge_commit_sha":"cfb7604c4e8a25928f6c459e2040bc430e5d3fa3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/magfest/uber_analytics/pulls/2/commits","review_comments_url":"https://api.github.com/repos/magfest/uber_analytics/pulls/2/comments","review_comment_url":"https://api.github.com/repos/magfest/uber_analytics/pulls/comments/{number}","comments_url":"https://api.github.com/repos/magfest/uber_analytics/issues/2/comments","statuses_url":"https://api.github.com/repos/magfest/uber_analytics/statuses/acdc79d681d8798ff691ab2dbff5ca4e152f26d6","head":{"label":"magfest:analytics_plugin_v1","ref":"analytics_plugin_v1","sha":"acdc79d681d8798ff691ab2dbff5ca4e152f26d6","user":{"login":"magfest","id":7840140,"avatar_url":"https://avatars.githubusercontent.com/u/7840140?v=3","gravatar_id":"","url":"https://api.github.com/users/magfest","html_url":"https://github.com/magfest","followers_url":"https://api.github.com/users/magfest/followers","following_url":"https://api.github.com/users/magfest/following{/other_user}","gists_url":"https://api.github.com/users/magfest/gists{/gist_id}","starred_url":"https://api.github.com/users/magfest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magfest/subscriptions","organizations_url":"https://api.github.com/users/magfest/orgs","repos_url":"https://api.github.com/users/magfest/repos","events_url":"https://api.github.com/users/magfest/events{/privacy}","received_events_url":"https://api.github.com/users/magfest/received_events","type":"Organization","site_admin":false},"repo":{"id":24679160,"name":"uber_analytics","full_name":"magfest/uber_analytics","owner":{"login":"magfest","id":7840140,"avatar_url":"https://avatars.githubusercontent.com/u/7840140?v=3","gravatar_id":"","url":"https://api.github.com/users/magfest","html_url":"https://github.com/magfest","followers_url":"https://api.github.com/users/magfest/followers","following_url":"https://api.github.com/users/magfest/following{/other_user}","gists_url":"https://api.github.com/users/magfest/gists{/gist_id}","starred_url":"https://api.github.com/users/magfest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magfest/subscriptions","organizations_url":"https://api.github.com/users/magfest/orgs","repos_url":"https://api.github.com/users/magfest/repos","events_url":"https://api.github.com/users/magfest/events{/privacy}","received_events_url":"https://api.github.com/users/magfest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magfest/uber_analytics","description":"analytics module for Magfest's ubersystem","fork":false,"url":"https://api.github.com/repos/magfest/uber_analytics","forks_url":"https://api.github.com/repos/magfest/uber_analytics/forks","keys_url":"https://api.github.com/repos/magfest/uber_analytics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magfest/uber_analytics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magfest/uber_analytics/teams","hooks_url":"https://api.github.com/repos/magfest/uber_analytics/hooks","issue_events_url":"https://api.github.com/repos/magfest/uber_analytics/issues/events{/number}","events_url":"https://api.github.com/repos/magfest/uber_analytics/events","assignees_url":"https://api.github.com/repos/magfest/uber_analytics/assignees{/user}","branches_url":"https://api.github.com/repos/magfest/uber_analytics/branches{/branch}","tags_url":"https://api.github.com/repos/magfest/uber_analytics/tags","blobs_url":"https://api.github.com/repos/magfest/uber_analytics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magfest/uber_analytics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magfest/uber_analytics/git/refs{/sha}","trees_url":"https://api.github.com/repos/magfest/uber_analytics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magfest/uber_analytics/statuses/{sha}","languages_url":"https://api.github.com/repos/magfest/uber_analytics/languages","stargazers_url":"https://api.github.com/repos/magfest/uber_analytics/stargazers","contributors_url":"https://api.github.com/repos/magfest/uber_analytics/contributors","subscribers_url":"https://api.github.com/repos/magfest/uber_analytics/subscribers","subscription_url":"https://api.github.com/repos/magfest/uber_analytics/subscription","commits_url":"https://api.github.com/repos/magfest/uber_analytics/commits{/sha}","git_commits_url":"https://api.github.com/repos/magfest/uber_analytics/git/commits{/sha}","comments_url":"https://api.github.com/repos/magfest/uber_analytics/comments{/number}","issue_comment_url":"https://api.github.com/repos/magfest/uber_analytics/issues/comments/{number}","contents_url":"https://api.github.com/repos/magfest/uber_analytics/contents/{+path}","compare_url":"https://api.github.com/repos/magfest/uber_analytics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magfest/uber_analytics/merges","archive_url":"https://api.github.com/repos/magfest/uber_analytics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magfest/uber_analytics/downloads","issues_url":"https://api.github.com/repos/magfest/uber_analytics/issues{/number}","pulls_url":"https://api.github.com/repos/magfest/uber_analytics/pulls{/number}","milestones_url":"https://api.github.com/repos/magfest/uber_analytics/milestones{/number}","notifications_url":"https://api.github.com/repos/magfest/uber_analytics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magfest/uber_analytics/labels{/name}","releases_url":"https://api.github.com/repos/magfest/uber_analytics/releases{/id}","created_at":"2014-10-01T13:22:03Z","updated_at":"2014-11-29T06:12:19Z","pushed_at":"2014-11-29T06:12:19Z","git_url":"git://github.com/magfest/uber_analytics.git","ssh_url":"git@github.com:magfest/uber_analytics.git","clone_url":"https://github.com/magfest/uber_analytics.git","svn_url":"https://github.com/magfest/uber_analytics","homepage":null,"size":248,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"magfest:master","ref":"master","sha":"33bb64a111ccb22e4ef4299342baeb0371bf7c23","user":{"login":"magfest","id":7840140,"avatar_url":"https://avatars.githubusercontent.com/u/7840140?v=3","gravatar_id":"","url":"https://api.github.com/users/magfest","html_url":"https://github.com/magfest","followers_url":"https://api.github.com/users/magfest/followers","following_url":"https://api.github.com/users/magfest/following{/other_user}","gists_url":"https://api.github.com/users/magfest/gists{/gist_id}","starred_url":"https://api.github.com/users/magfest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magfest/subscriptions","organizations_url":"https://api.github.com/users/magfest/orgs","repos_url":"https://api.github.com/users/magfest/repos","events_url":"https://api.github.com/users/magfest/events{/privacy}","received_events_url":"https://api.github.com/users/magfest/received_events","type":"Organization","site_admin":false},"repo":{"id":24679160,"name":"uber_analytics","full_name":"magfest/uber_analytics","owner":{"login":"magfest","id":7840140,"avatar_url":"https://avatars.githubusercontent.com/u/7840140?v=3","gravatar_id":"","url":"https://api.github.com/users/magfest","html_url":"https://github.com/magfest","followers_url":"https://api.github.com/users/magfest/followers","following_url":"https://api.github.com/users/magfest/following{/other_user}","gists_url":"https://api.github.com/users/magfest/gists{/gist_id}","starred_url":"https://api.github.com/users/magfest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magfest/subscriptions","organizations_url":"https://api.github.com/users/magfest/orgs","repos_url":"https://api.github.com/users/magfest/repos","events_url":"https://api.github.com/users/magfest/events{/privacy}","received_events_url":"https://api.github.com/users/magfest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magfest/uber_analytics","description":"analytics module for Magfest's ubersystem","fork":false,"url":"https://api.github.com/repos/magfest/uber_analytics","forks_url":"https://api.github.com/repos/magfest/uber_analytics/forks","keys_url":"https://api.github.com/repos/magfest/uber_analytics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magfest/uber_analytics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magfest/uber_analytics/teams","hooks_url":"https://api.github.com/repos/magfest/uber_analytics/hooks","issue_events_url":"https://api.github.com/repos/magfest/uber_analytics/issues/events{/number}","events_url":"https://api.github.com/repos/magfest/uber_analytics/events","assignees_url":"https://api.github.com/repos/magfest/uber_analytics/assignees{/user}","branches_url":"https://api.github.com/repos/magfest/uber_analytics/branches{/branch}","tags_url":"https://api.github.com/repos/magfest/uber_analytics/tags","blobs_url":"https://api.github.com/repos/magfest/uber_analytics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magfest/uber_analytics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magfest/uber_analytics/git/refs{/sha}","trees_url":"https://api.github.com/repos/magfest/uber_analytics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magfest/uber_analytics/statuses/{sha}","languages_url":"https://api.github.com/repos/magfest/uber_analytics/languages","stargazers_url":"https://api.github.com/repos/magfest/uber_analytics/stargazers","contributors_url":"https://api.github.com/repos/magfest/uber_analytics/contributors","subscribers_url":"https://api.github.com/repos/magfest/uber_analytics/subscribers","subscription_url":"https://api.github.com/repos/magfest/uber_analytics/subscription","commits_url":"https://api.github.com/repos/magfest/uber_analytics/commits{/sha}","git_commits_url":"https://api.github.com/repos/magfest/uber_analytics/git/commits{/sha}","comments_url":"https://api.github.com/repos/magfest/uber_analytics/comments{/number}","issue_comment_url":"https://api.github.com/repos/magfest/uber_analytics/issues/comments/{number}","contents_url":"https://api.github.com/repos/magfest/uber_analytics/contents/{+path}","compare_url":"https://api.github.com/repos/magfest/uber_analytics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magfest/uber_analytics/merges","archive_url":"https://api.github.com/repos/magfest/uber_analytics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magfest/uber_analytics/downloads","issues_url":"https://api.github.com/repos/magfest/uber_analytics/issues{/number}","pulls_url":"https://api.github.com/repos/magfest/uber_analytics/pulls{/number}","milestones_url":"https://api.github.com/repos/magfest/uber_analytics/milestones{/number}","notifications_url":"https://api.github.com/repos/magfest/uber_analytics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magfest/uber_analytics/labels{/name}","releases_url":"https://api.github.com/repos/magfest/uber_analytics/releases{/id}","created_at":"2014-10-01T13:22:03Z","updated_at":"2014-11-29T06:12:19Z","pushed_at":"2014-11-29T06:12:19Z","git_url":"git://github.com/magfest/uber_analytics.git","ssh_url":"git@github.com:magfest/uber_analytics.git","clone_url":"https://github.com/magfest/uber_analytics.git","svn_url":"https://github.com/magfest/uber_analytics","homepage":null,"size":248,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/magfest/uber_analytics/pulls/2"},"html":{"href":"https://github.com/magfest/uber_analytics/pull/2"},"issue":{"href":"https://api.github.com/repos/magfest/uber_analytics/issues/2"},"comments":{"href":"https://api.github.com/repos/magfest/uber_analytics/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/magfest/uber_analytics/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/magfest/uber_analytics/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/magfest/uber_analytics/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/magfest/uber_analytics/statuses/acdc79d681d8798ff691ab2dbff5ca4e152f26d6"}}}}