-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases for PEtab v2.0.0 (#53)
including test cases for multilanguage proposal PEtab-dev/PEtab#538
- Loading branch information
Showing
579 changed files
with
4,998 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pytest | ||
flake8 | ||
https://github.com/petab-dev/libpetab-python/archive/develop.zip | ||
https://github.com/petab-dev/libpetab-python/archive/model_pysb.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0001/_0001.yaml → petabtests/cases/v2.0.0/pysb/0001/_0001.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0002/_0002.yaml → petabtests/cases/v2.0.0/pysb/0002/_0002.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0003/_0003.yaml → petabtests/cases/v2.0.0/pysb/0003/_0003.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0004/_0004.yaml → petabtests/cases/v2.0.0/pysb/0004/_0004.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0005/_0005.yaml → petabtests/cases/v2.0.0/pysb/0005/_0005.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0006/_0006.yaml → petabtests/cases/v2.0.0/pysb/0006/_0006.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0007/_0007.yaml → petabtests/cases/v2.0.0/pysb/0007/_0007.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0008/_0008.yaml → petabtests/cases/v2.0.0/pysb/0008/_0008.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
petabtests/cases/pysb/0009/_0009.yaml → petabtests/cases/v2.0.0/pysb/0009/_0009.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
format_version: 1 | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv | ||
sbml_files: | ||
- _model.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
from inspect import cleandoc | ||
|
||
import pandas as pd | ||
from petab.C import * | ||
|
||
from petabtests import DEFAULT_PYSB_FILE, PetabTestCase, analytical_a | ||
|
||
DESCRIPTION = cleandoc(""" | ||
## Objective | ||
This case tests support for partial preequilibration. | ||
The model is to be simulated for a preequilibration condition and a | ||
simulation condition. | ||
Species `B` is to be reinitialized after preequilibration. | ||
For `A` the preequilibration result is to be used. | ||
## Model | ||
A simple conversion reaction `A <=> B` in a single compartment, following | ||
mass action kinetics. | ||
""") | ||
|
||
# problem -------------------------------------------------------------------- | ||
|
||
condition_df = pd.DataFrame(data={ | ||
CONDITION_ID: ['preeq_c0', 'c0'], | ||
'k1': [0.3, 0.8], | ||
'B': [0, 1], | ||
}).set_index([CONDITION_ID]) | ||
|
||
measurement_df = pd.DataFrame(data={ | ||
OBSERVABLE_ID: ['obs_a', 'obs_a'], | ||
PREEQUILIBRATION_CONDITION_ID: ['preeq_c0', 'preeq_c0'], | ||
SIMULATION_CONDITION_ID: ['c0', 'c0'], | ||
TIME: [1, 10], | ||
MEASUREMENT: [0.7, 0.1] | ||
}) | ||
|
||
observable_df = pd.DataFrame(data={ | ||
OBSERVABLE_ID: ['obs_a'], | ||
OBSERVABLE_FORMULA: ['A'], | ||
NOISE_FORMULA: [0.5] | ||
}).set_index([OBSERVABLE_ID]) | ||
|
||
parameter_df = pd.DataFrame(data={ | ||
PARAMETER_ID: ['k2'], | ||
PARAMETER_SCALE: [LIN], | ||
LOWER_BOUND: [0], | ||
UPPER_BOUND: [10], | ||
NOMINAL_VALUE: [0.6], | ||
ESTIMATE: [1], | ||
}).set_index(PARAMETER_ID) | ||
|
||
mapping_df = pd.DataFrame(data={ | ||
PETAB_ENTITY_ID: ['A', 'B'], | ||
MODEL_ENTITY_ID: ['A_() ** compartment', 'B_() ** compartment'], | ||
}).set_index(PETAB_ENTITY_ID) | ||
|
||
# solutions ------------------------------------------------------------------ | ||
|
||
simulation_df = measurement_df.copy(deep=True).rename( | ||
columns={MEASUREMENT: SIMULATION}) | ||
# simulate for far time point as steady state | ||
steady_state_a = analytical_a(1000, 1, 0, 0.3, 0.6) | ||
# use steady state as initial state | ||
simulation_df[SIMULATION] = [ | ||
analytical_a(t, steady_state_a, 1, 0.8, 0.6) | ||
for t in simulation_df[TIME]] | ||
|
||
case = PetabTestCase( | ||
id=10, | ||
brief="Simulation. Preequilibration. One species reinitialized, one not. " | ||
"InitialAssignment to species overridden.", | ||
description=DESCRIPTION, | ||
model=DEFAULT_PYSB_FILE, | ||
condition_dfs=[condition_df], | ||
observable_dfs=[observable_df], | ||
measurement_dfs=[measurement_df], | ||
simulation_dfs=[simulation_df], | ||
parameter_df=parameter_df, | ||
mapping_df=mapping_df, | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
mapping_file: _mapping.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
petabEntityId modelEntityId | ||
A A_() ** compartment | ||
B B_() ** compartment |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
from inspect import cleandoc | ||
|
||
import pandas as pd | ||
from petab.C import * | ||
|
||
from petabtests import PetabTestCase, analytical_a | ||
|
||
DESCRIPTION = cleandoc(""" | ||
## Objective | ||
This case tests initial concentrations in the condition table. | ||
For species `B`, the initial concentration is specified in the condition | ||
table, while for `A` it is given via an assignment rule in the SBML model. | ||
## Model | ||
A simple conversion reaction `A <=> B` in a single compartment, following | ||
mass action kinetics. | ||
""") | ||
|
||
# problem -------------------------------------------------------------------- | ||
|
||
condition_df = pd.DataFrame(data={ | ||
CONDITION_ID: ['c0'], | ||
'B': [2] | ||
}).set_index([CONDITION_ID]) | ||
|
||
measurement_df = pd.DataFrame(data={ | ||
OBSERVABLE_ID: ['obs_a', 'obs_a'], | ||
SIMULATION_CONDITION_ID: ['c0', 'c0'], | ||
TIME: [0, 10], | ||
MEASUREMENT: [0.7, 0.1] | ||
}) | ||
|
||
observable_df = pd.DataFrame(data={ | ||
OBSERVABLE_ID: ['obs_a'], | ||
OBSERVABLE_FORMULA: ['A'], | ||
NOISE_FORMULA: [0.5] | ||
}).set_index([OBSERVABLE_ID]) | ||
|
||
parameter_df = pd.DataFrame(data={ | ||
PARAMETER_ID: ['k1', 'k2'], | ||
PARAMETER_SCALE: [LIN] * 2, | ||
LOWER_BOUND: [0] * 2, | ||
UPPER_BOUND: [10] * 2, | ||
NOMINAL_VALUE: [0.8, 0.6], | ||
ESTIMATE: [1] * 2, | ||
}).set_index(PARAMETER_ID) | ||
|
||
mapping_df = pd.DataFrame(data={ | ||
PETAB_ENTITY_ID: ['A', 'B'], | ||
MODEL_ENTITY_ID: ['A_() ** compartment', 'B_() ** compartment'], | ||
}).set_index(PETAB_ENTITY_ID) | ||
|
||
# solutions ------------------------------------------------------------------ | ||
|
||
simulation_df = measurement_df.copy(deep=True).rename( | ||
columns={MEASUREMENT: SIMULATION}) | ||
simulation_df[SIMULATION] = [analytical_a(t, 1, 2, 0.8, 0.6) | ||
for t in simulation_df[TIME]] | ||
|
||
case = PetabTestCase( | ||
id=11, | ||
brief="Simulation. InitialAssignment to species overridden.", | ||
description=DESCRIPTION, | ||
model='conversion_modified_pysb.py', | ||
condition_dfs=[condition_df], | ||
observable_dfs=[observable_df], | ||
measurement_dfs=[measurement_df], | ||
simulation_dfs=[simulation_df], | ||
parameter_df=parameter_df, | ||
mapping_df=mapping_df, | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
format_version: 2.0.0 | ||
parameter_file: _parameters.tsv | ||
problems: | ||
- condition_files: | ||
- _conditions.tsv | ||
mapping_file: _mapping.tsv | ||
measurement_files: | ||
- _measurements.tsv | ||
model_files: | ||
model_0: | ||
language: pysb | ||
location: _model.py | ||
observable_files: | ||
- _observables.tsv |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
petabEntityId modelEntityId | ||
A A_() ** compartment | ||
B B_() ** compartment |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.