Skip to content

Commit 11fb5f2

Browse files
committed
Vis: Don't fail on missing simulations
1 parent 0f0c413 commit 11fb5f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

petab/visualize/plotter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def generate_lineplot(
160160
simu_color = p[0].get_color() if p else None
161161

162162
# construct simulation plot
163-
if simulations_to_plot is not None:
163+
if simulations_to_plot is not None \
164+
and not simulations_to_plot.data_to_plot.empty:
164165
# markers will be displayed only for points that have measurement
165166
# counterpart
166167
if measurements_to_plot is not None:
@@ -669,7 +670,7 @@ def check_data_to_plot(
669670
"""
670671
contains_inf = False
671672
max_finite_cond, min_cond = None, np.inf
672-
if data_to_plot is not None:
673+
if data_to_plot is not None and len(data_to_plot.conditions):
673674
contains_inf = np.inf in data_to_plot.conditions
674675
finite_conditions = data_to_plot.conditions[
675676
data_to_plot.conditions != np.inf]

0 commit comments

Comments
 (0)