{"action":"created","issue":{"url":"https://api.github.com/repos/cvxgrp/cvxpy/issues/199","labels_url":"https://api.github.com/repos/cvxgrp/cvxpy/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/cvxgrp/cvxpy/issues/199/comments","events_url":"https://api.github.com/repos/cvxgrp/cvxpy/issues/199/events","html_url":"https://github.com/cvxgrp/cvxpy/issues/199","id":90012304,"number":199,"title":"Changes to user interface in CVXPY 1.0","user":{"login":"SteveDiamond","id":520736,"avatar_url":"https://avatars.githubusercontent.com/u/520736?v=3","gravatar_id":"","url":"https://api.github.com/users/SteveDiamond","html_url":"https://github.com/SteveDiamond","followers_url":"https://api.github.com/users/SteveDiamond/followers","following_url":"https://api.github.com/users/SteveDiamond/following{/other_user}","gists_url":"https://api.github.com/users/SteveDiamond/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveDiamond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveDiamond/subscriptions","organizations_url":"https://api.github.com/users/SteveDiamond/orgs","repos_url":"https://api.github.com/users/SteveDiamond/repos","events_url":"https://api.github.com/users/SteveDiamond/events{/privacy}","received_events_url":"https://api.github.com/users/SteveDiamond/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cvxgrp/cvxpy/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cvxgrp/cvxpy/milestones/1","html_url":"https://github.com/cvxgrp/cvxpy/milestones/1.0","labels_url":"https://api.github.com/repos/cvxgrp/cvxpy/milestones/1/labels","id":1174474,"number":1,"title":"1.0","description":null,"creator":{"login":"SteveDiamond","id":520736,"avatar_url":"https://avatars.githubusercontent.com/u/520736?v=3","gravatar_id":"","url":"https://api.github.com/users/SteveDiamond","html_url":"https://github.com/SteveDiamond","followers_url":"https://api.github.com/users/SteveDiamond/followers","following_url":"https://api.github.com/users/SteveDiamond/following{/other_user}","gists_url":"https://api.github.com/users/SteveDiamond/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveDiamond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveDiamond/subscriptions","organizations_url":"https://api.github.com/users/SteveDiamond/orgs","repos_url":"https://api.github.com/users/SteveDiamond/repos","events_url":"https://api.github.com/users/SteveDiamond/events{/privacy}","received_events_url":"https://api.github.com/users/SteveDiamond/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-06-22T05:00:42Z","updated_at":"2015-06-22T05:00:42Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-06-22T05:00:32Z","updated_at":"2015-09-15T23:57:40Z","closed_at":null,"body":"I'm working on cvxpy 1.0. There will be some changes to the user interface. These fall into three categories:\r\n\r\n1. Making cvxpy syntax more like NumPy.\r\n - The ``expr.value`` and ``constraint.dual_value`` will return NumPy 2D arrays instead of NumPy matrices.\r\n - The ``expr.size`` field will be replaced by ``expr.shape``, and ``expr.size`` will return ``expr.shape[0]*expr.shape[1]``, like in NumPy.\r\n - The variable argument functions, like ``vstack``, will take lists instead of multiple arguments, like in NumPy. People who are new to Python don't know about unpacking lists with ``*``, so lists are better.\r\n\r\n2. Adding sets and treating variables and parameters that belong to sets in a unified way.\r\n - I haven't figured out how this will work yet, but it may involve changing how variables and parameters that belong to sets are created. For example, the syntax for creating positive parameters may change from ``Parameter(\"positive\")`` to something that extends to nonnegativity constraints and positive variables.\r\n\r\n3. Better error messages and exceptions.\r\n - The error messages could be a lot better, and it might be nice to make more use of custom exception types.\r\n - I might add a flag you can set so DCP errors are triggered when you form an expression, rather than when you try to solve the problem. Perhaps this should even be the default.\r\n\r\nThe first category of changes will be really annoying, but I think they're necessary. The other two should be fairly easy to adjust to.\r\n\r\nPost here if you have any other ideas for changes to the user interface or thoughts on the proposed changes. \r\n\r\nTo be clear, there will be much more exciting new features, but they won't require rewriting any code that uses cvxpy."},"comment":{"url":"https://api.github.com/repos/cvxgrp/cvxpy/issues/comments/140583547","html_url":"https://github.com/cvxgrp/cvxpy/issues/199#issuecomment-140583547","issue_url":"https://api.github.com/repos/cvxgrp/cvxpy/issues/199","id":140583547,"user":{"login":"SteveDiamond","id":520736,"avatar_url":"https://avatars.githubusercontent.com/u/520736?v=3","gravatar_id":"","url":"https://api.github.com/users/SteveDiamond","html_url":"https://github.com/SteveDiamond","followers_url":"https://api.github.com/users/SteveDiamond/followers","following_url":"https://api.github.com/users/SteveDiamond/following{/other_user}","gists_url":"https://api.github.com/users/SteveDiamond/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveDiamond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveDiamond/subscriptions","organizations_url":"https://api.github.com/users/SteveDiamond/orgs","repos_url":"https://api.github.com/users/SteveDiamond/repos","events_url":"https://api.github.com/users/SteveDiamond/events{/privacy}","received_events_url":"https://api.github.com/users/SteveDiamond/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T23:57:40Z","updated_at":"2015-09-15T23:57:40Z","body":"The main goal in adding sets is to have a unified approach to parameters that belong to special sets (nonnegative, positive semidefinite, etc.) and variables that belong to special sets. This will change the user interface, which is why it's part of the cvxpy 1.0 release.\r\n\r\nA secondary goal is to sort out the huge mess that is constraints. Right now there's a distinction between the constraints the user can create (equality, inequality, and positive semidefinite cone constraints) and the constraints cvxpy can create internally. Even worse, there's a third level of constraints that's a half baked LinOp version of equality and inequality constraints.\r\n\r\nBy adding sets in the style of proposal 2, I hope to reduce the three types of constraints to a single type, which the user can create. \r\n\r\nI like your proposal too. I at some point want to get rid of LinOps and define the atoms more elegantly, maybe as partial optimization problems like you suggest. We'll need some way to export a simplified expression tree data structure (like the current LinOp data type) to pass to other libraries, but there's no reason to canonicalize into a special type of expression.\r\n\r\nAfter thinking about it more, I don't think the dual variable issue is a big deal. If someone is sophisticated enough to know what a dual variable is, they can handle the idea that only cone constraints have them.\r\n\r\nWhat do you think of the syntax for proposal 2? Here's how you create a variable constrained to be positive semidefinite:\r\n```\r\nX = PosSemidef(n).elem() # vs. X = Semidef(n) now.\r\n```\r\nand here's how you create a parameter with the same constraint:\r\n```\r\nP = PosSemidef(n).param() # not possible now.\r\n```\r\n\r\nI like ``expr.in(S)`` for creating constraints, but I'm worried that people will write ``expr in S`` and expect it to work. What do you think?"}}