Health care facilities - study steps

This notebook runs a simulation with only a few people, just to show the study steps.


In [1]:
import pysimpactcyan
import pandas as pd

In [2]:
# First, we'll need to tell the Simpact simulation engine to use the MaxART-specific simulation
simpact = pysimpactcyan.PySimpactCyan()
simpact.setSimulationPrefix("maxart")


Setting data directory to /usr/local/share/simpact-cyan/

In [3]:
# We configure the simulation to use one of the files with fake randomization data

cfg = { "facilities.randomization": "${SIMPACT_DATA_DIR}/maxart-randomization-fake_1.csv" }
r = simpact.run(cfg, "/tmp/simptest")

# We then read the steps as they have been written to a CSV log file
steps = pd.read_csv(r["logsteps"])


Using identifier 'maxart-2016-10-16-18-27-46_9172_L0IMzk26-'
Results will be stored in directory '/tmp/simptest'
Running simpact executable...
Done.

# read seed from /dev/urandom
# Rng engine mt19937
# Using seed 269339523
# WARNING! Ignoring negative values when reading /usr/local/share/simpact-cyan/SWZ10adjv4.tif
# Performing extra check on read configuration parameters
# WARNING: ignoring consistency check for config key facilities.geo.coords (config value is '/usr/local/share/simpact-cyan/maxart-facilities.csv')
# WARNING: ignoring consistency check for config key facilities.randomization (config value is '/usr/local/share/simpact-cyan//maxart-randomization-fake_1.csv')
# WARNING: ignoring consistency check for config key population.agedistfile (config value is '/usr/local/share/simpact-cyan/sa_2003.csv')
# mNRM: using advanced algorithm
# Release version
# Simpact version is: 0.20.0rc1
# Current simulation time is 15.0083
# Number of events executed is 2877
# Started with 200 people, ending with 190 (difference is -10)

In [5]:
# Let's show this step data. The first line is written when the study is started (by default
# 5 years into the simulation). At that point, all facilities are in the control stage ('C').
# Then, the stage each facility is in is written at regular intervals, when new facilities enter
# the transitioning stage ('T'), or when they advance to the intervention stage ('I'). A final
# line is written when the study has ended ('Post' study).
steps


Out[5]:
time Bulandzeni Clinic Herefords Clinic Hhukwini Clinic Horo Clinic Maguga Clinic Malandzela Nazarene Clinic Mshingishingini Nazarene Clinic Ndvwabangeni Nazarene Clinic Ndzingeni Nazarene Clinic Ntfonjeni Clinic Peak Nazarene Clinic Pigg's Peak Government Hospital Sigangeni Clinic Siphocosini Clinic
0 5.00000 C C C C C C C C C C C C C C
1 5.33333 C T C C C C C T C C C C C C
2 5.66667 C I C C T C C I C T C C C C
3 6.00000 C I C T I C C I C I T C C C
4 6.33333 T I C I I C C I C I I C C T
5 6.66667 I I T I I T C I C I I C C I
6 7.00000 I I I I I I C I T I I T C I
7 7.33333 I I I I I I T I I I I I T I
8 7.66667 I I I I I I I I I I I I I I
9 8.00000 Post Post Post Post Post Post Post Post Post Post Post Post Post Post

In [ ]: