PEtab-dev / PEtab-dev/libpetab-python
Improve error handling in Problem.from_yaml - parameter_file
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Missing parameter_file in the yaml file should provide a proper error message instead of just a KeyError:
File petab/problem.py:259, in Problem.from_yaml(yaml_config)
255 warn("Support for PEtab2.0 is experimental!")
257 problem0 = yaml_config['problems'][0]
--> 259 if isinstance(yaml_config[PARAMETER_FILE], list):
260 parameter_df = parameters.get_parameter_df([
261 get_path(f)
262 for f in yaml_config[PARAMETER_FILE]
263 ])
264 else:
KeyError: 'parameter_file'
Also applies to sbml_files in --> 270 if len(problem0[SBML_FILES]) > 1:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read Problem.from_yaml in petab/problem.py at the parameter_file and sbml_files accesses. Check the surrounding YAML parsing behavior, then exercise inputs missing each key and verify they produce clear errors rather than raw KeyError exceptions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100