Skip to content

Commit

Permalink
bara.py: ignore ValueErrors reported by Range1d
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Sep 3, 2024
1 parent 2835ade commit a63cd4b
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions epic_capybara/cli/bara.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,21 @@ def bara(files, match, unmatch, serve):
y_bounds = (- 0.05 * y_max, 1.05 * y_max)
# Set y range for histograms
if np.all(np.isfinite(x_bounds)):
fig.x_range = Range1d(
*x_bounds,
bounds=x_bounds)
try:
fig.x_range = Range1d(
*x_bounds,
bounds=x_bounds)
except ValueError as e:
sclick.secho(str(e), fg="red", err=True)
else:
click.secho(f"overflow while calculating x bounds for \"{key}\"", fg="red", err=True)
click.secho(f"overflow while calculating x bounds for \"{key}\"", fg="red", err=True)
if np.all(np.isfinite(y_bounds)):
fig.y_range = Range1d(
*y_bounds,
bounds=y_bounds)
try:
fig.y_range = Range1d(
*y_bounds,
bounds=y_bounds)
except ValueError as e:
sclick.secho(str(e), fg="red", err=True)
else:
click.secho(f"overflow while calculating y bounds for \"{key}\"", fg="red", err=True)

Expand Down

0 comments on commit a63cd4b

Please sign in to comment.