PEtab-dev / libpetab-python

Python package for working with PEtab files
https://libpetab-python.readthedocs.io
MIT License
14 stars 5 forks source link

Improve error handling in Problem.from_yaml - format_version #217

Open dweindl opened 11 months ago

dweindl commented 11 months ago

Missing format_version in the yaml file should provide a proper error message instead of just KeyError:

--> 250 if yaml_config[FORMAT_VERSION] not in {"1", 1, "1.0.0", "2.0.0"}:
    251     raise ValueError("Provided PEtab files are of unsupported version "
    252                      f"{yaml_config[FORMAT_VERSION]}. Expected "
    253                      f"{format_version.__format_version__}.")
    254 if yaml_config[FORMAT_VERSION] == "2.0.0":

KeyError: 'format_version'