Unhandled Error

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

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.

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.

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.

Hi,

I would say this is possibly two things:

* a usage error (passing an array as a property when it's not appropriate)

* combined with bad handing on the Bokeh side (should catch in validation or give better error)

Is there any way you can identify what line in your code might be triggering this exception in Bokeh? (or share a minimal example?)

Thanks,

Bryan

···

On May 23, 2017, at 11:02, [email protected] wrote:

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 "<string>", 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.
>

--
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/ce66b0fc-6e93-4fdd-9a50-8936aad6a9dd%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

The issue was related to passing a numpy array to the FixedTicker model. I have created a GH issue https://github.com/bokeh/bokeh/issues/6405.

Thanks,

Mike

···

On Saturday, May 27, 2017 at 2:22:41 AM UTC+1, Bryan Van de ven wrote:

Hi,

I would say this is possibly two things:

  • a usage error (passing an array as a property when it’s not appropriate)

  • combined with bad handing on the Bokeh side (should catch in validation or give better error)

Is there any way you can identify what line in your code might be triggering this exception in Bokeh? (or share a minimal example?)

Thanks,

Bryan

On May 23, 2017, at 11:02, [email protected] wrote:

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.


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/ce66b0fc-6e93-4fdd-9a50-8936aad6a9dd%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

As mateusz noted before I got to it, this actually seems to be a dupe of another issue that was just fixed. There will be a new dev build out later today, if you have a chance to try out you code with it to verify that this week that would be helpful!

Thanks,

Bryan

···

On Jun 7, 2017, at 04:59, [email protected] wrote:

The issue was related to passing a numpy array to the FixedTicker model. I have created a GH issue https://github.com/bokeh/bokeh/issues/6405.

Thanks,

Mike

On Saturday, May 27, 2017 at 2:22:41 AM UTC+1, Bryan Van de ven wrote:
Hi,

I would say this is possibly two things:

* a usage error (passing an array as a property when it's not appropriate)

* combined with bad handing on the Bokeh side (should catch in validation or give better error)

Is there any way you can identify what line in your code might be triggering this exception in Bokeh? (or share a minimal example?)

Thanks,

Bryan

> On May 23, 2017, at 11:02, [email protected] wrote:
>
> 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 "<string>", 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.
> >
>
>
> --
> 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/ce66b0fc-6e93-4fdd-9a50-8936aad6a9dd%40continuum.io.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
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/2cd45783-701c-47b6-9fca-7d364caad4f3%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

Can confirm this is fixed in ‘0.12.6rc3’.

Thanks

···

On Wednesday, June 7, 2017 at 3:04:40 PM UTC+1, Bryan Van de ven wrote:

Hi,

As mateusz noted before I got to it, this actually seems to be a dupe of another issue that was just fixed. There will be a new dev build out later today, if you have a chance to try out you code with it to verify that this week that would be helpful!

Thanks,

Bryan

On Jun 7, 2017, at 04:59, [email protected] wrote:

The issue was related to passing a numpy array to the FixedTicker model. I have created a GH issue https://github.com/bokeh/bokeh/issues/6405.

Thanks,

Mike

On Saturday, May 27, 2017 at 2:22:41 AM UTC+1, Bryan Van de ven wrote:

Hi,

I would say this is possibly two things:

  • a usage error (passing an array as a property when it’s not appropriate)

  • combined with bad handing on the Bokeh side (should catch in validation or give better error)

Is there any way you can identify what line in your code might be triggering this exception in Bokeh? (or share a minimal example?)

Thanks,

Bryan

On May 23, 2017, at 11:02, [email protected] wrote:

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.


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/ce66b0fc-6e93-4fdd-9a50-8936aad6a9dd%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


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/2cd45783-701c-47b6-9fca-7d364caad4f3%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.