Skip to content

Commit

Permalink
Update test suite branch
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Mar 28, 2023
1 parent d353244 commit e4fb08a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/petab_testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
PETAB_TEST_URL: https://github.com/PEtab-dev/petab_test_suite.git
run: |
cd $PARPE_BASE/ \
&& git clone --depth 1 --branch develop $PETAB_TEST_URL \
&& git clone --depth 1 --branch main $PETAB_TEST_URL \
&& $PARPE_BASE/misc/run_in_venv.sh $PARPE_BASE/build/venv \
pip3 install -e petab_test_suite
Expand Down
2 changes: 1 addition & 1 deletion tests/petab-test-suite/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def pytest_generate_tests(metafunc):
test_numbers = parse_selection(cases)
else:
# Run all tests
test_numbers = petabtests.get_cases('sbml')
test_numbers = petabtests.get_cases('sbml', version="v1.0.0")

metafunc.parametrize("case", test_numbers)
9 changes: 6 additions & 3 deletions tests/petab-test-suite/test_petab_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def check_run(cmd: List[str]) -> subprocess.CompletedProcess:

def _test_case(case: Union[int, str]) -> None:
"""Run a single PEtab test suite case"""
model_type = 'sbml'
version = "v1.0.0"

case = petabtests.test_id_str(case)
logger.debug(f"Case {case}")
Expand All @@ -64,7 +66,8 @@ def _test_case(case: Union[int, str]) -> None:
if case in ['0012', '0018']:
raise NotImplementedError(case)

case_dir = petabtests.CASES_DIR / case
case_dir = petabtests.get_case_dir(case, model_type, version)
yaml_file = case_dir / petabtests.problem_yaml_name(case)
yaml_file = case_dir / petabtests.problem_yaml_name(case)
test_dir = Path(__file__).parent.absolute()
parpe_dir = test_dir.parents[1]
Expand Down Expand Up @@ -111,7 +114,7 @@ def _test_case(case: Union[int, str]) -> None:
g = re.search(r'Likelihood: (\d+\.\d+)', ret.stdout)[0]
llh_actual = - float(g.split(' ')[1])
print("Actual llh:", llh_actual)
solution = petabtests.load_solution(case, 'sbml')
solution = petabtests.load_solution(case, model_type, version=version)

gt_llh = solution[petabtests.LLH]
assert llh_actual == pytest.approx(gt_llh,
Expand All @@ -127,7 +130,7 @@ def run() -> None:

n_success = 0
n_skipped = 0
all_cases = list(petabtests.get_cases('sbml'))
all_cases = list(petabtests.get_cases('sbml', version="v1.0.0"))
for case in all_cases:
try:
test_case(case)
Expand Down

0 comments on commit e4fb08a

Please sign in to comment.