{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/6634","labels_url":"https://api.github.com/repos/numpy/numpy/issues/6634/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/6634/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/6634/events","html_url":"https://github.com/numpy/numpy/issues/6634","id":115396283,"number":6634,"title":"Problems encountered when trying to upgrade sagemath to numpy-1.10.1","user":{"login":"kiwifb","id":151475,"avatar_url":"https://avatars.githubusercontent.com/u/151475?v=3","gravatar_id":"","url":"https://api.github.com/users/kiwifb","html_url":"https://github.com/kiwifb","followers_url":"https://api.github.com/users/kiwifb/followers","following_url":"https://api.github.com/users/kiwifb/following{/other_user}","gists_url":"https://api.github.com/users/kiwifb/gists{/gist_id}","starred_url":"https://api.github.com/users/kiwifb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiwifb/subscriptions","organizations_url":"https://api.github.com/users/kiwifb/orgs","repos_url":"https://api.github.com/users/kiwifb/repos","events_url":"https://api.github.com/users/kiwifb/events{/privacy}","received_events_url":"https://api.github.com/users/kiwifb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-05T23:09:22Z","updated_at":"2015-11-06T01:20:06Z","closed_at":null,"body":"I have been looking on and off at moving sagemath beyond numpy 1.8.x and numpy 1.10.1 behaves better for us than the 1.9 series [ see http://trac.sagemath.org/ticket/17642]. However we have a strange conversion problem within numpy's `linspace` function\r\n```\r\nsage: import numpy\r\nsage: u1min, u1max = -1.5, 1.5\r\nsage: u1num = 10\r\nsage: u1min.__array_interface__\r\n{'typestr': '=f8'}\r\nsage: u1max.__array_interface__\r\n{'typestr': '=f8'}\r\nsage: u1_array = numpy.linspace(u1min, u1max, u1num)\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-6-666f5f61234c> in <module>()\r\n----> 1 u1_array = numpy.linspace(u1min, u1max, u1num)\r\n\r\n/home/frb15/gentoo/usr/lib/python2.7/site-packages/numpy/core/function_base.py in linspace(start, stop, num, endpoint, retstep, dtype)\r\n     91     stop = stop * 1.\r\n     92 \r\n---> 93     dt = result_type(start, stop, float(num))\r\n     94     if dtype is None:\r\n     95         dtype = dt\r\n\r\nTypeError: data type not understood\r\n```\r\nIt appears that `start` and `stop` are not converted to float by the multiplication by `1.`. The initial suggestion in issue #3504 to use `float` to cast the value to the right types would work here. Of course in that context `dt` becomes trivially `float`."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/154254211","html_url":"https://github.com/numpy/numpy/issues/6634#issuecomment-154254211","issue_url":"https://api.github.com/repos/numpy/numpy/issues/6634","id":154254211,"user":{"login":"kiwifb","id":151475,"avatar_url":"https://avatars.githubusercontent.com/u/151475?v=3","gravatar_id":"","url":"https://api.github.com/users/kiwifb","html_url":"https://github.com/kiwifb","followers_url":"https://api.github.com/users/kiwifb/followers","following_url":"https://api.github.com/users/kiwifb/following{/other_user}","gists_url":"https://api.github.com/users/kiwifb/gists{/gist_id}","starred_url":"https://api.github.com/users/kiwifb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiwifb/subscriptions","organizations_url":"https://api.github.com/users/kiwifb/orgs","repos_url":"https://api.github.com/users/kiwifb/repos","events_url":"https://api.github.com/users/kiwifb/events{/privacy}","received_events_url":"https://api.github.com/users/kiwifb/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T01:20:06Z","updated_at":"2015-11-06T01:20:06Z","body":"Introducing `asarray` seems to solve the problem, but is it appropriate?\r\n```\r\n    # Convert float/complex array scalars to float, gh-3504\r\n    from numpy import asarray\r\n    start = asarray(start) * 1.\r\n    stop = asarray(stop) * 1.\r\n```"}}