File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ """Convert benchmark problems from PEtab v1 to v2 format."""
3+
4+ import logging
5+ import benchmark_models_petab
6+ from petab .v2 .petab1to2 import petab1to2
7+ from pathlib import Path
8+
9+ def main ():
10+ logging .basicConfig (level = logging .INFO )
11+ v2_root = Path (__file__ ).resolve ().parent / "v2"
12+
13+ for problem_id in benchmark_models_petab .MODELS :
14+ convert (problem_id , output_dir = v2_root / problem_id )
15+
16+ def convert (problem_id : str , output_dir : Path ):
17+ """Convert a PEtab v1 problem to v2 format."""
18+ logging .info (f"Converting { problem_id } ..." )
19+ yaml_path = benchmark_models_petab .get_problem_yaml_path (problem_id )
20+ try :
21+ petab1to2 (yaml_path , output_dir )
22+ except NotImplementedError as e :
23+ logging .warning (f"Skipping { problem_id } : { e } " )
24+ return
25+
26+ logging .info (f"Converted { problem_id } ." )
27+
28+
29+ if __name__ == "__main__" :
30+ main ()
You can’t perform that action at this time.
0 commit comments