Hi, yes I was aware that this was the cause of the error but where it came from was a mystery!
Using --log-level debug in bokeh serve the full traceback is as follows:
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/bokeh/server/protocol/server_handler.py”, line 39, in handle
work = yield handler(message, connection)
File “/usr/local/lib/python3.5/dist-packages/tornado/gen.py”, line 1015, in run
value = future.result()
File “/usr/local/lib/python3.5/dist-packages/tornado/concurrent.py”, line 237, in result
raise_exc_info(self._exc_info)
File “”, line 3, in raise_exc_info
File “/usr/local/lib/python3.5/dist-packages/tornado/gen.py”, line 1024, in run
yielded = self.gen.send(value)
File “/usr/local/lib/python3.5/dist-packages/bokeh/server/session.py”, line 48, in _needs_document_lock_wrapper
result = yield yield_for_all_futures(func(self, *args, **kwargs))
File “/usr/local/lib/python3.5/dist-packages/bokeh/server/session.py”, line 218, in _handle_patch
message.apply_to_document(self.document, self)
File “/usr/local/lib/python3.5/dist-packages/bokeh/server/protocol/messages/patch_doc.py”, line 44, in apply_to_document
doc.apply_json_patch(self.content, setter)
File “/usr/local/lib/python3.5/dist-packages/bokeh/document.py”, line 352, in apply_json_patch
self._initialize_references_json(references_json, references)
File “/usr/local/lib/python3.5/dist-packages/bokeh/document.py”, line 1005, in _initialize_references_json
instance.update_from_json(obj_attrs, models=references, setter=setter)
File “/usr/local/lib/python3.5/dist-packages/bokeh/core/has_props.py”, line 394, in update_from_json
self.set_from_json(k, v, models, setter)
File “/usr/local/lib/python3.5/dist-packages/bokeh/core/has_props.py”, line 336, in set_from_json
descriptor.set_from_json(self, json, models, setter)
File “/usr/local/lib/python3.5/dist-packages/bokeh/core/property/descriptors.py”, line 565, in set_from_json
models, setter)
File “/usr/local/lib/python3.5/dist-packages/bokeh/core/property/descriptors.py”, line 285, in set_from_json
self._internal_set(obj, json, setter)
File “/usr/local/lib/python3.5/dist-packages/bokeh/core/property/descriptors.py”, line 713, in _internal_set
self._real_set(obj, old, value, setter=setter)
File “/usr/local/lib/python3.5/dist-packages/bokeh/core/property/descriptors.py”, line 746, in _real_set
unchanged = self.property.matches(value, old) and (hint is None)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I can open an issue on GH unless you know of a related issue.
Thanks again for working tirelessly with the community!
Mike
···
On Friday, May 19, 2017 at 6:18:17 AM UTC+1, Bryan Van de ven wrote:
Should add: if the error is coming from Bokeh code, then that’s probably a bug and a GH issue with full information would be appreciated.
Thanks,
Bryan
On May 19, 2017, at 00:17, Bryan Van de ven [email protected] wrote:
Can you post the full stack trace? Assuming the problem is coming from your code, the issue is that you can’t use a numb array in an implicit boolean context:
In [8]: import numpy as np
In [9]: a = np.array([True, False])
In [10]: if a: pass
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-10-65a7b6765dd7> in <module>()
----> 1 if a: pass
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
And the solution is to use a.all() or all(a) as suggested.
Thanks,
Bryan
.On May 18, 2017, at 10:33, [email protected] wrote:
Hi,
I am running a bokeh server and getting a message in the console saying:
'Unhandled Error reply to 5221166D6FDE848408DB6B4BB403F796A: ValueError(‘The truth value of an array with more than one element is ambiguous. Use a.any() or a.all())’
I am aware that this is a python error, however, the bokeh app still works as expected and there doesn’t seem to be a way for me to trace the ‘error’ back to a line in the python code.
Any idea why this is happening?
Thanks,
Mike
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/b2678b90-9b8a-4452-9853-0a23985fe49a%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.