Skip to content

Commit dc5ff0c

Browse files
committed
add simple vcml_workflow example script
1 parent d0a7bfb commit dc5ff0c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

examples/scripts/vcml_workflow.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import os
2+
from pathlib import Path
3+
4+
from pyvcell.vcml import VcmlReader
5+
from pyvcell.vcml.vcml_simulation import VcmlSpatialSimulation
6+
7+
model_fp = Path(os.getcwd()).parent / "models" / "TinySpatialProject_Application0.vcml"
8+
9+
bio_model = VcmlReader.biomodel_from_file(model_fp)
10+
11+
sims = [sim for app in bio_model.applications for sim in app.simulations]
12+
13+
# define editable spatial model and simulation instances
14+
simulation = VcmlSpatialSimulation(bio_model=bio_model)
15+
result = simulation.run(sims[0].name)
16+
17+
print([c.label for c in result.channel_data])
18+
19+
result.plotter.plot_slice_3d(time_index=3, channel_id="s1")
20+
result.plotter.plot_concentrations()
21+
simulation.cleanup()

0 commit comments

Comments
 (0)