diff --git a/src/petab_gui/controllers/mother_controller.py b/src/petab_gui/controllers/mother_controller.py index 6ad0def..5a72af0 100644 --- a/src/petab_gui/controllers/mother_controller.py +++ b/src/petab_gui/controllers/mother_controller.py @@ -10,6 +10,7 @@ import petab.v1 as petab import qtawesome as qta import yaml +from petab.versions import get_major_version from PySide6.QtCore import QSettings, Qt, QTimer, QUrl from PySide6.QtGui import ( QAction, @@ -730,6 +731,12 @@ def open_yaml_and_load_files(self, yaml_path=None, mode="overwrite"): with open(yaml_path) as file: yaml_content = yaml.safe_load(file) + if (major := get_major_version(yaml_content)) != 1: + raise ValueError( + f"Only PEtab v1 problems are currently supported. " + f"Detected version: {major}.x." + ) + # Resolve the directory of the YAML file to handle relative paths yaml_dir = Path(yaml_path).parent