Skip to content

Commit

Permalink
added runtime arg to test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Jan 15, 2024
1 parent 158d08a commit 2bd57a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions biosimulator_processes/tests/test_copasi.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from process_bigraph import Composite, pf


def test_process():
def test_process(model_filepath: str = 'biosimulator_processes/tests/model_files/Caravagna2010.xml'):
# 1. Define the sim state schema:
initial_sim_state = {
'copasi': {
'_type': 'process',
'address': 'local:copasi',
'config': {
'model_file': 'biosimulator_processes/tests/model_files/Caravagna2010.xml'
'model_file': model_filepath
},
'inputs': {
'floating_species': ['floating_species_store'],
Expand Down
17 changes: 9 additions & 8 deletions biosimulator_processes/tests/test_smoldyn.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from process_bigraph import Composite
# from biosimulator_processes.smoldyn_process import SmoldynProcess
from process_bigraph import Composite, pp, pf


def test_process():
def test_process(model_filepath: str = 'biosimulator_processes/tests/model_files/minE_model.txt'):
"""Test the smoldyn process using the crowding model."""

# this is the instance for the composite process to run
Expand All @@ -11,7 +10,7 @@ def test_process():
'_type': 'process',
'address': 'local:smoldyn',
'config': {
'model_filepath': 'biosimulator_processes/tests/model_files/minE_model.txt',
'model_filepath': model_filepath,
'animate': False,
},
'inputs': {
Expand Down Expand Up @@ -45,17 +44,19 @@ def test_process():
}
}

total_time = 1

# make the composite
workflow = Composite({
'state': instance
})

# run
workflow.run(1)
workflow.run(total_time)

# gather results
results = workflow.gather_results()
print(f'RESULTS: {results}')
pp(f'RESULTS: {pf(results)}')


# def manually_test_process():
Expand All @@ -68,10 +69,10 @@ def test_process():
#
# stop = 1
#
# result = test_smoldyn_manually(stop, process, historical=True)
# result = run_smoldyn_manually(stop, process, historical=True)


# def test_smoldyn_manually(stop_time: int, process: SmoldynProcess, historical: bool = False):
# def run_smoldyn_manually(stop_time: int, process: SmoldynProcess, historical: bool = False):
# current_state = process.initial_state()
# runs = []
# for t, _ in enumerate(list(range(stop_time)), 1):
Expand Down
4 changes: 2 additions & 2 deletions biosimulator_processes/tests/test_tellurium.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from process_bigraph import Composite, pf


def test_process():
def test_process(model_filepath: str = 'biosimulator_processes/tests/model_files/BIOMD0000000061_url.xml'):
# this is the instance for the composite process to run...process instance keys may pertain to methods and not simulators directly
instance = {
'tellurium': {
'_type': 'process',
'address': 'local:tellurium', # using a local toy process
'config': {
'sbml_model_path': 'biosimulator_processes/tests/model_files/BIOMD0000000061_url.xml',
'sbml_model_path': model_filepath,
},
'inputs': {
'time': ['time_store'],
Expand Down

0 comments on commit 2bd57a0

Please sign in to comment.