PEtab-dev / libpetab-python

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

Convenience method to quickly output PEtab problem to files #71

Closed dilpath closed 3 years ago

dilpath commented 3 years ago

Usage example for petab.Problem.to_files_generic:

petab_problem_custom = petab.Problem.from_yaml(...)
petab_problem_custom.condition_df = ...

petab_yaml = petab_problem_custom.to_files_generic('my/output/path')
petab_problem = petab.Problem.from_yaml(petab_yaml)

Useful for applications involving many PEtab problems that are generated as customisations of some original PEtab problem.

Could rename to e.g. to_folder


Usage example for the new argument prefix_path in petab.Problem.to_files:

petab_problem.to_files(
    sbml_file='model.xml',
    condition_file='conditions.tsv',
    measurement_file='measurements.tsv',
    parameter_file='parameters.tsv',
    observable_file='observables.tsv',
    visualization_file='visualizations.tsv',
    yaml_file='problem.yaml',
    prefix_path='my/output/path',
)

Old usage would be:

petab_problem.to_files(
    sbml_file='my/output/path/model.xml',
    condition_file='my/output/path/conditions.tsv',
    measurement_file='my/output/path/measurements.tsv',
    parameter_file='my/output/path/parameters.tsv',
    observable_file='my/output/path/observables.tsv',
    visualization_file='my/output/path/visualizations.tsv',
    yaml_file='my/output/path/problem.yaml',
)
codecov-commenter commented 3 years ago

Codecov Report

Merging #71 (94c1957) into develop (ad1229e) will decrease coverage by 0.67%. The diff coverage is 10.71%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #71      +/-   ##
===========================================
- Coverage    80.13%   79.45%   -0.68%     
===========================================
  Files           26       26              
  Lines         2874     2901      +27     
  Branches       684      690       +6     
===========================================
+ Hits          2303     2305       +2     
- Misses         397      421      +24     
- Partials       174      175       +1     
Impacted Files Coverage Δ
petab/problem.py 64.56% <10.71%> (-6.80%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ad1229e...94c1957. Read the comment docs.