{"action":"created","comment":{"url":"https://api.github.com/repos/lsst/sims_catUtils/pulls/comments/67609969","id":67609969,"diff_hunk":"@@ -238,32 +252,75 @@ def applyAgn(self, params, expmjd_in):\n         sfint['z'] = params['agn_sfz']\n         sfint['y'] = params['agn_sfy']\n         tau = params['agn_tau']\n-        epochs = expmjd - toff\n-        if epochs.min() < 0:\n+\n+        # A string made up of this AGNs variability parameters that ought\n+        # to uniquely identify it.\n+        #\n+        cache_name = '%d_%.12f_%.12f_%.12f_%.12f_%.12f_%.12f_%.12f_%.12f' \\\n+        %(seed, sfint['u'], sfint['g'], sfint['r'], sfint['i'], sfint['z'],\n+          sfint['y'], tau, toff)\n+\n+        resumption = False\n+\n+        # Check to see if this AGN has already been simulated.\n+        # If it has, see if the previously simulated MJD is\n+        # earlier than the first requested MJD.  If so,\n+        # use that previous simulation as the starting point.\n+        #\n+        if cache_name in _agn_lc_cache:\n+            if _agn_lc_cache[cache_name]['mjd'] <expmjd:\n+                resumption = True\n+\n+        if resumption:\n+            rng = copy.deepcopy(_agn_lc_cache[cache_name]['rng'])\n+            start_date = _agn_lc_cache[cache_name]['mjd']\n+            dx_0 = _agn_lc_cache[cache_name]['dx']\n+        else:\n+            start_date = toff\n+            rng = numpy.random.RandomState(seed)\n+            dx_0 = {}\n+            for k in sfint:\n+                dx_0[k]=0.0\n+\n+        endepoch = expmjd - start_date\n+\n+        if endepoch < 0:","path":"python/lsst/sims/catUtils/mixins/VariabilityMixin.py","position":74,"original_position":74,"commit_id":"607877e60e9de344158cf74e9130a9e2aa0aca68","original_commit_id":"607877e60e9de344158cf74e9130a9e2aa0aca68","user":{"login":"rbiswas4","id":2281358,"avatar_url":"https://avatars.githubusercontent.com/u/2281358?v=3","gravatar_id":"","url":"https://api.github.com/users/rbiswas4","html_url":"https://github.com/rbiswas4","followers_url":"https://api.github.com/users/rbiswas4/followers","following_url":"https://api.github.com/users/rbiswas4/following{/other_user}","gists_url":"https://api.github.com/users/rbiswas4/gists{/gist_id}","starred_url":"https://api.github.com/users/rbiswas4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbiswas4/subscriptions","organizations_url":"https://api.github.com/users/rbiswas4/orgs","repos_url":"https://api.github.com/users/rbiswas4/repos","events_url":"https://api.github.com/users/rbiswas4/events{/privacy}","received_events_url":"https://api.github.com/users/rbiswas4/received_events","type":"User","site_admin":false},"body":"`RuntimeError` seems like an exception and cause the program to crash. Does it make sense to have a message that seems to warn the user that  variability will not be applied?\r\n\r\nI think you do not need the '+' signs. Within a parenthesis, the strings will be joined.","created_at":"2016-06-19T04:09:35Z","updated_at":"2016-06-19T04:09:35Z","html_url":"https://github.com/lsst/sims_catUtils/pull/55#discussion_r67609969","pull_request_url":"https://api.github.com/repos/lsst/sims_catUtils/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/lsst/sims_catUtils/pulls/comments/67609969"},"html":{"href":"https://github.com/lsst/sims_catUtils/pull/55#discussion_r67609969"},"pull_request":{"href":"https://api.github.com/repos/lsst/sims_catUtils/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/lsst/sims_catUtils/pulls/55","id":73830275,"html_url":"https://github.com/lsst/sims_catUtils/pull/55","diff_url":"https://github.com/lsst/sims_catUtils/pull/55.diff","patch_url":"https://github.com/lsst/sims_catUtils/pull/55.patch","issue_url":"https://api.github.com/repos/lsst/sims_catUtils/issues/55","number":55,"state":"open","locked":false,"title":"U/danielsf/light curve generator","user":{"login":"danielsf","id":1682854,"avatar_url":"https://avatars.githubusercontent.com/u/1682854?v=3","gravatar_id":"","url":"https://api.github.com/users/danielsf","html_url":"https://github.com/danielsf","followers_url":"https://api.github.com/users/danielsf/followers","following_url":"https://api.github.com/users/danielsf/following{/other_user}","gists_url":"https://api.github.com/users/danielsf/gists{/gist_id}","starred_url":"https://api.github.com/users/danielsf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielsf/subscriptions","organizations_url":"https://api.github.com/users/danielsf/orgs","repos_url":"https://api.github.com/users/danielsf/repos","events_url":"https://api.github.com/users/danielsf/events{/privacy}","received_events_url":"https://api.github.com/users/danielsf/received_events","type":"User","site_admin":false},"body":"This pull request implements a prototype LightCurveGenerator which takes an observing cadence represented by an OpSim output database and converts that into light curves for transient and variable sources stored in fatboy (or some other CatSim compatible database).\r\n\r\nThe supernova and AGN simulation codes were also touched in an effort to speed them up.","created_at":"2016-06-14T23:23:03Z","updated_at":"2016-06-19T04:09:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5de75fad6ddb0c25132d48d6607071c55fc5e88","assignee":{"login":"rbiswas4","id":2281358,"avatar_url":"https://avatars.githubusercontent.com/u/2281358?v=3","gravatar_id":"","url":"https://api.github.com/users/rbiswas4","html_url":"https://github.com/rbiswas4","followers_url":"https://api.github.com/users/rbiswas4/followers","following_url":"https://api.github.com/users/rbiswas4/following{/other_user}","gists_url":"https://api.github.com/users/rbiswas4/gists{/gist_id}","starred_url":"https://api.github.com/users/rbiswas4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbiswas4/subscriptions","organizations_url":"https://api.github.com/users/rbiswas4/orgs","repos_url":"https://api.github.com/users/rbiswas4/repos","events_url":"https://api.github.com/users/rbiswas4/events{/privacy}","received_events_url":"https://api.github.com/users/rbiswas4/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/lsst/sims_catUtils/pulls/55/commits","review_comments_url":"https://api.github.com/repos/lsst/sims_catUtils/pulls/55/comments","review_comment_url":"https://api.github.com/repos/lsst/sims_catUtils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst/sims_catUtils/issues/55/comments","statuses_url":"https://api.github.com/repos/lsst/sims_catUtils/statuses/607877e60e9de344158cf74e9130a9e2aa0aca68","head":{"label":"lsst:u/danielsf/lightCurveGenerator","ref":"u/danielsf/lightCurveGenerator","sha":"607877e60e9de344158cf74e9130a9e2aa0aca68","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":34668130,"name":"sims_catUtils","full_name":"lsst/sims_catUtils","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/sims_catUtils","description":"LSST Simulations package for catalog utilities","fork":false,"url":"https://api.github.com/repos/lsst/sims_catUtils","forks_url":"https://api.github.com/repos/lsst/sims_catUtils/forks","keys_url":"https://api.github.com/repos/lsst/sims_catUtils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/sims_catUtils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/sims_catUtils/teams","hooks_url":"https://api.github.com/repos/lsst/sims_catUtils/hooks","issue_events_url":"https://api.github.com/repos/lsst/sims_catUtils/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/sims_catUtils/events","assignees_url":"https://api.github.com/repos/lsst/sims_catUtils/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/sims_catUtils/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/sims_catUtils/tags","blobs_url":"https://api.github.com/repos/lsst/sims_catUtils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/sims_catUtils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/sims_catUtils/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/sims_catUtils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/sims_catUtils/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/sims_catUtils/languages","stargazers_url":"https://api.github.com/repos/lsst/sims_catUtils/stargazers","contributors_url":"https://api.github.com/repos/lsst/sims_catUtils/contributors","subscribers_url":"https://api.github.com/repos/lsst/sims_catUtils/subscribers","subscription_url":"https://api.github.com/repos/lsst/sims_catUtils/subscription","commits_url":"https://api.github.com/repos/lsst/sims_catUtils/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/sims_catUtils/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/sims_catUtils/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/sims_catUtils/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/sims_catUtils/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/sims_catUtils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/sims_catUtils/merges","archive_url":"https://api.github.com/repos/lsst/sims_catUtils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/sims_catUtils/downloads","issues_url":"https://api.github.com/repos/lsst/sims_catUtils/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/sims_catUtils/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/sims_catUtils/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/sims_catUtils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/sims_catUtils/labels{/name}","releases_url":"https://api.github.com/repos/lsst/sims_catUtils/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/sims_catUtils/deployments","created_at":"2015-04-27T13:25:00Z","updated_at":"2016-04-19T16:14:23Z","pushed_at":"2016-06-16T22:49:09Z","git_url":"git://github.com/lsst/sims_catUtils.git","ssh_url":"git@github.com:lsst/sims_catUtils.git","clone_url":"https://github.com/lsst/sims_catUtils.git","svn_url":"https://github.com/lsst/sims_catUtils","homepage":null,"size":8959,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"lsst:master","ref":"master","sha":"8b252d2e9e3e7a315735ca8438dc3abd38701f15","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":34668130,"name":"sims_catUtils","full_name":"lsst/sims_catUtils","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/sims_catUtils","description":"LSST Simulations package for catalog utilities","fork":false,"url":"https://api.github.com/repos/lsst/sims_catUtils","forks_url":"https://api.github.com/repos/lsst/sims_catUtils/forks","keys_url":"https://api.github.com/repos/lsst/sims_catUtils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/sims_catUtils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/sims_catUtils/teams","hooks_url":"https://api.github.com/repos/lsst/sims_catUtils/hooks","issue_events_url":"https://api.github.com/repos/lsst/sims_catUtils/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/sims_catUtils/events","assignees_url":"https://api.github.com/repos/lsst/sims_catUtils/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/sims_catUtils/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/sims_catUtils/tags","blobs_url":"https://api.github.com/repos/lsst/sims_catUtils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/sims_catUtils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/sims_catUtils/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/sims_catUtils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/sims_catUtils/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/sims_catUtils/languages","stargazers_url":"https://api.github.com/repos/lsst/sims_catUtils/stargazers","contributors_url":"https://api.github.com/repos/lsst/sims_catUtils/contributors","subscribers_url":"https://api.github.com/repos/lsst/sims_catUtils/subscribers","subscription_url":"https://api.github.com/repos/lsst/sims_catUtils/subscription","commits_url":"https://api.github.com/repos/lsst/sims_catUtils/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/sims_catUtils/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/sims_catUtils/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/sims_catUtils/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/sims_catUtils/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/sims_catUtils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/sims_catUtils/merges","archive_url":"https://api.github.com/repos/lsst/sims_catUtils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/sims_catUtils/downloads","issues_url":"https://api.github.com/repos/lsst/sims_catUtils/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/sims_catUtils/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/sims_catUtils/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/sims_catUtils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/sims_catUtils/labels{/name}","releases_url":"https://api.github.com/repos/lsst/sims_catUtils/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/sims_catUtils/deployments","created_at":"2015-04-27T13:25:00Z","updated_at":"2016-04-19T16:14:23Z","pushed_at":"2016-06-16T22:49:09Z","git_url":"git://github.com/lsst/sims_catUtils.git","ssh_url":"git@github.com:lsst/sims_catUtils.git","clone_url":"https://github.com/lsst/sims_catUtils.git","svn_url":"https://github.com/lsst/sims_catUtils","homepage":null,"size":8959,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst/sims_catUtils/pulls/55"},"html":{"href":"https://github.com/lsst/sims_catUtils/pull/55"},"issue":{"href":"https://api.github.com/repos/lsst/sims_catUtils/issues/55"},"comments":{"href":"https://api.github.com/repos/lsst/sims_catUtils/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst/sims_catUtils/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst/sims_catUtils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst/sims_catUtils/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/lsst/sims_catUtils/statuses/607877e60e9de344158cf74e9130a9e2aa0aca68"}}}}
{"actor":{"display_login":"rbiswas4"}}