diff --git a/src/python/benchmark_models_petab/base.py b/src/python/benchmark_models_petab/base.py index 68107fd..8884794 100644 --- a/src/python/benchmark_models_petab/base.py +++ b/src/python/benchmark_models_petab/base.py @@ -1,12 +1,26 @@ """Get a petab problem from the collection.""" -import os +from pathlib import Path import petab from .C import MODELS_DIR +def get_problem_yaml_path(id_: str) -> Path: + """Get the path to the PEtab problem YAML file. + + Parameters + ---------- + id_: Problem name, as in `benchmark_models_petab.MODELS`. + + Returns + ------- + The path to the PEtab problem YAML file. + """ + return Path(MODELS_DIR, id_, id_ + ".yaml") + + def get_problem(id_: str) -> petab.Problem: """Read PEtab problem from benchmark collection by name. @@ -18,6 +32,6 @@ def get_problem(id_: str) -> petab.Problem: ------- The PEtab problem. """ - yaml_file = os.path.join(MODELS_DIR, id_, id_ + ".yaml") + yaml_file = get_problem_yaml_path(id_) petab_problem = petab.Problem.from_yaml(yaml_file) return petab_problem