{"action":"created","issue":{"url":"https://api.github.com/repos/desihub/specsim/issues/10","labels_url":"https://api.github.com/repos/desihub/specsim/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/desihub/specsim/issues/10/comments","events_url":"https://api.github.com/repos/desihub/specsim/issues/10/events","html_url":"https://github.com/desihub/specsim/issues/10","id":112830389,"number":10,"title":"Unit tests failing on numpy <= 1.8","user":{"login":"dkirkby","id":185007,"avatar_url":"https://avatars.githubusercontent.com/u/185007?v=3","gravatar_id":"","url":"https://api.github.com/users/dkirkby","html_url":"https://github.com/dkirkby","followers_url":"https://api.github.com/users/dkirkby/followers","following_url":"https://api.github.com/users/dkirkby/following{/other_user}","gists_url":"https://api.github.com/users/dkirkby/gists{/gist_id}","starred_url":"https://api.github.com/users/dkirkby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkirkby/subscriptions","organizations_url":"https://api.github.com/users/dkirkby/orgs","repos_url":"https://api.github.com/users/dkirkby/repos","events_url":"https://api.github.com/users/dkirkby/events{/privacy}","received_events_url":"https://api.github.com/users/dkirkby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-22T15:34:55Z","updated_at":"2015-10-22T17:08:40Z","closed_at":null,"body":"The relevant test is:\r\n```\r\n    x, y = altaz_to_focalplane(angle, angle[:, np.newaxis],\r\n        angle[:, np.newaxis, np.newaxis], 0.)\r\n    assert x.shape == y.shape and x.shape == (3, 3, 3)\r\n```\r\nwhich works correctly with numpy 1.9 but gives a shape (3, 3, 1) for numpy <= 1.8.  I am only seeing this error in TravisCL logs since I am running numpy 1.9."},"comment":{"url":"https://api.github.com/repos/desihub/specsim/issues/comments/150293164","html_url":"https://github.com/desihub/specsim/issues/10#issuecomment-150293164","issue_url":"https://api.github.com/repos/desihub/specsim/issues/10","id":150293164,"user":{"login":"dkirkby","id":185007,"avatar_url":"https://avatars.githubusercontent.com/u/185007?v=3","gravatar_id":"","url":"https://api.github.com/users/dkirkby","html_url":"https://github.com/dkirkby","followers_url":"https://api.github.com/users/dkirkby/followers","following_url":"https://api.github.com/users/dkirkby/following{/other_user}","gists_url":"https://api.github.com/users/dkirkby/gists{/gist_id}","starred_url":"https://api.github.com/users/dkirkby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkirkby/subscriptions","organizations_url":"https://api.github.com/users/dkirkby/orgs","repos_url":"https://api.github.com/users/dkirkby/repos","events_url":"https://api.github.com/users/dkirkby/events{/privacy}","received_events_url":"https://api.github.com/users/dkirkby/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T17:08:40Z","updated_at":"2015-10-22T17:08:40Z","body":"The source of the problem is a change in `np.einsum` for the following args:\r\n```\r\nv = np.einsum('ij...,j...->i...', R, u)\r\n```\r\nwhere\r\n```\r\nR.shape = (3, 3, 3, 1, 1)\r\nu.shape = (3, 3, 3)\r\n```\r\nIn numpy 1.9, the output has:\r\n```\r\nv.shape = (3, 3, 3, 3)\r\n```\r\nbut in numpy 1.8:\r\n```\r\nv.shape = (3, 3, 3, 1)\r\n```\r\n\r\nThe underlying broadcast rules have not changed, since this test gives the same result with 1.8 and 1.9:\r\n```\r\nR, u  = np.arange(3)[:,np.newaxis,np.newaxis], np.arange(9).reshape(3,3)\r\nR.shape, u.shape, np.broadcast(R, u).shape\r\n((3, 1, 1), (3, 3), (3, 3, 3))\r\n```\r\n\r\nI can reproduce the unit test failure with:\r\n```\r\nR, u  = np.arange(27).reshape(3,3,3)[:,:,:,np.newaxis,np.newaxis], np.arange(27).reshape(3,3,3)\r\nnp.einsum('ij...,j...->i...', R, u).shape\r\n```\r\nwhich gives `(3, 3, 3, 1)` in 1.8 and `(3, 3, 3, 3)` in 1.9."}}