PEtab-dev / libpetab-python

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

Introduce petab.v1 package #282

Closed dweindl closed 6 days ago

dweindl commented 1 week ago

As discussed in #271, we need to accommodate the changes related to the upcoming PEtab v2. The goal is to move PEtab 1.0 functionality to a petab.v1 subpackage and PEtab 2.0 functionality to a petab.v2 subpackage.

This PR moves (almost) all code from the petab package to a petab.v1 sub-package. Keeps all non-private objects importable from their previous location, but issues DeprecationWarnings.

From the next release on, all consumers should change all from petab[.$x] import $y to from petab.v1[.$x] import $y.

Fixes a couple of sphinx-issues that occurred on the way. Some obscure sphinx-failures remain, but they aren't critical.

Also adds some missing __all__s.

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 79.17143% with 729 lines in your changes missing coverage. Please review.

Project coverage is 75.32%. Comparing base (e8fdf3a) to head (58d0755).

Files Patch % Lines
petab/v1/math/_generated/PetabMathExprParser.py 73.02% 140 Missing and 34 partials :warning:
petab/v1/lint.py 72.19% 67 Missing and 32 partials :warning:
petab/v1/parameter_mapping.py 66.66% 54 Missing and 11 partials :warning:
petab/v1/models/pysb_model.py 61.41% 44 Missing and 5 partials :warning:
petab/v1/visualize/plotter.py 83.76% 27 Missing and 17 partials :warning:
petab/v1/visualize/plotting.py 86.91% 21 Missing and 18 partials :warning:
petab/v1/visualize/lint.py 56.79% 25 Missing and 10 partials :warning:
petab/v1/parameters.py 85.63% 12 Missing and 15 partials :warning:
petab/v1/models/model.py 69.84% 18 Missing and 1 partial :warning:
petab/v1/core.py 89.24% 10 Missing and 7 partials :warning:
... and 27 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #282 +/- ## =========================================== - Coverage 75.65% 75.32% -0.33% =========================================== Files 40 69 +29 Lines 4141 4256 +115 Branches 893 898 +5 =========================================== + Hits 3133 3206 +73 - Misses 745 787 +42 Partials 263 263 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dweindl commented 6 days ago

I looked at petab/v1 less since I guess it's mostly copied.

Yes.

Is it possible to include this in CI by running the tests with both like so?

import petab as petabv0
import petab.v1

petab = petabv0
# run tests
petab = petab.v1

For now, I would keep running tests through the deprecated functions. If they pass there, I don't have much doubt that they will work through petab.v1, as effectively everything was moved there. Once we remove the old modules, I would switch the tests.

Should the tests also be split into tests/v1 and tests/v2?

Yes, I think that makes sense. Will do that separately, though.