Skip to content

Commit f9bad6a

Browse files
Allow empty string "" in columns to be overridden with default values in priors (#384)
The check only looked for whether it was not a string, but empty string values that are passed as `""` were not caught here. This should fix the error. --------- Co-authored-by: Daniel Weindl <daniel.weindl@uni-bonn.de>
1 parent eeb18ac commit f9bad6a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

petab/v1/priors.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,11 @@ def from_par_dict(
277277
at the bounds. **deprecated**.
278278
:return: A distribution object.
279279
"""
280-
dist_type = d.get(f"{type_}PriorType", C.PARAMETER_SCALE_UNIFORM)
281-
if not isinstance(dist_type, str) and np.isnan(dist_type):
282-
dist_type = C.PARAMETER_SCALE_UNIFORM
280+
dist_type = C.PARAMETER_SCALE_UNIFORM
281+
if (_table_dist_type := d.get(f"{type_}PriorType")) and (
282+
isinstance(_table_dist_type, str) or not np.isnan(_table_dist_type)
283+
):
284+
dist_type = _table_dist_type
283285

284286
pscale = d.get(C.PARAMETER_SCALE, C.LIN)
285287
params = d.get(f"{type_}PriorParameters", None)

0 commit comments

Comments
 (0)