{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/2893","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/2893/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/2893/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/2893/events","html_url":"https://github.com/bokeh/bokeh/issues/2893","id":107502439,"number":2893,"title":"Ranges using `numpy.float32` when creating a new figure fail","user":{"login":"jakirkham","id":3019665,"avatar_url":"https://avatars.githubusercontent.com/u/3019665?v=3","gravatar_id":"","url":"https://api.github.com/users/jakirkham","html_url":"https://github.com/jakirkham","followers_url":"https://api.github.com/users/jakirkham/followers","following_url":"https://api.github.com/users/jakirkham/following{/other_user}","gists_url":"https://api.github.com/users/jakirkham/gists{/gist_id}","starred_url":"https://api.github.com/users/jakirkham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakirkham/subscriptions","organizations_url":"https://api.github.com/users/jakirkham/orgs","repos_url":"https://api.github.com/users/jakirkham/repos","events_url":"https://api.github.com/users/jakirkham/events{/privacy}","received_events_url":"https://api.github.com/users/jakirkham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-21T12:39:10Z","updated_at":"2015-09-21T12:56:04Z","closed_at":null,"body":"It appears that when providing `x_range` or `y_range` a `numpy.float32` that the follow traceback is generated. Converting the `numpy.float32` values to either `numpy.float64` or `float` resolves the issue. However, it would be nice not to get this error in the first place.\r\n\r\n\r\n    ---------------------------------------------------------------------------\r\n    ValueError                                Traceback (most recent call last)\r\n    <ipython-input-134-a923ef6fd65e> in <module>()\r\n        102 tr_srcs = ColumnDataSource(data=dict(times_sel=[], traces_sel=[], colors_sel=[]))\r\n        103 plot_tr = bp.figure(plot_width=950, plot_height=500, x_range=(numpy.float32(time[0]), numpy.float32(time[-1])), y_range=(float(traces.min()), float(traces.max())),\r\n    --> 104                  tools=[\"pan\", \"box_zoom\", \"resize\", \"wheel_zoom\", \"save\", \"reset\"], title=\"ROI traces\")\r\n        105 plot_tr.multi_line(\"times_sel\", \"traces_sel\", source=tr_srcs, alpha=0.6, color=\"colors_sel\")\r\n        106 \r\n    \r\n    /opt/conda/lib/python2.7/site-packages/bokeh/plotting.pyc in figure(**kwargs)\r\n        273         kwargs['plot_width'] = kwargs.pop('width')\r\n        274 \r\n    --> 275     fig = Figure(**kwargs)\r\n        276     curdoc()._current_plot = fig\r\n        277     if curdoc().autoadd:\r\n    \r\n    /opt/conda/lib/python2.7/site-packages/bokeh/plotting.pyc in __init__(self, *arg, **kw)\r\n         67         super(Figure, self).__init__(*arg, **kw)\r\n         68 \r\n    ---> 69         self.x_range = _get_range(x_range)\r\n         70         self.y_range = _get_range(y_range)\r\n         71 \r\n    \r\n    /opt/conda/lib/python2.7/site-packages/bokeh/plotting_helpers.pyc in _get_range(range_input)\r\n        171             except ValueError: # @mattpap suggests ValidationError instead\r\n        172                 pass\r\n    --> 173     raise ValueError(\"Unrecognized range input: '%s'\" % str(range_input))\r\n        174 \r\n        175 def _get_axis_class(axis_type, range_input):\r\n    \r\n    ValueError: Unrecognized range input: '(0.0, 149.0)'"},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/141966486","html_url":"https://github.com/bokeh/bokeh/issues/2893#issuecomment-141966486","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/2893","id":141966486,"user":{"login":"bryevdv","id":1078448,"avatar_url":"https://avatars.githubusercontent.com/u/1078448?v=3","gravatar_id":"","url":"https://api.github.com/users/bryevdv","html_url":"https://github.com/bryevdv","followers_url":"https://api.github.com/users/bryevdv/followers","following_url":"https://api.github.com/users/bryevdv/following{/other_user}","gists_url":"https://api.github.com/users/bryevdv/gists{/gist_id}","starred_url":"https://api.github.com/users/bryevdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryevdv/subscriptions","organizations_url":"https://api.github.com/users/bryevdv/orgs","repos_url":"https://api.github.com/users/bryevdv/repos","events_url":"https://api.github.com/users/bryevdv/events{/privacy}","received_events_url":"https://api.github.com/users/bryevdv/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T12:56:04Z","updated_at":"2015-09-21T12:56:04Z","body":"***OH***, you mean creating array scalars, as the items in a list? I'm guessing the items fail the `Range1d` validation type check. Just naively allowing Numpy array scalars there is problematic, it would introduce a hard dependency on NumPy at the lowest levels of the library, affecting everything. Not sure it's worth the effort to try and be clever somehow. Why would you need to specifically pass array scalars like that?"}}