Skip to content

Commit a60ccc7

Browse files
committed
Fix accessing preequilibrationConditionId without checking for presence
Fixes a bug in petab.visualize.data_overview.create_report which fails if there is no preequilibrationConditionId column in the measurements table.
1 parent 2c44efe commit a60ccc7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

petab/visualize/data_overview.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ def get_data_per_observable(measurement_df: pd.DataFrame) -> pd.DataFrame:
6161
"""
6262

6363
my_measurements = measurement_df.copy()
64-
my_measurements[PREEQUILIBRATION_CONDITION_ID] = my_measurements[
65-
PREEQUILIBRATION_CONDITION_ID
66-
].astype("object")
6764

6865
index = [SIMULATION_CONDITION_ID]
6966
if PREEQUILIBRATION_CONDITION_ID in my_measurements:
70-
my_measurements[PREEQUILIBRATION_CONDITION_ID].fillna("", inplace=True)
67+
my_measurements[PREEQUILIBRATION_CONDITION_ID] = (
68+
my_measurements[PREEQUILIBRATION_CONDITION_ID]
69+
.astype("object")
70+
.fillna("", inplace=True)
71+
)
7172
index.append(PREEQUILIBRATION_CONDITION_ID)
7273

7374
data_per_observable = pd.pivot_table(

0 commit comments

Comments
 (0)