Skip to content

Commit 6299139

Browse files
authored
Add petab.v2.Problem (#285)
Copy of v1.Problem with all deprecated functionality removed. Loading PEtab 2.0 problems with petab.v1.Problem is now deprecated.
1 parent 721c0ed commit 6299139

6 files changed

Lines changed: 664 additions & 1 deletion

File tree

petab/v1/models/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pathlib import Path
77
from typing import Any
88

9-
__all__ = ["Model"]
9+
__all__ = ["Model", "model_factory"]
1010

1111

1212
class Model(abc.ABC):

petab/v1/problem.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ def from_yaml(yaml_config: dict | Path | str) -> Problem:
283283
)
284284
if yaml_config[FORMAT_VERSION] == "2.0.0":
285285
warn("Support for PEtab2.0 is experimental!", stacklevel=2)
286+
warn(
287+
"Using petab.v1.Problem with PEtab2.0 is deprecated. "
288+
"Use petab.v2.Problem instead.",
289+
DeprecationWarning,
290+
stacklevel=2,
291+
)
286292

287293
problem0 = yaml_config["problems"][0]
288294

petab/v2/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,15 @@
22
33
Contains all functionality related to handling PEtab 2.0 problems.
44
"""
5+
from warnings import warn
56

67
from ..v1 import * # noqa: F403, F401, E402
8+
9+
# import after v1
10+
from .problem import Problem # noqa: F401
11+
12+
warn(
13+
"Support for PEtab2.0 and all of petab.v2 is experimental "
14+
"and subject to changes!",
15+
stacklevel=1,
16+
)

0 commit comments

Comments
 (0)