Skip to content

Commit c1c75e6

Browse files
committed
More informative error on petab version mismatch
Closes #152.
1 parent 2bb9319 commit c1c75e6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/petab_gui/controllers/mother_controller.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
filtered_error,
5555
prompt_overwrite_or_append,
5656
)
57+
from petab.versions import get_major_version
5758

5859

5960
class MainController:
@@ -730,6 +731,12 @@ def open_yaml_and_load_files(self, yaml_path=None, mode="overwrite"):
730731
with open(yaml_path) as file:
731732
yaml_content = yaml.safe_load(file)
732733

734+
if (major := get_major_version(yaml_content)) != 1:
735+
raise ValueError(
736+
f"Only PEtab v1 problems are currently supported. "
737+
f"Detected version: {major}.x."
738+
)
739+
733740
# Resolve the directory of the YAML file to handle relative paths
734741
yaml_dir = Path(yaml_path).parent
735742

0 commit comments

Comments
 (0)