Skip to content

Commit 4550d56

Browse files
dweindldilpath
andauthored
Apply suggestions from code review
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
1 parent 0786a8f commit 4550d56

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

petab/v2/core.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,11 @@ class ExperimentPeriod(BaseModel):
503503
@field_validator("condition_ids", mode="before")
504504
@classmethod
505505
def _validate_ids(cls, condition_ids):
506-
if condition_ids is None:
506+
if condition_ids in [None, []]:
507507
return []
508508

509509
for condition_id in condition_ids:
510-
# condition_id may be empty
511-
if condition_id and not is_valid_identifier(condition_id):
510+
if is_valid_identifier(condition_id):
512511
raise ValueError(f"Invalid ID: `{condition_id}'")
513512
return condition_ids
514513

@@ -900,7 +899,7 @@ def _validate_id(cls, v):
900899
@field_validator("prior_parameters", mode="before")
901900
@classmethod
902901
def _validate_prior_parameters(cls, v):
903-
if isinstance(v, float) and np.isnan(v):
902+
if pd.isna(v):
904903
return []
905904

906905
if isinstance(v, str):

0 commit comments

Comments
 (0)