New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: Out of range float values are not JSON compliant version 0.12.5 #6222
Comments
The sublists in lats and lons probably need to be numpy arrays. Lists get serialized as pure plain json, which does not support sending nan values (this is entirely outside our control). But numpy arrays are serialized to a binary format that can faithfully represent nan values. |
Perhaps, but how could this behavior have changed between versions. For now, I'm stuck staying on version 0.12.4 |
Okay, thanks for the help bryevdv. You were correct. Using |
@bryevdv I'm actually finding the opposite to be true on Bokeh 0.12.14. That is, my data which is simply a list of lists (containing some NaN entries to produce intentional discontinuities in the plot) works fine, whereas similar data that is instead a numpy array triggers the |
It will be hard to say anything specific without the code. All it takes is one bad array type conversion to get this error, like in issue #7523. |
My data is a list of scatter point pairs where some are
For the working data, I see:
For the non-working data, it is instead:
If it would be helpful to do so, I could dump this data into a pastebin somewhere. |
Summary
Issue on versions 0.12.5 when plotting data with patches.
Error code is ValueError: Out of range float values are not JSON compliant.
Expected behavior
When using version 0.12.4 of the package the plotting works without any issue. This has been previously brought up in #5439 and fixed with #5544. It seems that this has broken from version 0.12.4 to 0.12.5.
Software
OS
Windows 7 Enterprise
Browser
Version 58.0.3029.81
Python
Code example
Taken from Sean law at https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/F-DD-wzOevY
Traceback
Traceback (most recent call last): File "P:\Work\Projects\Capacity Planning\Capacity Planning\test_bokeh\better_us_map_5.py", line 85, in <module> show(p) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\io.py", line 284, in show return _show_with_state(obj, _state, browser, new, notebook_handle=notebook_handle) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\io.py", line 314, in _show_with_state _show_file_with_state(obj, state, new, controller) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\io.py", line 319, in _show_file_with_state filename = save(obj, state=state) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\io.py", line 367, in save _save_helper(obj, filename, resources, title) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\io.py", line 422, in _save_helper html = file_html(obj, resources, title=title) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\embed.py", line 416, in file_html (docs_json, render_items) = _standalone_docs_json_and_render_items(models) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\embed.py", line 740, in _standalone_docs_json_and_render_items docs_json[k] = v.to_json() File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\document.py", line 734, in to_json doc_json = self.to_json_string() File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\document.py", line 763, in to_json_string return serialize_json(json, indent=indent) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\site-packages\bokeh\core\json_encoder.py", line 226, in serialize_json return json.dumps(obj, cls=BokehJSONEncoder, allow_nan=False, indent=indent, separators=separators, sort_keys=True, **kwargs) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\json\__init__.py", line 237, in dumps **kw).encode(obj) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\json\encoder.py", line 198, in encode chunks = self.iterencode(o, _one_shot=True) File "D:\Users\corey.ducharme\Anaconda\envs\bokeh\lib\json\encoder.py", line 256, in iterencode return _iterencode(o, 0) ValueError: Out of range float values are not JSON compliant
Attempts
I've tried debugging the issue further by looking at changes between version on Github, but my inexperience does not let allow me to research this issue in any depth. I hope I've been precise enough in my post, but please let me know if you need any further help or clarification : I'm still new to how Github functions. Best of luck on the project.
The text was updated successfully, but these errors were encountered: