Bokeh Buttons Slow to Read

I’ve noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)

Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active

It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.

Does anyone know about this limit? Can I speed up the button read?

So button press events are currently handled in a bit of a hacky way, by treating them as standard Bokeh model property updates. It's been proposed to add a real "event" message type for fire-and-forget type events like this. Presumably they would be trivial to consruct, send, and decode, which might explain this situation. That is just a speculation at this point, however.

Thanks,

Bryan

···

On Mar 8, 2016, at 6:21 PM, RedRaven <[email protected]> wrote:

I've noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)

Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active

It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.

Does anyone know about this limit? Can I speed up the button read?

--
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/49a313dc-23da-43b8-a61f-055afe50ad2f%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Interesting. The same behavior is also repeated with text input.

Is there anyway for me to hack together an event fire or at least an "on click" event to force the button read on time?

···

Sent from my iPhone

On Mar 8, 2016, at 8:06 PM, Bryan Van de Ven <[email protected]> wrote:

So button press events are currently handled in a bit of a hacky way, by treating them as standard Bokeh model property updates. It's been proposed to add a real "event" message type for fire-and-forget type events like this. Presumably they would be trivial to consruct, send, and decode, which might explain this situation. That is just a speculation at this point, however.

Thanks,

Bryan

On Mar 8, 2016, at 6:21 PM, RedRaven <[email protected]> wrote:

I've noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)

Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active

It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.

Does anyone know about this limit? Can I speed up the button read?

--
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/49a313dc-23da-43b8-a61f-055afe50ad2f%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/A8D7D6CA-762A-44E9-8374-B80BDFEF7B3D%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

An "event" message is not difficult in principle, but it will necessitate new code at the foundation of the protocol machinery, so any change there will need excessive new tests. But as I said it's only speculation, and now reading your first message again I am not so sure that's what you are describing. What exactly do you mean when you say you "can only pick up the state"? Are you saying there is an exception? Or None is returned? Or? As always, a runnable code example will go a very long way towards helping any diagnosis or investigation.

Thanks,

Bryan

···

On Mar 8, 2016, at 7:18 PM, Mail Lists <[email protected]> wrote:

Interesting. The same behavior is also repeated with text input.

Is there anyway for me to hack together an event fire or at least an "on click" event to force the button read on time?

Sent from my iPhone

On Mar 8, 2016, at 8:06 PM, Bryan Van de Ven <[email protected]> wrote:

So button press events are currently handled in a bit of a hacky way, by treating them as standard Bokeh model property updates. It's been proposed to add a real "event" message type for fire-and-forget type events like this. Presumably they would be trivial to consruct, send, and decode, which might explain this situation. That is just a speculation at this point, however.

Thanks,

Bryan

On Mar 8, 2016, at 6:21 PM, RedRaven <[email protected]> wrote:

I've noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)

Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active

It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.

Does anyone know about this limit? Can I speed up the button read?

--
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/49a313dc-23da-43b8-a61f-055afe50ad2f%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/A8D7D6CA-762A-44E9-8374-B80BDFEF7B3D%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/34A924BE-4E78-48F1-92DD-6250A8CD9506%40gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

By pick up i mean the following:

Suppose i have a radio button with 2 states- 0 and 1.

The button is initialized to state zero. I start the callback loop, 100ms update. Inside the loop i print the button state: button.active

I then switch the button state to 1. The button state printout doesnt change for at least 10-20 seconds.

So in code this would be something like this

Radio Button def (right out of the bokeh docs)

Def update(t):

       Print button.active

Callback(update(),100)

···

Sent from my iPhone

On Mar 8, 2016, at 9:33 PM, Bryan Van de Ven <[email protected]> wrote:

An "event" message is not difficult in principle, but it will necessitate new code at the foundation of the protocol machinery, so any change there will need excessive new tests. But as I said it's only speculation, and now reading your first message again I am not so sure that's what you are describing. What exactly do you mean when you say you "can only pick up the state"? Are you saying there is an exception? Or None is returned? Or? As always, a runnable code example will go a very long way towards helping any diagnosis or investigation.

Thanks,

Bryan

On Mar 8, 2016, at 7:18 PM, Mail Lists <[email protected]> wrote:

Interesting. The same behavior is also repeated with text input.

Is there anyway for me to hack together an event fire or at least an "on click" event to force the button read on time?

Sent from my iPhone

On Mar 8, 2016, at 8:06 PM, Bryan Van de Ven <[email protected]> wrote:

So button press events are currently handled in a bit of a hacky way, by treating them as standard Bokeh model property updates. It's been proposed to add a real "event" message type for fire-and-forget type events like this. Presumably they would be trivial to consruct, send, and decode, which might explain this situation. That is just a speculation at this point, however.

Thanks,

Bryan

On Mar 8, 2016, at 6:21 PM, RedRaven <[email protected]> wrote:

I've noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)

Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active

It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.

Does anyone know about this limit? Can I speed up the button read?

--
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/49a313dc-23da-43b8-a61f-055afe50ad2f%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/A8D7D6CA-762A-44E9-8374-B80BDFEF7B3D%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/34A924BE-4E78-48F1-92DD-6250A8CD9506%40gmail.com.
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/301CEE17-8062-43DA-88AC-09DE2EACBF62%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Here is a more complete example:

def update():
         print " Button Group State: " +str(button_group.active)
button_group = RadioButtonGroup(
        labels=["State 1", "State 2"], active=0)

# open a session to keep our local document in sync with server
session = push_session(curdoc())

curdoc().add_periodic_callback(update, 50)

session.show() # open the document in a browser

session.loop_until_closed() # run forever

This is in a bokeh server and there is a lot of other things going on but this is my minimal example.

···

On Tuesday, 8 March 2016 19:21:09 UTC-5, RedRaven wrote:

I’ve noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)

Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active

It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.

Does anyone know about this limit? Can I speed up the button read?