Skip to content

Commit

Permalink
Upgrade to bokeh==3.4.1 and address deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
manning-ncsa committed Apr 29, 2024
1 parent 3738052 commit 6898500
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
16 changes: 9 additions & 7 deletions app/host/plotting_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ def plot_cutout_image(
"legend_label": f"{transient.name}",
"size": 30,
"line_width": 2,
"marker": 'cross',
}
plot_position(
transient, wcs, plotting_kwargs=transient_kwargs, plotting_func=fig.cross
transient, wcs, plotting_kwargs=transient_kwargs, plotting_func=fig.scatter
)

if transient.host is not None:
Expand All @@ -160,9 +161,10 @@ def plot_cutout_image(
"size": 25,
"line_width": 2,
"line_color": "red",
"marker": 'x',
}
plot_position(
transient.host, wcs, plotting_kwargs=host_kwargs, plotting_func=fig.x
transient.host, wcs, plotting_kwargs=host_kwargs, plotting_func=fig.scatter
)
if global_aperture.exists():
filter_name = global_aperture[0].cutout.filter.name
Expand Down Expand Up @@ -284,7 +286,7 @@ def asinh_to_maggies(x):
("mag (AB)", "@mag"),
("mag error (AB)", "@mag_error"),
]
hover = HoverTool(renderers=[p], tooltips=TOOLTIPS, toggleable=False)
hover = HoverTool(renderers=[p], tooltips=TOOLTIPS, visible=False)
fig.add_tools(hover)

# second check on SED file
Expand Down Expand Up @@ -352,13 +354,13 @@ def asinh_to_maggies(x):
pwave = [f.wave_effective for f in obs["filters"]]

if transient.best_redshift < 0.015:
fig.circle(
fig.scatter(
pwave,
maggies_to_mJy(model_data["phot"]) * 10 ** (0.4 * mag_off),
size=10,
)
else:
fig.circle(pwave, maggies_to_mJy(model_data["phot"]), size=10)
fig.scatter(pwave, maggies_to_mJy(model_data["phot"]), size=10)

fig.width = 600
fig.legend.location = "top_left"
Expand All @@ -383,9 +385,9 @@ def plot_errorbar(

# to do the mouse-over
if source is not None:
p = figure.circle("x", "y", color=color, source=source, **point_kwargs)
p = figure.scatter("x", "y", color=color, source=source, **point_kwargs)
else:
p = figure.circle(x, y, color=color, source=source, **point_kwargs)
p = figure.scatter(x, y, color=color, source=source, **point_kwargs)

if xerr:
x_err_x = []
Expand Down
8 changes: 4 additions & 4 deletions app/host/templates/host/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

<head>
<title>{% block title %}{% endblock %}</title>
<!-- Bokeh -->
<script type="text/javascript" src="https://cdn.pydata.org/bokeh/release/bokeh-2.4.2.min.js" crossorigin="anonymous"></script>
<!-- Boostrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
Expand Down Expand Up @@ -113,11 +111,13 @@
</div>
</footer>

<!-- Bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.pydata.org/bokeh/release/bokeh-2.4.2.min.js"
integrity="sha384-qAE24rLAti3FnBClHlngWsDQZs6St9M7tNWdrWQeAWrtAEQTwCaNu9EIE716mUUp"
<!-- Bokeh -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bokeh/3.4.1/bokeh.min.js"
integrity="sha512-iH5rrOjYD1wVVcGRP3MAYcLXOsuDrbf0zPLvAv/H5ehk97HJfbmk9mQ6FDFwDWXiaGdZ9cS7GskmMei2Wc7q0w=="
crossorigin="anonymous"></script>
{% block script %}{% endblock %}
</body>
Expand Down
2 changes: 1 addition & 1 deletion app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dustmaps==1.0.13
astro-sedpy==0.3.2
extinction==0.4.6
astro-prospector==1.3.0
bokeh==2.4.0
bokeh==3.4.1
dynesty==2.1.3
torch==2.2.2
sbi==0.22.0
Expand Down

0 comments on commit 6898500

Please sign in to comment.