Skip to content

Commit

Permalink
Fix bug crashing daytime score plotting with only one daytime.
Browse files Browse the repository at this point in the history
  • Loading branch information
pirmink committed Apr 29, 2024
1 parent 938c449 commit 3c5ba3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "moveroplot"
version = "1.1.0"
version = "1.1.1"
description = "Movero-plot"
readme = "README.md"
keywords = [
Expand Down
5 changes: 3 additions & 2 deletions src/moveroplot/daytime_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ def _plot_and_save_scores(
x_int = list(data["df"]["hh"])
score_values = data["df"][score].to_list()
if 0 not in x_int:
bound_x_values = x_int[:: -len(x_int) + 1]
# bound_x_values = x_int[:: -len(x_int) + 1] # len=1: stride 0 not allowed
bound_x_values = [x_int[i] for i in (-1,0)]
bound_x_values[0] -= 24
score_value0 = np.interp(
0, bound_x_values, score_values[:: len(x_int) - 1]
0, bound_x_values, [score_values[i] for i in (-1,0)]
)
x_int = [0] + x_int + [24]
score_values = [score_value0] + score_values + [score_value0]
Expand Down

0 comments on commit 3c5ba3c

Please sign in to comment.