{"action":"created","comment":{"url":"https://api.github.com/repos/hoburg/gpkit/pulls/comments/78477806","id":78477806,"diff_hunk":"@@ -0,0 +1,140 @@\n+\"\"\"Models for assessing primal feasibility\"\"\"\n+from .model import Model\n+from .set import ConstraintSet\n+from ..nomials import Variable, VectorVariable, parse_subs, NomialArray\n+\n+\n+class RelaxAll(Model):\n+    \"\"\"Relax constraints the same amount, as in Eqn. 10 of [Boyd2007].\n+\n+    Arguments\n+    ---------\n+    constraints : iterable\n+        Constraints which will be relaxed (made easier).\n+\n+    varname : str\n+        LaTeX name of relaxation variable.\n+\n+\n+    Attributes\n+    ----------\n+    relaxvar : Variable\n+        The variable controlling the relaxation. A solved value of 1 means no\n+        relaxation. Higher values indicate the amount by which all constraints\n+        have been made easier: e.g., a value of 1.5 means all constraints were\n+        50 percent easier in the final solution than in the original problem.\n+\n+    [Boyd2007] : \"A tutorial on geometric programming\", Optim Eng 8:67-122\n+\n+    \"\"\"\n+\n+    def __init__(self, constraints):\n+        if not isinstance(constraints, ConstraintSet):\n+            constraints = ConstraintSet(constraints)\n+        substitutions = dict(constraints.substitutions)\n+        posynomials = constraints.as_posyslt1()\n+        self.relaxvar = Variable(\"C\", models=[\"Relax\"],\n+                                 modelnums=[Model._nums[\"Relax\"]])\n+        Model.__init__(self, self.relaxvar,\n+                       [[posy <= self.relaxvar\n+                         for posy in posynomials],\n+                        self.relaxvar >= 1],\n+                       substitutions,\n+                       name=False)","path":"gpkit/constraints/relax.py","position":43,"original_position":43,"commit_id":"c079c6c4cea05f4de63c4f55631c5c9f1e884070","original_commit_id":"c079c6c4cea05f4de63c4f55631c5c9f1e884070","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":"or perhaps RelaxConstraints should be capable of producing this formulation as a special case, e.g. by a boolean keyword arg?\r\n\r\nThe gp_tutorial lists two different versions of the RelaxConstraints formulation (equations 10 and 11).","created_at":"2016-09-13T00:13:47Z","updated_at":"2016-09-13T00:13:47Z","html_url":"https://github.com/hoburg/gpkit/pull/856#discussion_r78477806","pull_request_url":"https://api.github.com/repos/hoburg/gpkit/pulls/856","_links":{"self":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/comments/78477806"},"html":{"href":"https://github.com/hoburg/gpkit/pull/856#discussion_r78477806"},"pull_request":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/856"}}},"pull_request":{"url":"https://api.github.com/repos/hoburg/gpkit/pulls/856","id":84256443,"html_url":"https://github.com/hoburg/gpkit/pull/856","diff_url":"https://github.com/hoburg/gpkit/pull/856.diff","patch_url":"https://github.com/hoburg/gpkit/pull/856.patch","issue_url":"https://api.github.com/repos/hoburg/gpkit/issues/856","number":856,"state":"open","locked":false,"title":"Feasibility models","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":"at long last!\r\n\r\ndepends on #854\r\n\r\n  - [x] write a `Model.feasibility()` method that reports on both primal and dual feasibility\r\n     - @galbramc I'm afraid this will require another circular import...we can meet in person sometime and go over why I think this is an OK (well, python-essential) design pattern. :p\r\n  - [x] update the include/exclude logic in `RelaxConstants` to share with `LinkedConstraints`: see #845","created_at":"2016-09-07T08:24:35Z","updated_at":"2016-09-13T00:13:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb29eb4223a6249793b15a0d1a0b7f11d8125484","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hoburg/gpkit/milestones/13","html_url":"https://github.com/hoburg/gpkit/milestones/Next%20release","labels_url":"https://api.github.com/repos/hoburg/gpkit/milestones/13/labels","id":1608329,"number":13,"title":"Next release","description":"Frustrations / bugs / etc that are achievable in ~ 1 month timeframe.","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":19,"closed_issues":45,"state":"open","created_at":"2016-02-26T16:03:40Z","updated_at":"2016-09-12T23:46:16Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hoburg/gpkit/pulls/856/commits","review_comments_url":"https://api.github.com/repos/hoburg/gpkit/pulls/856/comments","review_comment_url":"https://api.github.com/repos/hoburg/gpkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hoburg/gpkit/issues/856/comments","statuses_url":"https://api.github.com/repos/hoburg/gpkit/statuses/c079c6c4cea05f4de63c4f55631c5c9f1e884070","head":{"label":"hoburg:feasmodtest","ref":"feasmodtest","sha":"c079c6c4cea05f4de63c4f55631c5c9f1e884070","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-09-01T06:25:30Z","pushed_at":"2016-09-12T23:46:16Z","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":31699,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":164,"forks":6,"open_issues":164,"watchers":9,"default_branch":"master"}},"base":{"label":"hoburg:master","ref":"master","sha":"0a15d2ccc347ff6dad5cdbac45a800fb92db53d4","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-09-01T06:25:30Z","pushed_at":"2016-09-12T23:46:16Z","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":31699,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":164,"forks":6,"open_issues":164,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/856"},"html":{"href":"https://github.com/hoburg/gpkit/pull/856"},"issue":{"href":"https://api.github.com/repos/hoburg/gpkit/issues/856"},"comments":{"href":"https://api.github.com/repos/hoburg/gpkit/issues/856/comments"},"review_comments":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/856/comments"},"review_comment":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hoburg/gpkit/pulls/856/commits"},"statuses":{"href":"https://api.github.com/repos/hoburg/gpkit/statuses/c079c6c4cea05f4de63c4f55631c5c9f1e884070"}}}}
{"actor":{"display_login":"whoburg"}}