{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/8602","labels_url":"https://api.github.com/repos/sympy/sympy/issues/8602/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/8602/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/8602/events","html_url":"https://github.com/sympy/sympy/pull/8602","id":51716416,"number":8602,"title":"Add Theano printing support for And/Or logical operators.","user":{"login":"richardotis","id":6405510,"avatar_url":"https://avatars.githubusercontent.com/u/6405510?v=3","gravatar_id":"","url":"https://api.github.com/users/richardotis","html_url":"https://github.com/richardotis","followers_url":"https://api.github.com/users/richardotis/followers","following_url":"https://api.github.com/users/richardotis/following{/other_user}","gists_url":"https://api.github.com/users/richardotis/gists{/gist_id}","starred_url":"https://api.github.com/users/richardotis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardotis/subscriptions","organizations_url":"https://api.github.com/users/richardotis/orgs","repos_url":"https://api.github.com/users/richardotis/repos","events_url":"https://api.github.com/users/richardotis/events{/privacy}","received_events_url":"https://api.github.com/users/richardotis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-11T17:45:52Z","updated_at":"2015-01-03T16:54:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/8602","html_url":"https://github.com/sympy/sympy/pull/8602","diff_url":"https://github.com/sympy/sympy/pull/8602.diff","patch_url":"https://github.com/sympy/sympy/pull/8602.patch"},"body":"This PR builds on #2366 and #2370 to add support for Theano translation of piecewise functions containing logical operators in their conditions. This is useful for specifying conditions that are the intersection of sets of numbers, e.g., c_1 <= x < c_2, or the union, e.g., x < c_1 or x > c_2.\r\n\r\nExample (from included test):\r\n```python\r\n    expr = sy.Piecewise((0, sy.And(x>0, x<2)), (x, sy.Or(x>2, x<0)))\r\n    result = theano_code(expr)\r\n    expected = tt.switch(tt.and_(xt>0, xt<2), 0, tt.switch(tt.or_(xt>2, xt<0), xt, np.nan))\r\n    assert theq(result, expected)\r\n```"},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/68601331","html_url":"https://github.com/sympy/sympy/pull/8602#issuecomment-68601331","issue_url":"https://api.github.com/repos/sympy/sympy/issues/8602","id":68601331,"user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"created_at":"2015-01-03T16:54:56Z","updated_at":"2015-01-03T16:54:56Z","body":"It's been a while since I've looked at this so I'm not able to fully attest to its correctness.  In principle it looks fine though."}}