{"action":"created","issue":{"url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/4","labels_url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/4/comments","events_url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/4/events","html_url":"https://github.com/mcmtroffaes/pycddlib/issues/4","id":59606396,"number":4,"title":"Undefined behavior of Matrix.canonicalize()","user":{"login":"Tastalian","id":1189580,"avatar_url":"https://avatars.githubusercontent.com/u/1189580?v=3","gravatar_id":"","url":"https://api.github.com/users/Tastalian","html_url":"https://github.com/Tastalian","followers_url":"https://api.github.com/users/Tastalian/followers","following_url":"https://api.github.com/users/Tastalian/following{/other_user}","gists_url":"https://api.github.com/users/Tastalian/gists{/gist_id}","starred_url":"https://api.github.com/users/Tastalian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tastalian/subscriptions","organizations_url":"https://api.github.com/users/Tastalian/orgs","repos_url":"https://api.github.com/users/Tastalian/repos","events_url":"https://api.github.com/users/Tastalian/events{/privacy}","received_events_url":"https://api.github.com/users/Tastalian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-03T07:44:42Z","updated_at":"2015-03-03T08:29:10Z","closed_at":null,"body":"Hello,\r\n\r\nThe behavior of Matrix.canonicalize() is not specified when the field `repr_type` is `cdd.ReprType.UNSPECIFIED`. \r\nTaking the example from the doc, I get two different behaviors:\r\n\r\n    In [22]: mat = cdd.Matrix([[2, 1, 2, 3], [0, 1, 2, 3], [3, 0, 1, 2], [0, -2, -4, -6]], number_type='fraction')\r\n    In [23]: mat.rep_type = cdd.RepType.GENERATOR\r\n    In [24]: mat.canonicalize()\r\n    Out[24]: (frozenset({1, 3}), frozenset())\r\n\r\nVersus:\r\n\r\n    In [25]: mat = cdd.Matrix([[2, 1, 2, 3], [0, 1, 2, 3], [3, 0, 1, 2], [0, -2, -4, -6]], number_type='fraction')\r\n    In [26]: mat.rep_type = cdd.RepType.INEQUALITY\r\n    In [27]: mat.canonicalize()\r\n    Out[27]: (frozenset({1, 3}), frozenset({0}))\r\n\r\nShouldn't there be a check here to avoid user mistakes?\r\n"},"comment":{"url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/comments/76905330","html_url":"https://github.com/mcmtroffaes/pycddlib/issues/4#issuecomment-76905330","issue_url":"https://api.github.com/repos/mcmtroffaes/pycddlib/issues/4","id":76905330,"user":{"login":"mcmtroffaes","id":158568,"avatar_url":"https://avatars.githubusercontent.com/u/158568?v=3","gravatar_id":"","url":"https://api.github.com/users/mcmtroffaes","html_url":"https://github.com/mcmtroffaes","followers_url":"https://api.github.com/users/mcmtroffaes/followers","following_url":"https://api.github.com/users/mcmtroffaes/following{/other_user}","gists_url":"https://api.github.com/users/mcmtroffaes/gists{/gist_id}","starred_url":"https://api.github.com/users/mcmtroffaes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcmtroffaes/subscriptions","organizations_url":"https://api.github.com/users/mcmtroffaes/orgs","repos_url":"https://api.github.com/users/mcmtroffaes/repos","events_url":"https://api.github.com/users/mcmtroffaes/events{/privacy}","received_events_url":"https://api.github.com/users/mcmtroffaes/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T08:29:10Z","updated_at":"2015-03-03T08:29:10Z","body":"pycddlib tries hard not to do anything cddlib wouldn't do:\r\n\r\nhttps://github.com/mcmtroffaes/pycddlib/blob/develop/cdd.pyx#L635\r\n\r\n... but I agree, it would be pythonic to help the user shooting herself/himself in the foot, for instance by raising a ValueError."}}