PEtab-dev / libpetab-python

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

How to run validation programmatically? #122

Closed matthiaskoenig closed 2 years ago

matthiaskoenig commented 2 years ago

Hi all, I want to validate my petab files programmatically. I.e.

I could not find anything in the codebase and the petablint (https://petab.readthedocs.io/projects/libpetab-python/en/latest/example/example_petablint.html) is not made for programatic workflows, but a manual tool one would run over petab files.

How can I run the validation programmatically and get the errors/warnings?

Best Matthias

FFroehlich commented 2 years ago

Hi all, I want to validate my petab files programmatically. I.e.

  • run a python command for validation
  • get a data structure or errors and warnings returned which I can process in my workflows

I could not find anything in the codebase and the petablint (https://petab.readthedocs.io/projects/libpetab-python/en/latest/example/example_petablint.html) is not made for programatic workflows, but a manual tool one would run over petab files.

How can I run the validation programmatically and get the errors/warnings?

Best Matthias

The python function called by the command line interface lint_problem is available in https://github.com/PEtab-dev/libpetab-python/blob/main/petab/lint.py. This function calls various subroutines that you could also use to check intermediates during generation of the petab subproblem.

It's currently not possible to provide an explicit enumeration of all errors/warnings, and it would probably be difficult to do so since errors that are detected initial checks can lead parsing errors that result in to false negative/positives later checks.

matthiaskoenig commented 2 years ago

Perfect. This was what I was looking for.