File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 5353 "observable_table_has_nontrivial_noise_formula" ,
5454]
5555
56+ #: Regular expression pattern for valid PEtab IDs
57+ _petab_id_pattern = re .compile (r"^[a-zA-Z_]\w*$" )
58+
5659
5760def _check_df (df : pd .DataFrame , req_cols : Iterable , name : str ) -> None :
5861 """Check if given columns are present in DataFrame
@@ -1189,7 +1192,7 @@ def is_valid_identifier(x: str) -> bool:
11891192 if pd .isna (x ):
11901193 return False
11911194
1192- return re .match (r"^[a-zA-Z_]\w*$" , x ) is not None
1195+ return _petab_id_pattern .match (x ) is not None
11931196
11941197
11951198def check_ids (ids : Iterable [str ], kind : str = "" ) -> None :
Original file line number Diff line number Diff line change @@ -404,7 +404,7 @@ def from_df(cls, df: pd.DataFrame) -> ConditionsTable:
404404
405405 conditions = []
406406 for condition_id , sub_df in df .reset_index ().groupby (C .CONDITION_ID ):
407- changes = [Change (** row . to_dict ()) for _ , row in sub_df .iterrows ( )]
407+ changes = [Change (** row ) for row in sub_df .to_dict ( "records" )]
408408 conditions .append (Condition (id = condition_id , changes = changes ))
409409
410410 return cls (conditions = conditions )
You can’t perform that action at this time.
0 commit comments