I’m trying to use bokeh from an interactive python session. My idea is to follow these steps:
1.- modify data/visualization
2.- start bokeh server
3.- explore data
4 .- kill server (C-c)
5.- repeat
My code is something like this:
import pandas as pd
import bokeh
import bokeh.io as bio
import bokeh.layouts as blo
import bokeh.plotting as bpl
import bokeh.models as bmo
import bokeh.server.server as bss
from bokeh.server.server import Server
def bkapp(doc):
df= pd.read_pickle('df.pkl')
source = bpl.ColumnDataSource(df)
def callback(attr, old, new):
metric = sel.value
data = df[df['metric']==metric]
source.data = bpl.ColumnDataSource.from_df(data)
metrics = sorted(df['metric'].unique())
sel = bmo.Select(title="Metrics:", options=metrics, value=metrics[0])
sel.on_change("value", callback)
plot1 = bpl.figure()
plot1.line('x', 'y', source=source)
doc.add_root(blo.column(sel, plot1))
server = bss.Server({'/': bkapp}, port=8080, address="0.0.0.0")
server.start()
server.io_loop.start()
It kind of works, but when I start the sever for a second time after making changes to bkapp, it does not update the view. It keeps using the original version of bkapp. Is this the intended behavior? Is there any cache I can clean so the page reflects the changes made to bkapp?
Thank you!

