Skip to content

Commit

Permalink
* last fix contained a bug, try again [rtj]
Browse files Browse the repository at this point in the history
  • Loading branch information
rjones30 committed Oct 4, 2024
1 parent cb586dd commit 3802523
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gluex/jupyroot/hddmview.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ def setup_canvas(self, prefix="canvas", width=500, height=400):
of a cell in a jupyter notebook, returns the name.
"""
cname = f"canvas{id(self)}"
for i in range(999):
if cname + f".{i}" in self.canvases:
continue
cname += f".{i}"
self.canvases[cname] = ROOT.TCanvas(cname, "", width, height)
self.current_canvas = self.canvases[cname]
return cname
Expand Down
4 changes: 4 additions & 0 deletions gluex/jupyroot/treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ def setup_canvas(self, prefix="canvas", width=500, height=400):
of a cell in a jupyter notebook, returns the name.
"""
cname = f"canvas{id(self)}"
for i in range(999):
if cname + f".{i}" in self.canvases:
continue
cname += f".{i}"
self.canvases[cname] = ROOT.TCanvas(cname, "", width, height)
self.current_canvas = self.canvases[cname]
return cname
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='gluex.jupyroot',
version='1.0.5',
version='1.0.6',
packages=['gluex.jupyroot'],
install_requires=[], # Add dependencies here if any
description='Automate common data analysis and visualization tasks using the CERN pyroot library in a jupyter notebook.',
Expand Down

0 comments on commit 3802523

Please sign in to comment.