Bokeh keeps old session history
See original GitHub issueNot sure if this is a bug or intentional behavior.
If I run the snippet of code below repeatedly, I find the plot continues to grow as it includes data from previous sessions, which are not used AFAICT. However, if I uncomment the block of code below that explicitly clears the current document, then this problem goes away.
# Based off of this [example]( http://bokeh.pydata.org/en/latest/docs/gallery/image.html ).
import numpy as np
from bokeh.plotting import figure, show, output_file
from bokeh.palettes import Spectral11
# Uncomment to fix the issue.
# from bokeh.io import curdoc
# curdoc().clear()
N = 500
x = np.linspace(0, 10, N)
y = np.linspace(0, 10, N)
xx, yy = np.meshgrid(x, y)
d = np.sin(xx)*np.cos(yy)
p = figure(x_range=(0, 10), y_range=(0, 10))
# must give a vector of image data for image parameter
p.image(image=[d], x=0, y=0, dw=10, dh=10, palette=Spectral11)
output_file("image.html", title="image.py example")
Environment details below.
# environment.yml
name: bkenv
channels:
- conda-forge
- defaults
dependencies:
- appnope=0.1.0=py27_0
- bokeh=0.12.3=py27_0
- conda-forge::backports.shutil_get_terminal_size=1.0.0=py27_1
- conda-forge::backports_abc=0.5=py27_0
- conda-forge::blas=1.1=openblas
- conda-forge::ca-certificates=2016.9.26=0
- conda-forge::certifi=2016.9.26=py27_0
- conda-forge::configparser=3.5.0=py27_0
- conda-forge::decorator=4.0.10=py27_0
- conda-forge::entrypoints=0.2.2=py27_0
- conda-forge::enum34=1.1.6=py27_1
- conda-forge::functools32=3.2.3.2=py27_1
- conda-forge::futures=3.0.5=py27_0
- conda-forge::ipykernel=4.5.2=py27_0
- conda-forge::ipython=5.1.0=py27_1
- conda-forge::ipython_genutils=0.1.0=py27_0
- conda-forge::jinja2=2.8=py27_1
- conda-forge::jsonschema=2.5.1=py27_0
- conda-forge::jupyter_client=4.4.0=py27_0
- conda-forge::jupyter_core=4.2.1=py27_0
- conda-forge::libgfortran=3.0.0=0
- conda-forge::libsodium=1.0.10=0
- conda-forge::markupsafe=0.23=py27_1
- conda-forge::mistune=0.7.3=py27_0
- conda-forge::nbconvert=4.2.0=py27_0
- conda-forge::nbformat=4.2.0=py27_0
- conda-forge::ncurses=5.9=10
- conda-forge::notebook=4.3.1=py27_0
- conda-forge::numpy=1.11.3=py27_blas_openblas_200
- conda-forge::openblas=0.2.19=0
- conda-forge::openssl=1.0.2h=3
- conda-forge::pathlib2=2.1.0=py27_0
- conda-forge::pexpect=4.2.1=py27_0
- conda-forge::pickleshare=0.7.3=py27_0
- conda-forge::prompt_toolkit=1.0.9=py27_0
- conda-forge::ptyprocess=0.5.1=py27_0
- conda-forge::pygments=2.1.3=py27_1
- conda-forge::python=2.7.12=1
- conda-forge::python-dateutil=2.6.0=py27_0
- conda-forge::pyyaml=3.11=py27_0
- conda-forge::pyzmq=16.0.2=py27_0
- conda-forge::readline=6.2=0
- conda-forge::requests=2.12.4=py27_0
- conda-forge::setuptools=32.3.1=py27_0
- conda-forge::simplegeneric=0.8.1=py27_0
- conda-forge::singledispatch=3.4.0.3=py27_0
- conda-forge::six=1.10.0=py27_1
- conda-forge::sqlite=3.13.0=1
- conda-forge::ssl_match_hostname=3.5.0.1=py27_0
- conda-forge::terminado=0.6=py27_0
- conda-forge::tk=8.5.19=1
- conda-forge::tornado=4.4.2=py27_0
- conda-forge::traitlets=4.3.1=py27_0
- conda-forge::wcwidth=0.1.7=py27_0
- conda-forge::yaml=0.1.6=0
- conda-forge::zeromq=4.1.5=0
- conda-forge::zlib=1.2.8=3
- python.app=1.2=py27_4
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
serve — Bokeh 3.0.3 Documentation
This keeps users from accessing one another's sessions. To control who can use a Bokeh application, the server can sign session IDs with...
Read more >No way to cleanup used memory · Issue #5355 · bokeh ...
When you embed bokeh plots by manually inserting div and script you get from components there is no obvious way to clean up...
Read more >Bokeh server and on.click (on.change) doing nothing
The answer above shows how this can properly be accomplished with bokeh.client and push_session and session.loop_until_closed .
Read more >Server Configuration — Panel v0.14.1
The most important thing to know is that Panel (and Bokeh) provide a CLI ... SESSION_HISTORY The length of the session history to...
Read more >Understanding Bokeh
Some older lenses have aperture blades that form a kind of ninja ... Longer DOF will keep more of the image in focus...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have a fairly under-developed FAQ but maybe this would be a nice addition there. Also maybe a notebook with a title like “clearing_docs” that demonstrates this with some comments that explain things.
The FAQ is so underdeveloped that I am going to remove it. This question comes up from time to time but not that often. As there has never been a suggestion for where else might be good to clear things, and I can’t think of a place, I will close.