Skip to content

Commit 6935b8b

Browse files
authored
Fix nan-handling in Subplot.from_df checks (#496)
Fixes warnings like: `UserWarning: For plotId plot13 in column xLabel contradictory settings ([nan nan]). Proceeding with first entry (nan).`
1 parent 4016147 commit 6935b8b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

petab/v1/visualize/plotting.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,11 @@ def from_df(
211211
if col in VISUALIZATION_DF_SUBPLOT_LEVEL_COLS:
212212
entry = vis_spec.loc[:, col]
213213
entry = np.unique(entry)
214-
if entry.size > 1:
214+
if entry.size > 1 and not all(pd.isna(x) for x in entry):
215215
warnings.warn(
216216
f"For {PLOT_ID} {plot_id} in column "
217-
f"{col} contradictory settings ({entry})"
218-
f". Proceeding with first entry "
219-
f"({entry[0]}).",
217+
f"{col} contradictory settings ({entry}). "
218+
f"Proceeding with first entry ({entry[0]}).",
220219
stacklevel=2,
221220
)
222221
entry = entry[0]

0 commit comments

Comments
 (0)