# duplicate edit variable

In console when I show charts after one run (ie the first execution is successful then when re-running), I get the following error,

### Bokeh Error

duplicate edit variable


python2.7
bokeh .12.3

I combine 3 simple bar plots via show( row(a,b,c) ).

Should I be clearing any variables? Should I close the charts?

A terrible error, kills development time…

Hi,

In console when I show charts after one run (ie the first execution is successful then when re-running), I get the following error,
Bokeh Error

duplicate edit variable
I combine 3 simple bar plots via show( row(a,b,c) ).
Should I be clearing any variables? Should I close the charts?

Somehow, somewhere you are putting the same plot in one document twice. It's hard to say anything more specific without code to inspect or run. In general when asking for help, it's always advised to attempt to provide code that is relevant to the question you are asking. If you can provide a complete example that duplicates the problem, I'm happy to take a closer look.

A terrible error, kills development time....

I appreciate and empathize that bugs are frustrating, but I also feel compelled to state that this kind of comment is neither constructive not helpful. The error in question was certainly never expected to be one that end-users commonly or ever see. We happened to be mistaken, as it turns out there is a scenario where it crops up. We will work to improve things, as time and resources permit. Certainly no one likes bugs, but Bokeh is a large project, with many users, and only a few devs, all of whom are merely human beings who will make mistakes. The best way to help improve Bokeh for yourself and everyone is to remember that open-source software is a collaboration, and requires your constructive and useful contributions (which are always welcome and appreciated).

Thanks,

Bryan

A sample code that trigger some of those issues follow below, seems some state isn’t being cleared out. My second question is: why I cannot plot the same thing twice if I want to do so.

import numpy as np
from bokeh.layouts import column, row
from bokeh.plotting import figure, show
from bokeh.io import output_file
import bokeh.palettes as bp

output_file(“fd1.html”,title=“Finite differences”)

# Simulation parameters

nx = 41 # Grid points
dx = 2/(nx-1) # Grid interval
nt = 41 # Simulation points
dt = 0.025 # Simulation interval

# Constants

c = 1 # Wave velocity

# Let $$u = 2 \forall x_i \in 0.5 \leq x \leq 1$$

u = np.ones([nt,nx])
u[0][int(.5/dx):int(1/dx+1)]=2

for n in range(1,nt):
un = u[n-1].copy()
for i in range(1, nx):
u[n][i] = un[i] - c * dt/dx * (un[i] - un[i-1])

p1 = figure(plot_width=400,plot_height=400,x_range=[0,nx],y_range=[0,nt])
p1.image(image=[u],x=[0],y=[0],dw=[nx],dh=[nt],palette=bp.RdBu11)

p2 = figure(plot_width=400,plot_height=400)
p2.line(np.linspace(0,2,nx),u[0])

p3 = figure(plot_width=400,plot_height=400)
p3.line(np.linspace(0,2,nx),u[nt-1])

p = column(row(p1),row(p2,p3))

# 7. Run the code again (%run prog.py) now it works. Why?

#pn=p1
#p = column(row(p1,pn),row(p2,p3))

output_file(“fd1.html”,title=“Finite differences”)
show§

···

Em domingo, 13 de novembro de 2016 15:39:42 UTC-2, Bryan Van de ven escreveu:

Hi,

In console when I show charts after one run (ie the first execution is successful then when re-running), I get the following error,
Bokeh Error

duplicate edit variable

I combine 3 simple bar plots via show( row(a,b,c) ).

Should I be clearing any variables? Should I close the charts?

Somehow, somewhere you are putting the same plot in one document twice. It’s hard to say anything more specific without code to inspect or run. In general when asking for help, it’s always advised to attempt to provide code that is relevant to the question you are asking. If you can provide a complete example that duplicates the problem, I’m happy to take a closer look.

A terrible error, kills development time…

I appreciate and empathize that bugs are frustrating, but I also feel compelled to state that this kind of comment is neither constructive not helpful. The error in question was certainly never expected to be one that end-users commonly or ever see. We happened to be mistaken, as it turns out there is a scenario where it crops up. We will work to improve things, as time and resources permit. Certainly no one likes bugs, but Bokeh is a large project, with many users, and only a few devs, all of whom are merely human beings who will make mistakes. The best way to help improve Bokeh for yourself and everyone is to remember that open-source software is a collaboration, and requires your constructive and useful contributions (which are always welcome and appreciated).

Thanks,

Bryan