Skip to content

Commit

Permalink
fixed visualizer for solutions without vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Brendel committed Feb 6, 2022
1 parent ae6bf4f commit 7d6c5b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion visualizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,11 @@ def time_series_plots(self):
ax[v_ax].plot(array,'g-')
max_soc.append(np.max(array))

y_max = max(max_soc)
# catch value error if no vehicles used
try:
y_max = max(max_soc)
except ValueError:
y_max = 0
ax[v_ax].set_xticks(np.arange(0, self.t_steps))
ax[v_ax].set_xticklabels(self.x_tick_str)
ax[v_ax].set_title('Energy transport - Vehicles', fontsize=15)
Expand Down

0 comments on commit 7d6c5b2

Please sign in to comment.