forked from PEtab-dev/libpetab-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_conversion.py
More file actions
51 lines (39 loc) · 1.42 KB
/
test_conversion.py
File metadata and controls
51 lines (39 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import logging
import pytest
from petab.v2 import Problem
from petab.v2.petab1to2 import petab1to2
def test_petab1to2_remote():
"""Test that we can upgrade a remote PEtab 1.0.0 problem."""
yaml_url = (
"https://raw.githubusercontent.com/PEtab-dev/petab_test_suite"
"/main/petabtests/cases/v1.0.0/sbml/0001/_0001.yaml"
)
problem = petab1to2(yaml_url)
assert isinstance(problem, Problem)
assert len(problem.measurements)
try:
import benchmark_models_petab
parametrize_or_skip = pytest.mark.parametrize(
"problem_id", benchmark_models_petab.MODELS
)
except ImportError:
parametrize_or_skip = pytest.mark.skip(
reason="benchmark_models_petab not installed"
)
@pytest.mark.filterwarnings(
"ignore:.*Using `log-normal` instead.*:UserWarning"
)
@parametrize_or_skip
def test_benchmark_collection(problem_id):
"""Test that we can upgrade all benchmark collection models."""
logging.basicConfig(level=logging.DEBUG)
if problem_id == "Froehlich_CellSystems2018":
# this is mostly about 6M sympifications in the condition table
pytest.skip("Too slow. Re-enable once we are faster.")
yaml_path = benchmark_models_petab.get_problem_yaml_path(problem_id)
try:
problem = petab1to2(yaml_path)
except NotImplementedError as e:
pytest.skip(str(e))
assert isinstance(problem, Problem)
assert len(problem.measurements)