Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/petab_gui/controllers/mother_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down