{"action":"created","comment":{"url":"https://api.github.com/repos/openaps/oref0/pulls/comments/47872843","id":47872843,"diff_hunk":"@@ -125,19 +125,22 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_\n     } \n     if (eventualBG < profile.min_bg) { // if eventual BG is below target:\n         rT.reason = \"Eventual BG \" + eventualBG + \"<\" + profile.min_bg;\n-        // if 5m or 15m avg BG is rising faster than expected delta\n         if (minDelta > expectedDelta) {\n-            if (glucose_status.delta > glucose_status.avgdelta) {\n-                rT.reason += \", but Delta \" + tick + \" > Exp. Delta \" + expectedDelta;\n-            } else {\n-                rT.reason += \", but Avg. Delta \" + glucose_status.avgdelta.toFixed(2) + \" > Exp. Delta \" + expectedDelta;\n-            }\n-            if (currenttemp.duration > 0) { // if there is currently any temp basal running\n-                rT.reason = rT.reason += \"; cancel\";\n-                return setTempBasal(0, 0, profile, rT, offline); // cancel temp\n-            } else {\n-            rT.reason = rT.reason += \"; no temp to cancel\";\n-            return rT;\n+            if (minDelta > 0) { // if 5m or 15m avg BG is rising faster than expected delta","path":"lib/determine-basal/determine-basal.js","position":17,"original_position":17,"commit_id":"896e708eeb41c43379627e72df476d9ac44fd39e","original_commit_id":"896e708eeb41c43379627e72df476d9ac44fd39e","user":{"login":"jasoncalabrese","id":751143,"avatar_url":"https://avatars.githubusercontent.com/u/751143?v=3","gravatar_id":"","url":"https://api.github.com/users/jasoncalabrese","html_url":"https://github.com/jasoncalabrese","followers_url":"https://api.github.com/users/jasoncalabrese/followers","following_url":"https://api.github.com/users/jasoncalabrese/following{/other_user}","gists_url":"https://api.github.com/users/jasoncalabrese/gists{/gist_id}","starred_url":"https://api.github.com/users/jasoncalabrese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasoncalabrese/subscriptions","organizations_url":"https://api.github.com/users/jasoncalabrese/orgs","repos_url":"https://api.github.com/users/jasoncalabrese/repos","events_url":"https://api.github.com/users/jasoncalabrese/events{/privacy}","received_events_url":"https://api.github.com/users/jasoncalabrese/received_events","type":"User","site_admin":false},"body":"Think it's just the location of the comment the confused me, it makes sense at the previous location before `if (minDelta > expectedDelta) {`","created_at":"2015-12-17T06:14:38Z","updated_at":"2015-12-17T06:14:38Z","html_url":"https://github.com/openaps/oref0/pull/47#discussion_r47872843","pull_request_url":"https://api.github.com/repos/openaps/oref0/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/openaps/oref0/pulls/comments/47872843"},"html":{"href":"https://github.com/openaps/oref0/pull/47#discussion_r47872843"},"pull_request":{"href":"https://api.github.com/repos/openaps/oref0/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/openaps/oref0/pulls/47","id":53934790,"html_url":"https://github.com/openaps/oref0/pull/47","diff_url":"https://github.com/openaps/oref0/pull/47.diff","patch_url":"https://github.com/openaps/oref0/pull/47.patch","issue_url":"https://api.github.com/repos/openaps/oref0/issues/47","number":47,"state":"open","locked":false,"title":"test capturing @audiefile scenario and overcompensatory quick-fix","user":{"login":"scottleibrand","id":6982790,"avatar_url":"https://avatars.githubusercontent.com/u/6982790?v=3","gravatar_id":"","url":"https://api.github.com/users/scottleibrand","html_url":"https://github.com/scottleibrand","followers_url":"https://api.github.com/users/scottleibrand/followers","following_url":"https://api.github.com/users/scottleibrand/following{/other_user}","gists_url":"https://api.github.com/users/scottleibrand/gists{/gist_id}","starred_url":"https://api.github.com/users/scottleibrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottleibrand/subscriptions","organizations_url":"https://api.github.com/users/scottleibrand/orgs","repos_url":"https://api.github.com/users/scottleibrand/repos","events_url":"https://api.github.com/users/scottleibrand/events{/privacy}","received_events_url":"https://api.github.com/users/scottleibrand/received_events","type":"User","site_admin":false},"body":"This creates a unit test for #48, the issue @audiefile and @jasoncalabrese identified where expected-delta wouldn't low-temp when eventualBG < min but delta > expected delta (BG is falling more slowly than expected delta, mostly due to BGI).  Previously, I believe we were comparing delta to BGI/2, but in the expected-delta branch I changed it to compare to expected_delta (basically BGI), and haven't yet applied the newinsulinReq adjustment logic that I did for reducing high-temps.\r\n\r\nThis basic fix will disable the expected delta comparison completely (and low-temp) any time you’re falling with eventualBG < min.  That fixes the new unit test and doesn’t break any others, but I think the quick-fix will be too aggressive at low-temping when carbs are causing you to fall a lot slower than BGI, until we apply the newinsulinReq adjustment logic.\r\n\r\nHowever, I think this is at least safer than the code currently running in dev.  If someone could give it a look through and confirm that, it might be worth merging this to dev even before I get the newinsulinReq adjustment logic in place.","created_at":"2015-12-17T04:57:03Z","updated_at":"2015-12-17T06:14:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8fd2d5da444c7fc770a158127161d351956e14be","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openaps/oref0/pulls/47/commits","review_comments_url":"https://api.github.com/repos/openaps/oref0/pulls/47/comments","review_comment_url":"https://api.github.com/repos/openaps/oref0/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openaps/oref0/issues/47/comments","statuses_url":"https://api.github.com/repos/openaps/oref0/statuses/896e708eeb41c43379627e72df476d9ac44fd39e","head":{"label":"openaps:falling-slower-than-BGI","ref":"falling-slower-than-BGI","sha":"896e708eeb41c43379627e72df476d9ac44fd39e","user":{"login":"openaps","id":11914497,"avatar_url":"https://avatars.githubusercontent.com/u/11914497?v=3","gravatar_id":"","url":"https://api.github.com/users/openaps","html_url":"https://github.com/openaps","followers_url":"https://api.github.com/users/openaps/followers","following_url":"https://api.github.com/users/openaps/following{/other_user}","gists_url":"https://api.github.com/users/openaps/gists{/gist_id}","starred_url":"https://api.github.com/users/openaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openaps/subscriptions","organizations_url":"https://api.github.com/users/openaps/orgs","repos_url":"https://api.github.com/users/openaps/repos","events_url":"https://api.github.com/users/openaps/events{/privacy}","received_events_url":"https://api.github.com/users/openaps/received_events","type":"Organization","site_admin":false},"repo":{"id":44561719,"name":"oref0","full_name":"openaps/oref0","owner":{"login":"openaps","id":11914497,"avatar_url":"https://avatars.githubusercontent.com/u/11914497?v=3","gravatar_id":"","url":"https://api.github.com/users/openaps","html_url":"https://github.com/openaps","followers_url":"https://api.github.com/users/openaps/followers","following_url":"https://api.github.com/users/openaps/following{/other_user}","gists_url":"https://api.github.com/users/openaps/gists{/gist_id}","starred_url":"https://api.github.com/users/openaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openaps/subscriptions","organizations_url":"https://api.github.com/users/openaps/orgs","repos_url":"https://api.github.com/users/openaps/repos","events_url":"https://api.github.com/users/openaps/events{/privacy}","received_events_url":"https://api.github.com/users/openaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openaps/oref0","description":"oref0: The open reference implementation of the OpenAPS reference design.","fork":false,"url":"https://api.github.com/repos/openaps/oref0","forks_url":"https://api.github.com/repos/openaps/oref0/forks","keys_url":"https://api.github.com/repos/openaps/oref0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openaps/oref0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openaps/oref0/teams","hooks_url":"https://api.github.com/repos/openaps/oref0/hooks","issue_events_url":"https://api.github.com/repos/openaps/oref0/issues/events{/number}","events_url":"https://api.github.com/repos/openaps/oref0/events","assignees_url":"https://api.github.com/repos/openaps/oref0/assignees{/user}","branches_url":"https://api.github.com/repos/openaps/oref0/branches{/branch}","tags_url":"https://api.github.com/repos/openaps/oref0/tags","blobs_url":"https://api.github.com/repos/openaps/oref0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openaps/oref0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openaps/oref0/git/refs{/sha}","trees_url":"https://api.github.com/repos/openaps/oref0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openaps/oref0/statuses/{sha}","languages_url":"https://api.github.com/repos/openaps/oref0/languages","stargazers_url":"https://api.github.com/repos/openaps/oref0/stargazers","contributors_url":"https://api.github.com/repos/openaps/oref0/contributors","subscribers_url":"https://api.github.com/repos/openaps/oref0/subscribers","subscription_url":"https://api.github.com/repos/openaps/oref0/subscription","commits_url":"https://api.github.com/repos/openaps/oref0/commits{/sha}","git_commits_url":"https://api.github.com/repos/openaps/oref0/git/commits{/sha}","comments_url":"https://api.github.com/repos/openaps/oref0/comments{/number}","issue_comment_url":"https://api.github.com/repos/openaps/oref0/issues/comments{/number}","contents_url":"https://api.github.com/repos/openaps/oref0/contents/{+path}","compare_url":"https://api.github.com/repos/openaps/oref0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openaps/oref0/merges","archive_url":"https://api.github.com/repos/openaps/oref0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openaps/oref0/downloads","issues_url":"https://api.github.com/repos/openaps/oref0/issues{/number}","pulls_url":"https://api.github.com/repos/openaps/oref0/pulls{/number}","milestones_url":"https://api.github.com/repos/openaps/oref0/milestones{/number}","notifications_url":"https://api.github.com/repos/openaps/oref0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openaps/oref0/labels{/name}","releases_url":"https://api.github.com/repos/openaps/oref0/releases{/id}","created_at":"2015-10-19T20:22:39Z","updated_at":"2015-10-22T06:58:02Z","pushed_at":"2015-12-17T04:57:03Z","git_url":"git://github.com/openaps/oref0.git","ssh_url":"git@github.com:openaps/oref0.git","clone_url":"https://github.com/openaps/oref0.git","svn_url":"https://github.com/openaps/oref0","homepage":"","size":356,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":4,"forks":13,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"openaps:dev","ref":"dev","sha":"6e79cceeb3aa1310ee5dbb4a1a82863a40c045d6","user":{"login":"openaps","id":11914497,"avatar_url":"https://avatars.githubusercontent.com/u/11914497?v=3","gravatar_id":"","url":"https://api.github.com/users/openaps","html_url":"https://github.com/openaps","followers_url":"https://api.github.com/users/openaps/followers","following_url":"https://api.github.com/users/openaps/following{/other_user}","gists_url":"https://api.github.com/users/openaps/gists{/gist_id}","starred_url":"https://api.github.com/users/openaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openaps/subscriptions","organizations_url":"https://api.github.com/users/openaps/orgs","repos_url":"https://api.github.com/users/openaps/repos","events_url":"https://api.github.com/users/openaps/events{/privacy}","received_events_url":"https://api.github.com/users/openaps/received_events","type":"Organization","site_admin":false},"repo":{"id":44561719,"name":"oref0","full_name":"openaps/oref0","owner":{"login":"openaps","id":11914497,"avatar_url":"https://avatars.githubusercontent.com/u/11914497?v=3","gravatar_id":"","url":"https://api.github.com/users/openaps","html_url":"https://github.com/openaps","followers_url":"https://api.github.com/users/openaps/followers","following_url":"https://api.github.com/users/openaps/following{/other_user}","gists_url":"https://api.github.com/users/openaps/gists{/gist_id}","starred_url":"https://api.github.com/users/openaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openaps/subscriptions","organizations_url":"https://api.github.com/users/openaps/orgs","repos_url":"https://api.github.com/users/openaps/repos","events_url":"https://api.github.com/users/openaps/events{/privacy}","received_events_url":"https://api.github.com/users/openaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openaps/oref0","description":"oref0: The open reference implementation of the OpenAPS reference design.","fork":false,"url":"https://api.github.com/repos/openaps/oref0","forks_url":"https://api.github.com/repos/openaps/oref0/forks","keys_url":"https://api.github.com/repos/openaps/oref0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openaps/oref0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openaps/oref0/teams","hooks_url":"https://api.github.com/repos/openaps/oref0/hooks","issue_events_url":"https://api.github.com/repos/openaps/oref0/issues/events{/number}","events_url":"https://api.github.com/repos/openaps/oref0/events","assignees_url":"https://api.github.com/repos/openaps/oref0/assignees{/user}","branches_url":"https://api.github.com/repos/openaps/oref0/branches{/branch}","tags_url":"https://api.github.com/repos/openaps/oref0/tags","blobs_url":"https://api.github.com/repos/openaps/oref0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openaps/oref0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openaps/oref0/git/refs{/sha}","trees_url":"https://api.github.com/repos/openaps/oref0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openaps/oref0/statuses/{sha}","languages_url":"https://api.github.com/repos/openaps/oref0/languages","stargazers_url":"https://api.github.com/repos/openaps/oref0/stargazers","contributors_url":"https://api.github.com/repos/openaps/oref0/contributors","subscribers_url":"https://api.github.com/repos/openaps/oref0/subscribers","subscription_url":"https://api.github.com/repos/openaps/oref0/subscription","commits_url":"https://api.github.com/repos/openaps/oref0/commits{/sha}","git_commits_url":"https://api.github.com/repos/openaps/oref0/git/commits{/sha}","comments_url":"https://api.github.com/repos/openaps/oref0/comments{/number}","issue_comment_url":"https://api.github.com/repos/openaps/oref0/issues/comments{/number}","contents_url":"https://api.github.com/repos/openaps/oref0/contents/{+path}","compare_url":"https://api.github.com/repos/openaps/oref0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openaps/oref0/merges","archive_url":"https://api.github.com/repos/openaps/oref0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openaps/oref0/downloads","issues_url":"https://api.github.com/repos/openaps/oref0/issues{/number}","pulls_url":"https://api.github.com/repos/openaps/oref0/pulls{/number}","milestones_url":"https://api.github.com/repos/openaps/oref0/milestones{/number}","notifications_url":"https://api.github.com/repos/openaps/oref0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openaps/oref0/labels{/name}","releases_url":"https://api.github.com/repos/openaps/oref0/releases{/id}","created_at":"2015-10-19T20:22:39Z","updated_at":"2015-10-22T06:58:02Z","pushed_at":"2015-12-17T04:57:03Z","git_url":"git://github.com/openaps/oref0.git","ssh_url":"git@github.com:openaps/oref0.git","clone_url":"https://github.com/openaps/oref0.git","svn_url":"https://github.com/openaps/oref0","homepage":"","size":356,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":4,"forks":13,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openaps/oref0/pulls/47"},"html":{"href":"https://github.com/openaps/oref0/pull/47"},"issue":{"href":"https://api.github.com/repos/openaps/oref0/issues/47"},"comments":{"href":"https://api.github.com/repos/openaps/oref0/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/openaps/oref0/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/openaps/oref0/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openaps/oref0/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/openaps/oref0/statuses/896e708eeb41c43379627e72df476d9ac44fd39e"}}}}