{"action":"created","issue":{"url":"https://api.github.com/repos/mfitzp/icoshift/issues/2","repository_url":"https://api.github.com/repos/mfitzp/icoshift","labels_url":"https://api.github.com/repos/mfitzp/icoshift/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mfitzp/icoshift/issues/2/comments","events_url":"https://api.github.com/repos/mfitzp/icoshift/issues/2/events","html_url":"https://github.com/mfitzp/icoshift/issues/2","id":52149247,"number":2,"title":"Test fails on numpy  1.9.1","user":{"login":"lucapinello","id":1081322,"avatar_url":"https://avatars.githubusercontent.com/u/1081322?v=3","gravatar_id":"","url":"https://api.github.com/users/lucapinello","html_url":"https://github.com/lucapinello","followers_url":"https://api.github.com/users/lucapinello/followers","following_url":"https://api.github.com/users/lucapinello/following{/other_user}","gists_url":"https://api.github.com/users/lucapinello/gists{/gist_id}","starred_url":"https://api.github.com/users/lucapinello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucapinello/subscriptions","organizations_url":"https://api.github.com/users/lucapinello/orgs","repos_url":"https://api.github.com/users/lucapinello/repos","events_url":"https://api.github.com/users/lucapinello/events{/privacy}","received_events_url":"https://api.github.com/users/lucapinello/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-16T18:29:03Z","updated_at":"2016-02-05T12:07:17Z","closed_at":null,"body":"Hi I have some problem running the test.py:\r\n\r\n  ```\r\nimport icoshift\r\nimport numpy as np\r\n\r\ntest = np.array([\r\n[0, 0, 0, 2, 3, 2, 0, 0, 2, 1, 2, np.nan, 3, 4, 2, 3, 2, 0, 2, 3, 2],\r\n[0, 0, 2, 3, 2, 0, 0, 2, 3, 1, 2, np.nan, 3, 4, 3, 2, 0, 2, 3, 2, 0],\r\n[0, 2, 3, 2, 0, 0, 2, 3, 2, 1, 2, np.nan, 3, 4, 2, 0, 2, 3, 2, 0, 1],\r\n])\r\nxCS, ints, ind, target = icoshift.icoshift('average', test)\r\nprint '********** PASS 1: average **********'\r\n\r\ntest = np.array([\r\n[0, 0, 0, 2, 3, 2, 0, 0, 2, 3, 2, np.nan, 0, 0, 2, 3, 2, 0, 2, 3, 2],\r\n[0, 0, 2, 3, 2, 0, 0, 2, 3, 2, 0, np.nan, 0, 2, 3, 2, 0, 2, 3, 2, 0],\r\n[0, 2, 3, 2, 0, 0, 2, 3, 2, 0, 0, np.nan, 2, 3, 2, 0, 2, 3, 2, 0, 1],\r\n])\r\n\r\nxCS, ints, ind, target = icoshift.icoshift('median', test)\r\nprint '********** PASS 2: median **********'\r\n  ```\r\n\r\n\r\nI get:\r\n\r\n  ```\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-3-729c4e491a6c> in <module>()\r\n      7 [0, 2, 3, 2, 0, 0, 2, 3, 2, 1, 2, np.nan, 3, 4, 2, 0, 2, 3, 2, 0, 1],\r\n      8 ])\r\n----> 9 xCS, ints, ind, target = icoshift.icoshift('average', test)\r\n     10 print '********** PASS 1: average **********'\r\n     11 \r\n\r\n/gcdata/gcproj/Luca/noah/lib/python2.7/site-packages/icoshift/icoshift.pyc in icoshift(xt, xp, inter, n, scale, coshift_preprocessing, coshift_preprocessing_max_shift, fill_with_previous, average2_multiplier)\r\n    386         else:\r\n    387             intern_, flag_nan = remove_nan(\r\n--> 388                 ref(inter), cat(0, xt, xp), select, flags=True)\r\n    389             intern_ = vec(intern_.T).T\r\n    390 \r\n\r\n/gcdata/gcproj/Luca/noah/lib/python2.7/site-packages/icoshift/icoshift.pyc in remove_nan(b, signal, select, flags)\r\n    994 \r\n    995             c.resize(d.shape)\r\n--> 996             c[count:count + max(a.shape) + 1] = d\r\n    997 \r\n    998             count = count + max(a.shape)\r\n\r\nValueError: could not broadcast input array from shape (4) into shape (3)\r\n  ```\r\n\r\nAny idea on how to fix it?\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7060746-test-fails-on-numpy-1-9-1?utm_campaign=plugin&utm_content=tracker%2F4634394&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F4634394&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/mfitzp/icoshift/issues/comments/180321822","html_url":"https://github.com/mfitzp/icoshift/issues/2#issuecomment-180321822","issue_url":"https://api.github.com/repos/mfitzp/icoshift/issues/2","id":180321822,"user":{"login":"atomman","id":10225003,"avatar_url":"https://avatars.githubusercontent.com/u/10225003?v=3","gravatar_id":"","url":"https://api.github.com/users/atomman","html_url":"https://github.com/atomman","followers_url":"https://api.github.com/users/atomman/followers","following_url":"https://api.github.com/users/atomman/following{/other_user}","gists_url":"https://api.github.com/users/atomman/gists{/gist_id}","starred_url":"https://api.github.com/users/atomman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomman/subscriptions","organizations_url":"https://api.github.com/users/atomman/orgs","repos_url":"https://api.github.com/users/atomman/repos","events_url":"https://api.github.com/users/atomman/events{/privacy}","received_events_url":"https://api.github.com/users/atomman/received_events","type":"User","site_admin":false},"created_at":"2016-02-05T12:07:17Z","updated_at":"2016-02-05T12:07:17Z","body":"The test fails  for me too but with a different error.\r\n\r\nAny Idea why?\r\n\r\n```python\r\nimport icoshift\r\nimport numpy as np\r\n\r\ntest = np.array([\r\n[0, 0, 0, 2, 3, 2, 0, 0, 2, 1, 2, np.nan, 3, 4, 2, 3, 2, 0, 2, 3, 2],\r\n[0, 0, 2, 3, 2, 0, 0, 2, 3, 1, 2, np.nan, 3, 4, 3, 2, 0, 2, 3, 2, 0],\r\n[0, 2, 3, 2, 0, 0, 2, 3, 2, 1, 2, np.nan, 3, 4, 2, 0, 2, 3, 2, 0, 1],\r\n])\r\nxCS, ints, ind, target = icoshift.icoshift('average', test)\r\nprint '********** PASS 1: average **********'\r\n\r\ntest = np.array([\r\n[0, 0, 0, 2, 3, 2, 0, 0, 2, 3, 2, np.nan, 0, 0, 2, 3, 2, 0, 2, 3, 2],\r\n[0, 0, 2, 3, 2, 0, 0, 2, 3, 2, 0, np.nan, 0, 2, 3, 2, 0, 2, 3, 2, 0],\r\n[0, 2, 3, 2, 0, 0, 2, 3, 2, 0, 0, np.nan, 2, 3, 2, 0, 2, 3, 2, 0, 1],\r\n])\r\n\r\nxCS, ints, ind, target = icoshift.icoshift('median', test)\r\nprint '********** PASS 2: median **********'\r\n```\r\ngives\r\n\r\n```python\r\nC:\\Anaconda2\\lib\\site-packages\\scipy\\stats\\stats.py:316: RuntimeWarning: invalid value encountered in true_divide\r\n  return np.mean(x, axis) / factor\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n<ipython-input-1-729c4e491a6c> in <module>()\r\n      7 [0, 2, 3, 2, 0, 0, 2, 3, 2, 1, 2, np.nan, 3, 4, 2, 0, 2, 3, 2, 0, 1],\r\n      8 ])\r\n----> 9 xCS, ints, ind, target = icoshift.icoshift('average', test)\r\n     10 print '********** PASS 1: average **********'\r\n     11 \r\n\r\nC:\\Anaconda2\\lib\\site-packages\\icoshift\\icoshift.pyc in icoshift(xt, xp, inter, n, scale, coshift_preprocessing, coshift_preprocessing_max_shift, fill_with_previous, average2_multiplier)\r\n    386         else:\r\n    387             intern_, flag_nan = remove_nan(\r\n--> 388                 ref(inter), cat(0, xt, xp), select, flags=True)\r\n    389             intern_ = vec(intern_.T).T\r\n    390 \r\n\r\nC:\\Anaconda2\\lib\\site-packages\\icoshift\\icoshift.pyc in remove_nan(b, signal, select, flags)\r\n    980 \r\n    981             if numpy.any(~in_[0]):\r\n--> 982                 a = cat(1, numpy.array([0]), a)\r\n    983 \r\n    984             else:\r\n\r\nC:\\Anaconda2\\lib\\site-packages\\icoshift\\icoshift.pyc in cat(dim, *args)\r\n     23 \r\n     24 def cat(dim, *args):\r\n---> 25     return numpy.concatenate([r for r in args if r.shape[0] > 0], axis=dim)\r\n     26 \r\n     27 \r\n\r\nIndexError: axis 1 out of bounds [0, 1)\r\n```\r\n"}}