{"action":"created","comment":{"url":"https://api.github.com/repos/hoburg/gpkit/pulls/comments/55908424","id":55908424,"diff_hunk":"@@ -132,48 +109,18 @@ def localsolve(self, solver=None, verbosity=1, x0=None, rel_tol=1e-4,\n         # solved successfully!\n         if verbosity > 0:\n             print(\"Solving took %i GP solves\" % len(self.gps)\n-                  + \" and %.3g seconds.\" % (time() - self.starttime))\n-\n-        # parse the result and return nu's of original monomials from\n-        #  variable sensitivities\n-        nu = result[\"sensitivities\"][\"monomials\"]\n-        sens_vars = {var: sum([gp.exps[i][var]*nu[i] for i in locs])\n-                     for (var, locs) in gp.varlocs.items()}\n-        nu_ = []\n-        for signomial in self.signomials:\n-            for c, exp in zip(signomial.cs, signomial.exps):\n-                var_ss = [sens_vars[var]*val for var, val in exp.items()]\n-                nu_.append(functools_reduce(mul, var_ss, np.sign(c)))\n-        result[\"sensitivities\"][\"monomials\"] = np.array(nu_)\n-        # TODO: SP sensitivities are weird, and potentially incorrect\n+                  + \" and %.3g seconds.\" % (time() - starttime))\n \n+        result[\"signomialstart\"] = startpoint\n+        self.sens_from_gpconstr(gp.constraints,\n+                                result[\"sensitivities\"][\"constraints\"],\n+                                result[\"sensitivities\"][\"constants\"])\n         self.result = result  # NOTE: SIDE EFFECTS\n         return result\n \n-    def step(self, x0=None, verbosity=1):\n-        if x0 is None:\n-            # dummy nomial data to turn x0's keys into VarKeys\n-            self.negydata = lambda: None\n-            self.negydata.varlocs = self.negvarkeys\n-            self.negydata.varstrs = {str(vk): vk for vk in self.negvarkeys}\n-            x0 = get_constants(self.negydata, {})\n-            sp_inits = {vk: vk.descr[\"sp_init\"] for vk in self.negvarkeys\n-                        if \"sp_init\" in vk.descr}\n-            x0.update(sp_inits)\n-        # HACK: initial guess for negative variables\n-        x0.update({var: 1 for var in self.negvarkeys if var not in x0})\n-\n-        posy_approxs = []\n-        for p, n in zip(self.posynomials, self.negynomials):\n-            if n is 0:\n-                posy_approx = p\n-            else:\n-                posy_approx = p/n.mono_lower_bound(x0)\n-            posy_approxs.append(posy_approx)\n-\n-        gp = GeometricProgram(posy_approxs[0], posy_approxs[1:],\n-                              verbosity=verbosity)\n-        return gp\n+    def gp(self, x0=None, verbosity=1):","path":"gpkit/constraints/signomial_program.py","position":null,"original_position":144,"commit_id":"506acfd4ae8fe2230d41f389789181cdc474ceb0","original_commit_id":"b71dca1537c9952fa3cdddfd6f79056ceeede750","user":{"login":"whoburg","id":6042395,"avatar_url":"https://avatars.githubusercontent.com/u/6042395?v=3","gravatar_id":"","url":"https://api.github.com/users/whoburg","html_url":"https://github.com/whoburg","followers_url":"https://api.github.com/users/whoburg/followers","following_url":"https://api.github.com/users/whoburg/following{/other_user}","gists_url":"https://api.github.com/users/whoburg/gists{/gist_id}","starred_url":"https://api.github.com/users/whoburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whoburg/subscriptions","organizations_url":"https://api.github.com/users/whoburg/orgs","repos_url":"https://api.github.com/users/whoburg/repos","events_url":"https://api.github.com/users/whoburg/events{/privacy}","received_events_url":"https://api.github.com/users/whoburg/received_events","type":"User","site_admin":false},"body":"sounds appealing!","created_at":"2016-03-12T00:22:46Z","updated_at":"2016-03-12T00:22:46Z","html_url":"https://github.com/hoburg/gpkit/pull/493#discussion_r55908424","pull_request_url":"https://api.github.com/repos/hoburg/gpkit/pulls/493","_links":{"self":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/comments/55908424"},"html":{"href":"https://github.com/hoburg/gpkit/pull/493#discussion_r55908424"},"pull_request":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/493"}}},"pull_request":{"url":"https://api.github.com/repos/hoburg/gpkit/pulls/493","id":52086107,"html_url":"https://github.com/hoburg/gpkit/pull/493","diff_url":"https://github.com/hoburg/gpkit/pull/493.diff","patch_url":"https://github.com/hoburg/gpkit/pull/493.patch","issue_url":"https://api.github.com/repos/hoburg/gpkit/issues/493","number":493,"state":"open","locked":false,"title":"Newconstr and keydict","user":{"login":"bqpd","id":1482776,"avatar_url":"https://avatars.githubusercontent.com/u/1482776?v=3","gravatar_id":"","url":"https://api.github.com/users/bqpd","html_url":"https://github.com/bqpd","followers_url":"https://api.github.com/users/bqpd/followers","following_url":"https://api.github.com/users/bqpd/following{/other_user}","gists_url":"https://api.github.com/users/bqpd/gists{/gist_id}","starred_url":"https://api.github.com/users/bqpd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bqpd/subscriptions","organizations_url":"https://api.github.com/users/bqpd/orgs","repos_url":"https://api.github.com/users/bqpd/repos","events_url":"https://api.github.com/users/bqpd/events{/privacy}","received_events_url":"https://api.github.com/users/bqpd/received_events","type":"User","site_admin":false},"body":"@pgkirsch, this should work for your needs...\r\n\r\ntodo:\r\n  - [x] ConstraintSet docstrings\r\n  - [x] pass tests\r\n  - [x] unify and fix ConstraintSet/GeometricProgram/etc printing\r\n  - [ ] hand test `gpkit.interactive` features still work","created_at":"2015-11-30T05:14:34Z","updated_at":"2016-03-12T00:22:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e1dcb9b4b283de17522c750e585bdb29a9d7996","assignee":null,"milestone":{"url":"https://api.github.com/repos/hoburg/gpkit/milestones/11","html_url":"https://github.com/hoburg/gpkit/milestones/Constraint%20and%20Key%20Refactor","labels_url":"https://api.github.com/repos/hoburg/gpkit/milestones/11/labels","id":1608310,"number":11,"title":"Constraint and Key Refactor","description":"","creator":{"login":"whoburg","id":6042395,"avatar_url":"https://avatars.githubusercontent.com/u/6042395?v=3","gravatar_id":"","url":"https://api.github.com/users/whoburg","html_url":"https://github.com/whoburg","followers_url":"https://api.github.com/users/whoburg/followers","following_url":"https://api.github.com/users/whoburg/following{/other_user}","gists_url":"https://api.github.com/users/whoburg/gists{/gist_id}","starred_url":"https://api.github.com/users/whoburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whoburg/subscriptions","organizations_url":"https://api.github.com/users/whoburg/orgs","repos_url":"https://api.github.com/users/whoburg/repos","events_url":"https://api.github.com/users/whoburg/events{/privacy}","received_events_url":"https://api.github.com/users/whoburg/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":0,"state":"open","created_at":"2016-02-26T15:56:07Z","updated_at":"2016-03-10T05:07:56Z","due_on":"2016-02-29T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/hoburg/gpkit/pulls/493/commits","review_comments_url":"https://api.github.com/repos/hoburg/gpkit/pulls/493/comments","review_comment_url":"https://api.github.com/repos/hoburg/gpkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hoburg/gpkit/issues/493/comments","statuses_url":"https://api.github.com/repos/hoburg/gpkit/statuses/506acfd4ae8fe2230d41f389789181cdc474ceb0","head":{"label":"hoburg:newconstr_and_keydict","ref":"newconstr_and_keydict","sha":"506acfd4ae8fe2230d41f389789181cdc474ceb0","user":{"login":"hoburg","id":16762937,"avatar_url":"https://avatars.githubusercontent.com/u/16762937?v=3","gravatar_id":"","url":"https://api.github.com/users/hoburg","html_url":"https://github.com/hoburg","followers_url":"https://api.github.com/users/hoburg/followers","following_url":"https://api.github.com/users/hoburg/following{/other_user}","gists_url":"https://api.github.com/users/hoburg/gists{/gist_id}","starred_url":"https://api.github.com/users/hoburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoburg/subscriptions","organizations_url":"https://api.github.com/users/hoburg/orgs","repos_url":"https://api.github.com/users/hoburg/repos","events_url":"https://api.github.com/users/hoburg/events{/privacy}","received_events_url":"https://api.github.com/users/hoburg/received_events","type":"Organization","site_admin":false},"repo":{"id":20954246,"name":"gpkit","full_name":"hoburg/gpkit","owner":{"login":"hoburg","id":16762937,"avatar_url":"https://avatars.githubusercontent.com/u/16762937?v=3","gravatar_id":"","url":"https://api.github.com/users/hoburg","html_url":"https://github.com/hoburg","followers_url":"https://api.github.com/users/hoburg/followers","following_url":"https://api.github.com/users/hoburg/following{/other_user}","gists_url":"https://api.github.com/users/hoburg/gists{/gist_id}","starred_url":"https://api.github.com/users/hoburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoburg/subscriptions","organizations_url":"https://api.github.com/users/hoburg/orgs","repos_url":"https://api.github.com/users/hoburg/repos","events_url":"https://api.github.com/users/hoburg/events{/privacy}","received_events_url":"https://api.github.com/users/hoburg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hoburg/gpkit","description":"Python package for defining and manipulating geometric programming models.","fork":false,"url":"https://api.github.com/repos/hoburg/gpkit","forks_url":"https://api.github.com/repos/hoburg/gpkit/forks","keys_url":"https://api.github.com/repos/hoburg/gpkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoburg/gpkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoburg/gpkit/teams","hooks_url":"https://api.github.com/repos/hoburg/gpkit/hooks","issue_events_url":"https://api.github.com/repos/hoburg/gpkit/issues/events{/number}","events_url":"https://api.github.com/repos/hoburg/gpkit/events","assignees_url":"https://api.github.com/repos/hoburg/gpkit/assignees{/user}","branches_url":"https://api.github.com/repos/hoburg/gpkit/branches{/branch}","tags_url":"https://api.github.com/repos/hoburg/gpkit/tags","blobs_url":"https://api.github.com/repos/hoburg/gpkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoburg/gpkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoburg/gpkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoburg/gpkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoburg/gpkit/statuses/{sha}","languages_url":"https://api.github.com/repos/hoburg/gpkit/languages","stargazers_url":"https://api.github.com/repos/hoburg/gpkit/stargazers","contributors_url":"https://api.github.com/repos/hoburg/gpkit/contributors","subscribers_url":"https://api.github.com/repos/hoburg/gpkit/subscribers","subscription_url":"https://api.github.com/repos/hoburg/gpkit/subscription","commits_url":"https://api.github.com/repos/hoburg/gpkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoburg/gpkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoburg/gpkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoburg/gpkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/hoburg/gpkit/contents/{+path}","compare_url":"https://api.github.com/repos/hoburg/gpkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoburg/gpkit/merges","archive_url":"https://api.github.com/repos/hoburg/gpkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoburg/gpkit/downloads","issues_url":"https://api.github.com/repos/hoburg/gpkit/issues{/number}","pulls_url":"https://api.github.com/repos/hoburg/gpkit/pulls{/number}","milestones_url":"https://api.github.com/repos/hoburg/gpkit/milestones{/number}","notifications_url":"https://api.github.com/repos/hoburg/gpkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoburg/gpkit/labels{/name}","releases_url":"https://api.github.com/repos/hoburg/gpkit/releases{/id}","deployments_url":"https://api.github.com/repos/hoburg/gpkit/deployments","created_at":"2014-06-18T08:04:06Z","updated_at":"2016-01-25T01:21:54Z","pushed_at":"2016-03-12T00:19:06Z","git_url":"git://github.com/hoburg/gpkit.git","ssh_url":"git@github.com:hoburg/gpkit.git","clone_url":"https://github.com/hoburg/gpkit.git","svn_url":"https://github.com/hoburg/gpkit","homepage":"http://gpkit.readthedocs.org","size":29770,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":114,"forks":4,"open_issues":114,"watchers":7,"default_branch":"master"}},"base":{"label":"hoburg:master","ref":"master","sha":"8fa9cc4c59f2df7ee4666ea4be0388b5830cf8c8","user":{"login":"hoburg","id":16762937,"avatar_url":"https://avatars.githubusercontent.com/u/16762937?v=3","gravatar_id":"","url":"https://api.github.com/users/hoburg","html_url":"https://github.com/hoburg","followers_url":"https://api.github.com/users/hoburg/followers","following_url":"https://api.github.com/users/hoburg/following{/other_user}","gists_url":"https://api.github.com/users/hoburg/gists{/gist_id}","starred_url":"https://api.github.com/users/hoburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoburg/subscriptions","organizations_url":"https://api.github.com/users/hoburg/orgs","repos_url":"https://api.github.com/users/hoburg/repos","events_url":"https://api.github.com/users/hoburg/events{/privacy}","received_events_url":"https://api.github.com/users/hoburg/received_events","type":"Organization","site_admin":false},"repo":{"id":20954246,"name":"gpkit","full_name":"hoburg/gpkit","owner":{"login":"hoburg","id":16762937,"avatar_url":"https://avatars.githubusercontent.com/u/16762937?v=3","gravatar_id":"","url":"https://api.github.com/users/hoburg","html_url":"https://github.com/hoburg","followers_url":"https://api.github.com/users/hoburg/followers","following_url":"https://api.github.com/users/hoburg/following{/other_user}","gists_url":"https://api.github.com/users/hoburg/gists{/gist_id}","starred_url":"https://api.github.com/users/hoburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoburg/subscriptions","organizations_url":"https://api.github.com/users/hoburg/orgs","repos_url":"https://api.github.com/users/hoburg/repos","events_url":"https://api.github.com/users/hoburg/events{/privacy}","received_events_url":"https://api.github.com/users/hoburg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hoburg/gpkit","description":"Python package for defining and manipulating geometric programming models.","fork":false,"url":"https://api.github.com/repos/hoburg/gpkit","forks_url":"https://api.github.com/repos/hoburg/gpkit/forks","keys_url":"https://api.github.com/repos/hoburg/gpkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoburg/gpkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoburg/gpkit/teams","hooks_url":"https://api.github.com/repos/hoburg/gpkit/hooks","issue_events_url":"https://api.github.com/repos/hoburg/gpkit/issues/events{/number}","events_url":"https://api.github.com/repos/hoburg/gpkit/events","assignees_url":"https://api.github.com/repos/hoburg/gpkit/assignees{/user}","branches_url":"https://api.github.com/repos/hoburg/gpkit/branches{/branch}","tags_url":"https://api.github.com/repos/hoburg/gpkit/tags","blobs_url":"https://api.github.com/repos/hoburg/gpkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoburg/gpkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoburg/gpkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoburg/gpkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoburg/gpkit/statuses/{sha}","languages_url":"https://api.github.com/repos/hoburg/gpkit/languages","stargazers_url":"https://api.github.com/repos/hoburg/gpkit/stargazers","contributors_url":"https://api.github.com/repos/hoburg/gpkit/contributors","subscribers_url":"https://api.github.com/repos/hoburg/gpkit/subscribers","subscription_url":"https://api.github.com/repos/hoburg/gpkit/subscription","commits_url":"https://api.github.com/repos/hoburg/gpkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoburg/gpkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoburg/gpkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoburg/gpkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/hoburg/gpkit/contents/{+path}","compare_url":"https://api.github.com/repos/hoburg/gpkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoburg/gpkit/merges","archive_url":"https://api.github.com/repos/hoburg/gpkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoburg/gpkit/downloads","issues_url":"https://api.github.com/repos/hoburg/gpkit/issues{/number}","pulls_url":"https://api.github.com/repos/hoburg/gpkit/pulls{/number}","milestones_url":"https://api.github.com/repos/hoburg/gpkit/milestones{/number}","notifications_url":"https://api.github.com/repos/hoburg/gpkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoburg/gpkit/labels{/name}","releases_url":"https://api.github.com/repos/hoburg/gpkit/releases{/id}","deployments_url":"https://api.github.com/repos/hoburg/gpkit/deployments","created_at":"2014-06-18T08:04:06Z","updated_at":"2016-01-25T01:21:54Z","pushed_at":"2016-03-12T00:19:06Z","git_url":"git://github.com/hoburg/gpkit.git","ssh_url":"git@github.com:hoburg/gpkit.git","clone_url":"https://github.com/hoburg/gpkit.git","svn_url":"https://github.com/hoburg/gpkit","homepage":"http://gpkit.readthedocs.org","size":29770,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":114,"forks":4,"open_issues":114,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/493"},"html":{"href":"https://github.com/hoburg/gpkit/pull/493"},"issue":{"href":"https://api.github.com/repos/hoburg/gpkit/issues/493"},"comments":{"href":"https://api.github.com/repos/hoburg/gpkit/issues/493/comments"},"review_comments":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/493/comments"},"review_comment":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/493/commits"},"statuses":{"href":"https://api.github.com/repos/hoburg/gpkit/statuses/506acfd4ae8fe2230d41f389789181cdc474ceb0"}}}}