diff --git a/.gitignore b/.gitignore index 78c0322..1025336 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ output status.txt log *.temp.json +Std*.txt # Python .virtualenv diff --git a/.scenario b/.scenario new file mode 100644 index 0000000..d1e2e81 --- /dev/null +++ b/.scenario @@ -0,0 +1,5 @@ +{ + "plotAllCharts": { + "commandline": "" + } +} \ No newline at end of file diff --git a/Scenarios/Generic/DensityScaling/.scenario b/Scenarios/Generic/DensityScaling/.scenario new file mode 100644 index 0000000..76d066a --- /dev/null +++ b/Scenarios/Generic/DensityScaling/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Density Scaling", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c I -t \"Density Scaling\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/DensityScaling/plotAllCharts.ps1 b/Scenarios/Generic/DensityScaling/plotAllCharts.ps1 index 8f76cae..5793726 100644 --- a/Scenarios/Generic/DensityScaling/plotAllCharts.ps1 +++ b/Scenarios/Generic/DensityScaling/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Density Scaling" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/HINT_AgeAndAccess/A_BaselineOutbreak/.scenario b/Scenarios/Generic/HINT_AgeAndAccess/A_BaselineOutbreak/.scenario new file mode 100644 index 0000000..308f136 --- /dev/null +++ b/Scenarios/Generic/HINT_AgeAndAccess/A_BaselineOutbreak/.scenario @@ -0,0 +1,11 @@ +{ + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py output/PropertyReport.json", + "script": "plotPropertyReport.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "HINT - Baseline Outbreak", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/Generic/HINT_AgeAndAccess/A_BaselineOutbreak/plotAllCharts.ps1 b/Scenarios/Generic/HINT_AgeAndAccess/A_BaselineOutbreak/plotAllCharts.ps1 index 26727a5..0babe55 100644 --- a/Scenarios/Generic/HINT_AgeAndAccess/A_BaselineOutbreak/plotAllCharts.ps1 +++ b/Scenarios/Generic/HINT_AgeAndAccess/A_BaselineOutbreak/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "HINT - Baseline Outbreak" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/HINT_AgeAndAccess/B_AgeTargetedVaccine/.scenario b/Scenarios/Generic/HINT_AgeAndAccess/B_AgeTargetedVaccine/.scenario new file mode 100644 index 0000000..e35c107 --- /dev/null +++ b/Scenarios/Generic/HINT_AgeAndAccess/B_AgeTargetedVaccine/.scenario @@ -0,0 +1,11 @@ +{ + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py output/PropertyReport.json", + "script": "plotPropertyReport.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "HINT - Age-Targeted Vaccine", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/Generic/HINT_AgeAndAccess/B_AgeTargetedVaccine/plotAllCharts.ps1 b/Scenarios/Generic/HINT_AgeAndAccess/B_AgeTargetedVaccine/plotAllCharts.ps1 index 0bb4969..0babe55 100644 --- a/Scenarios/Generic/HINT_AgeAndAccess/B_AgeTargetedVaccine/plotAllCharts.ps1 +++ b/Scenarios/Generic/HINT_AgeAndAccess/B_AgeTargetedVaccine/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "HINT - Age-Targeted Vaccine" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/HINT_AgeAndAccess/C_AccessTargetedVaccine/.scenario b/Scenarios/Generic/HINT_AgeAndAccess/C_AccessTargetedVaccine/.scenario new file mode 100644 index 0000000..333701e --- /dev/null +++ b/Scenarios/Generic/HINT_AgeAndAccess/C_AccessTargetedVaccine/.scenario @@ -0,0 +1,11 @@ +{ + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py output/PropertyReport.json", + "script": "plotPropertyReport.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "HINT - Access-Targeted Vaccine", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/Generic/HINT_AgeAndAccess/C_AccessTargetedVaccine/plotAllCharts.ps1 b/Scenarios/Generic/HINT_AgeAndAccess/C_AccessTargetedVaccine/plotAllCharts.ps1 index e9d5924..0babe55 100644 --- a/Scenarios/Generic/HINT_AgeAndAccess/C_AccessTargetedVaccine/plotAllCharts.ps1 +++ b/Scenarios/Generic/HINT_AgeAndAccess/C_AccessTargetedVaccine/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "HINT - Access-Targeted Vaccine" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/HINT_SeattleCommuting/.scenario b/Scenarios/Generic/HINT_SeattleCommuting/.scenario new file mode 100644 index 0000000..4f7d67f --- /dev/null +++ b/Scenarios/Generic/HINT_SeattleCommuting/.scenario @@ -0,0 +1,11 @@ +{ + "plotPropertyReport": { + "commandline": "python ../../../bin/plotPropertyReport.py output/PropertyReport.json -m", + "script": "plotPropertyReport.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "HINT Seattle Commuting", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/Generic/HINT_SeattleCommuting/plotAllCharts.ps1 b/Scenarios/Generic/HINT_SeattleCommuting/plotAllCharts.ps1 index 201b7a3..5793726 100644 --- a/Scenarios/Generic/HINT_SeattleCommuting/plotAllCharts.ps1 +++ b/Scenarios/Generic/HINT_SeattleCommuting/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "HINT Seattle Commuting" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/SEIR/.scenario b/Scenarios/Generic/SEIR/.scenario new file mode 100644 index 0000000..6570dd0 --- /dev/null +++ b/Scenarios/Generic/SEIR/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Generic SEIR", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c SEIR -t \"Generic SEIR\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/SEIR/plotAllCharts.ps1 b/Scenarios/Generic/SEIR/plotAllCharts.ps1 index f8d1346..5793726 100644 --- a/Scenarios/Generic/SEIR/plotAllCharts.ps1 +++ b/Scenarios/Generic/SEIR/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Generic SEIR" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/SEIRS/.scenario b/Scenarios/Generic/SEIRS/.scenario new file mode 100644 index 0000000..206ead7 --- /dev/null +++ b/Scenarios/Generic/SEIRS/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "SEIRS", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c SEIRW -t \"SEIRS\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/SEIRS/plotAllCharts.ps1 b/Scenarios/Generic/SEIRS/plotAllCharts.ps1 index 2f5dab9..5793726 100644 --- a/Scenarios/Generic/SEIRS/plotAllCharts.ps1 +++ b/Scenarios/Generic/SEIRS/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "SEIRS" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/SEIR_VitalDynamics/.scenario b/Scenarios/Generic/SEIR_VitalDynamics/.scenario new file mode 100644 index 0000000..efe739f --- /dev/null +++ b/Scenarios/Generic/SEIR_VitalDynamics/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Generic SEIR with vital dynamics", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c SEIR -t \"Generic SEIR with vital dynamics\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/SEIR_VitalDynamics/plotAllCharts.ps1 b/Scenarios/Generic/SEIR_VitalDynamics/plotAllCharts.ps1 index 15c8831..5793726 100644 --- a/Scenarios/Generic/SEIR_VitalDynamics/plotAllCharts.ps1 +++ b/Scenarios/Generic/SEIR_VitalDynamics/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Generic SEIR with vital dynamics" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/SI/.scenario b/Scenarios/Generic/SI/.scenario new file mode 100644 index 0000000..3f9b8c1 --- /dev/null +++ b/Scenarios/Generic/SI/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "SI", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c SI -t \"SI\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/SI/plotAllCharts.ps1 b/Scenarios/Generic/SI/plotAllCharts.ps1 index b267ee2..5793726 100644 --- a/Scenarios/Generic/SI/plotAllCharts.ps1 +++ b/Scenarios/Generic/SI/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "SI" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/SIR/.scenario b/Scenarios/Generic/SIR/.scenario new file mode 100644 index 0000000..a47480d --- /dev/null +++ b/Scenarios/Generic/SIR/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "SIR", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c SIR -t \"SIR\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/SIR/plotAllCharts.ps1 b/Scenarios/Generic/SIR/plotAllCharts.ps1 index 9446608..5793726 100644 --- a/Scenarios/Generic/SIR/plotAllCharts.ps1 +++ b/Scenarios/Generic/SIR/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "SIR" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/SIRS/.scenario b/Scenarios/Generic/SIRS/.scenario new file mode 100644 index 0000000..88e4076 --- /dev/null +++ b/Scenarios/Generic/SIRS/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "SIRS", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c SIRW -t \"SIRS\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/SIRS/plotAllCharts.ps1 b/Scenarios/Generic/SIRS/plotAllCharts.ps1 index 92f4035..5793726 100644 --- a/Scenarios/Generic/SIRS/plotAllCharts.ps1 +++ b/Scenarios/Generic/SIRS/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "SIRS" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/SIS/.scenario b/Scenarios/Generic/SIS/.scenario new file mode 100644 index 0000000..112b513 --- /dev/null +++ b/Scenarios/Generic/SIS/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "SIS", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c SI -t \"SIS\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/SIS/plotAllCharts.ps1 b/Scenarios/Generic/SIS/plotAllCharts.ps1 index 6067b12..5793726 100644 --- a/Scenarios/Generic/SIS/plotAllCharts.ps1 +++ b/Scenarios/Generic/SIS/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "SIS" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/Vaccinations/A_BaselineOutbreak/.scenario b/Scenarios/Generic/Vaccinations/A_BaselineOutbreak/.scenario new file mode 100644 index 0000000..f418ae7 --- /dev/null +++ b/Scenarios/Generic/Vaccinations/A_BaselineOutbreak/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Vaccinations - Baseline", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SIR -t \"Vaccinations - Baseline\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -n output/PropertyReport.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/Generic/Vaccinations/A_BaselineOutbreak/plotAllCharts.ps1 b/Scenarios/Generic/Vaccinations/A_BaselineOutbreak/plotAllCharts.ps1 index 0902552..0babe55 100644 --- a/Scenarios/Generic/Vaccinations/A_BaselineOutbreak/plotAllCharts.ps1 +++ b/Scenarios/Generic/Vaccinations/A_BaselineOutbreak/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Vaccinations - Baseline" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/Vaccinations/B_Vaccinations/.scenario b/Scenarios/Generic/Vaccinations/B_Vaccinations/.scenario new file mode 100644 index 0000000..242be3d --- /dev/null +++ b/Scenarios/Generic/Vaccinations/B_Vaccinations/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Vaccinations - Vaccination All", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SIR -t \"Vaccinations - Vaccination All\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -n output/PropertyReport.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/Generic/Vaccinations/B_Vaccinations/plotAllCharts.ps1 b/Scenarios/Generic/Vaccinations/B_Vaccinations/plotAllCharts.ps1 index 09a1cde..0babe55 100644 --- a/Scenarios/Generic/Vaccinations/B_Vaccinations/plotAllCharts.ps1 +++ b/Scenarios/Generic/Vaccinations/B_Vaccinations/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Vaccinations - Vaccination All" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/Vaccinations/C_TargetedVaccinations/.scenario b/Scenarios/Generic/Vaccinations/C_TargetedVaccinations/.scenario new file mode 100644 index 0000000..46ab325 --- /dev/null +++ b/Scenarios/Generic/Vaccinations/C_TargetedVaccinations/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Vaccinations - Easy Targeted", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SIR -t \"Vaccinations - Easy Targeted\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -n output/PropertyReport.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/Generic/Vaccinations/C_TargetedVaccinations/plotAllCharts.ps1 b/Scenarios/Generic/Vaccinations/C_TargetedVaccinations/plotAllCharts.ps1 index 5e8e555..0babe55 100644 --- a/Scenarios/Generic/Vaccinations/C_TargetedVaccinations/plotAllCharts.ps1 +++ b/Scenarios/Generic/Vaccinations/C_TargetedVaccinations/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Vaccinations - Easy Targeted" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Generic/Zoonosis/.scenario b/Scenarios/Generic/Zoonosis/.scenario new file mode 100644 index 0000000..63b84fe --- /dev/null +++ b/Scenarios/Generic/Zoonosis/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Zoonosis", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c SEIRW -t \"Zoonosis\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/Generic/Zoonosis/plotAllCharts.ps1 b/Scenarios/Generic/Zoonosis/plotAllCharts.ps1 index 8f4cf2e..5793726 100644 --- a/Scenarios/Generic/Zoonosis/plotAllCharts.ps1 +++ b/Scenarios/Generic/Zoonosis/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Zoonosis" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/HIV/HIV-specific_biology/.scenario b/Scenarios/HIV/HIV-specific_biology/.scenario new file mode 100644 index 0000000..69bdb7f --- /dev/null +++ b/Scenarios/HIV/HIV-specific_biology/.scenario @@ -0,0 +1,15 @@ +{ + "plotBinnedChart": { + "commandline": "python ../../../bin/plotBinnedPopulation.py -c \"Infected\" output/BinnedReport.json", + "script": "plotBinnedChart.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Infected", + "report": "output/InsetChart.json" + }, + "plotHIVSummary": { + "commandline": "python ../../../bin/plotHIVSummary_15_49.py output/ReportHIVByAgeAndGender.csv", + "script": "plotHIVSummary.py" + } +} diff --git a/Scenarios/HIV/HIV-specific_biology/plotAllCharts.ps1 b/Scenarios/HIV/HIV-specific_biology/plotAllCharts.ps1 index 02d5c41..5793726 100644 --- a/Scenarios/HIV/HIV-specific_biology/plotAllCharts.ps1 +++ b/Scenarios/HIV/HIV-specific_biology/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Infected" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/HIV/Health_care/.scenario b/Scenarios/HIV/Health_care/.scenario new file mode 100644 index 0000000..69bdb7f --- /dev/null +++ b/Scenarios/HIV/Health_care/.scenario @@ -0,0 +1,15 @@ +{ + "plotBinnedChart": { + "commandline": "python ../../../bin/plotBinnedPopulation.py -c \"Infected\" output/BinnedReport.json", + "script": "plotBinnedChart.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Infected", + "report": "output/InsetChart.json" + }, + "plotHIVSummary": { + "commandline": "python ../../../bin/plotHIVSummary_15_49.py output/ReportHIVByAgeAndGender.csv", + "script": "plotHIVSummary.py" + } +} diff --git a/Scenarios/HIV/Health_care/ART_Eligibility/.scenario b/Scenarios/HIV/Health_care/ART_Eligibility/.scenario new file mode 100644 index 0000000..4bbff66 --- /dev/null +++ b/Scenarios/HIV/Health_care/ART_Eligibility/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "HIV Cascade of Care", + "report": "output/InsetChart.json" + }, + "plotEvents": { + "commandline": "python ../../../../bin/plotEventRecorder.py output/ReportEventRecorder.csv", + "script": "plotEvents.py" + } +} diff --git a/Scenarios/HIV/Health_care/ART_Eligibility/plotAllCharts.ps1 b/Scenarios/HIV/Health_care/ART_Eligibility/plotAllCharts.ps1 index 1014e1b..0babe55 100644 --- a/Scenarios/HIV/Health_care/ART_Eligibility/plotAllCharts.ps1 +++ b/Scenarios/HIV/Health_care/ART_Eligibility/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "HIV Cascade of Care" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/HIV/Health_care/Restricting_Multiple_Entries/.scenario b/Scenarios/HIV/Health_care/Restricting_Multiple_Entries/.scenario new file mode 100644 index 0000000..8d92576 --- /dev/null +++ b/Scenarios/HIV/Health_care/Restricting_Multiple_Entries/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "HIV Cascade Multiple Entries", + "report": "output/InsetChart.json" + }, + "plotEvents": { + "commandline": "python ../../../../bin/plotEventRecorder.py output/ReportEventRecorder.csv", + "script": "plotEvents.py" + } +} diff --git a/Scenarios/HIV/Health_care/Restricting_Multiple_Entries/plotAllCharts.ps1 b/Scenarios/HIV/Health_care/Restricting_Multiple_Entries/plotAllCharts.ps1 index 515d86d..0babe55 100644 --- a/Scenarios/HIV/Health_care/Restricting_Multiple_Entries/plotAllCharts.ps1 +++ b/Scenarios/HIV/Health_care/Restricting_Multiple_Entries/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "HIV Cascade Multiple Entries" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/HIV/Health_care/plotAllCharts.ps1 b/Scenarios/HIV/Health_care/plotAllCharts.ps1 index 02d5c41..5793726 100644 --- a/Scenarios/HIV/Health_care/plotAllCharts.ps1 +++ b/Scenarios/HIV/Health_care/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Infected" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/HIV/Relationship_networks/Forming_relationships/plotAllCharts.ps1 b/Scenarios/HIV/Relationship_networks/Forming_relationships/plotAllCharts.ps1 index 94618b0..0babe55 100644 --- a/Scenarios/HIV/Relationship_networks/Forming_relationships/plotAllCharts.ps1 +++ b/Scenarios/HIV/Relationship_networks/Forming_relationships/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Relationship Networks" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/HIV/Relationship_networks/Sexual_debut/plotAllCharts.ps1 b/Scenarios/HIV/Relationship_networks/Sexual_debut/plotAllCharts.ps1 index 5aeff7c..0babe55 100644 --- a/Scenarios/HIV/Relationship_networks/Sexual_debut/plotAllCharts.ps1 +++ b/Scenarios/HIV/Relationship_networks/Sexual_debut/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Sexual Debut" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/HIV/Transmission/.scenario b/Scenarios/HIV/Transmission/.scenario new file mode 100644 index 0000000..39e717e --- /dev/null +++ b/Scenarios/HIV/Transmission/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "HIV Transmission", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../bin/plotSIRChannels.py -c I -t \"HIV Transmission\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotHIVSummary": { + "commandline": "python ../../../bin/plotHIVSummary_15_49.py output/ReportHIVByAgeAndGender.csv", + "script": "plotHIVSummary.py" + } +} diff --git a/Scenarios/HIV/Transmission/plotAllCharts.ps1 b/Scenarios/HIV/Transmission/plotAllCharts.ps1 index 58a3753..5793726 100644 --- a/Scenarios/HIV/Transmission/plotAllCharts.ps1 +++ b/Scenarios/HIV/Transmission/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "HIV Transmission" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Baseline_scenarios/1_Simple_Vector_Model/plotAllCharts.ps1 b/Scenarios/Malaria/Baseline_scenarios/1_Simple_Vector_Model/plotAllCharts.ps1 index b7c972c..0babe55 100644 --- a/Scenarios/Malaria/Baseline_scenarios/1_Simple_Vector_Model/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Baseline_scenarios/1_Simple_Vector_Model/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Simple Vector" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Baseline_scenarios/2_Full_Malaria_Model/plotAllCharts.ps1 b/Scenarios/Malaria/Baseline_scenarios/2_Full_Malaria_Model/plotAllCharts.ps1 index 4dd5269..0babe55 100644 --- a/Scenarios/Malaria/Baseline_scenarios/2_Full_Malaria_Model/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Baseline_scenarios/2_Full_Malaria_Model/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Full Malaria Model" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Garki/plotAllCharts.ps1 b/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Garki/plotAllCharts.ps1 index 5f8eefa..b6fba6b 100644 --- a/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Garki/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Garki/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Impact of Climate - Garki" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Muheza/plotAllCharts.ps1 b/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Muheza/plotAllCharts.ps1 index 4024af8..b6fba6b 100644 --- a/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Muheza/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Muheza/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Impact of Climate - Muheza" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Namawala/plotAllCharts.ps1 b/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Namawala/plotAllCharts.ps1 index 79c265a..b6fba6b 100644 --- a/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Namawala/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Baseline_scenarios/3_Impact_Climate_Seasonality/Namawala/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Impact of Climate - Namawala" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Scenarios_with_Campaigns/1_Bednet_Distribution/plotAllCharts.ps1 b/Scenarios/Malaria/Scenarios_with_Campaigns/1_Bednet_Distribution/plotAllCharts.ps1 index bae8662..0babe55 100644 --- a/Scenarios/Malaria/Scenarios_with_Campaigns/1_Bednet_Distribution/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Scenarios_with_Campaigns/1_Bednet_Distribution/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Bednets" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Scenarios_with_Campaigns/2_Bednets_Pre-erythrocityic_Vaccines/plotAllCharts.ps1 b/Scenarios/Malaria/Scenarios_with_Campaigns/2_Bednets_Pre-erythrocityic_Vaccines/plotAllCharts.ps1 index 73baaae..0babe55 100644 --- a/Scenarios/Malaria/Scenarios_with_Campaigns/2_Bednets_Pre-erythrocityic_Vaccines/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Scenarios_with_Campaigns/2_Bednets_Pre-erythrocityic_Vaccines/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Bednets with Vaccines" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Scenarios_with_Campaigns/3_Multiple_Interventions/plotAllCharts.ps1 b/Scenarios/Malaria/Scenarios_with_Campaigns/3_Multiple_Interventions/plotAllCharts.ps1 index d3ac0df..0babe55 100644 --- a/Scenarios/Malaria/Scenarios_with_Campaigns/3_Multiple_Interventions/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Scenarios_with_Campaigns/3_Multiple_Interventions/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Multiple Intervetions" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Scenarios_with_Campaigns/4_Garki_Retrospective-IRS_MDA/plotAllCharts.ps1 b/Scenarios/Malaria/Scenarios_with_Campaigns/4_Garki_Retrospective-IRS_MDA/plotAllCharts.ps1 index 9b5f8d7..0babe55 100644 --- a/Scenarios/Malaria/Scenarios_with_Campaigns/4_Garki_Retrospective-IRS_MDA/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Scenarios_with_Campaigns/4_Garki_Retrospective-IRS_MDA/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Garki: IRS & MDA" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Scenarios_with_Campaigns/5_Sugar-baited_Traps/plotAllCharts.ps1 b/Scenarios/Malaria/Scenarios_with_Campaigns/5_Sugar-baited_Traps/plotAllCharts.ps1 index 49160b6..0babe55 100644 --- a/Scenarios/Malaria/Scenarios_with_Campaigns/5_Sugar-baited_Traps/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Scenarios_with_Campaigns/5_Sugar-baited_Traps/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Sugar-baited Traps" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Scenarios_with_Campaigns/6_Insect_Killing_Fence/plotAllCharts.ps1 b/Scenarios/Malaria/Scenarios_with_Campaigns/6_Insect_Killing_Fence/plotAllCharts.ps1 index dcdff06..0babe55 100644 --- a/Scenarios/Malaria/Scenarios_with_Campaigns/6_Insect_Killing_Fence/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Scenarios_with_Campaigns/6_Insect_Killing_Fence/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Insect-Killing Fence" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Malaria/Scenarios_with_Campaigns/7_Linear_Combination_Vector_Habitat/plotAllCharts.ps1 b/Scenarios/Malaria/Scenarios_with_Campaigns/7_Linear_Combination_Vector_Habitat/plotAllCharts.ps1 index 46c791f..0babe55 100644 --- a/Scenarios/Malaria/Scenarios_with_Campaigns/7_Linear_Combination_Vector_Habitat/plotAllCharts.ps1 +++ b/Scenarios/Malaria/Scenarios_with_Campaigns/7_Linear_Combination_Vector_Habitat/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Multiple Larval Habitats" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Age_Immunity/Lifelong/.scenario b/Scenarios/TB/Age_Immunity/Lifelong/.scenario new file mode 100644 index 0000000..7eb3a68 --- /dev/null +++ b/Scenarios/TB/Age_Immunity/Lifelong/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Lifelong age-dependent immunity", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Lifelong age-dependent immunity\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Age_Immunity/Lifelong/plotAllCharts.ps1 b/Scenarios/TB/Age_Immunity/Lifelong/plotAllCharts.ps1 index 98a9f60..0babe55 100644 --- a/Scenarios/TB/Age_Immunity/Lifelong/plotAllCharts.ps1 +++ b/Scenarios/TB/Age_Immunity/Lifelong/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Lifelong age-dependent immunity" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Age_Immunity/Vaccines/.scenario b/Scenarios/TB/Age_Immunity/Vaccines/.scenario new file mode 100644 index 0000000..94cd348 --- /dev/null +++ b/Scenarios/TB/Age_Immunity/Vaccines/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Vaccination and age-dependent immunity", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Vaccination and age-dependent immunity\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Age_Immunity/Vaccines/plotAllCharts.ps1 b/Scenarios/TB/Age_Immunity/Vaccines/plotAllCharts.ps1 index fde9f55..0babe55 100644 --- a/Scenarios/TB/Age_Immunity/Vaccines/plotAllCharts.ps1 +++ b/Scenarios/TB/Age_Immunity/Vaccines/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Vaccination and age-dependent immunity" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Age_Immunity/Waning/.scenario b/Scenarios/TB/Age_Immunity/Waning/.scenario new file mode 100644 index 0000000..25169b6 --- /dev/null +++ b/Scenarios/TB/Age_Immunity/Waning/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Waning age-dependent immunity", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Waning age-dependent immunity\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Age_Immunity/Waning/plotAllCharts.ps1 b/Scenarios/TB/Age_Immunity/Waning/plotAllCharts.ps1 index 1561b0b..0babe55 100644 --- a/Scenarios/TB/Age_Immunity/Waning/plotAllCharts.ps1 +++ b/Scenarios/TB/Age_Immunity/Waning/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Waning age-dependent immunity" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/.scenario b/Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/.scenario new file mode 100644 index 0000000..64e19a4 --- /dev/null +++ b/Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Active case finding", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Active case finding\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -c \"Active TB Infections\" -c \"Infected\" -c \"Active Smearpos TB Infections\" -c \"Statistical Population\" -g InterventionStatus output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/plotAllCharts.ps1 b/Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/plotAllCharts.ps1 index 2d439ee..0babe55 100644 --- a/Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/plotAllCharts.ps1 +++ b/Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Active case finding" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/.scenario b/Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/.scenario new file mode 100644 index 0000000..a00c5d7 --- /dev/null +++ b/Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Passive case finding", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Passive case finding\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -c \"Active TB Infections\" -c \"Infected\" -c \"Active Smearpos TB Infections\" -c \"Statistical Population\" -g InterventionStatus output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/plotAllCharts.ps1 b/Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/plotAllCharts.ps1 index df4ec63..0babe55 100644 --- a/Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/plotAllCharts.ps1 +++ b/Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Passive case finding" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Disease_Progression/Active_presentation/.scenario b/Scenarios/TB/Disease_Progression/Active_presentation/.scenario new file mode 100644 index 0000000..bb941d2 --- /dev/null +++ b/Scenarios/TB/Disease_Progression/Active_presentation/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Active disease presentation", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Active disease presentation\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/TB/Disease_Progression/Active_presentation/compareWithBaseline.bat b/Scenarios/TB/Disease_Progression/Active_presentation/compareWithBaseline.bat deleted file mode 100644 index 8875e4b..0000000 --- a/Scenarios/TB/Disease_Progression/Active_presentation/compareWithBaseline.bat +++ /dev/null @@ -1 +0,0 @@ -python ..\..\..\..\scripts\plotTbResults_Progression_Comparison.py ..\SEIR\output\InsetChart.json output\InsetChart.json -c "Latent TB Prevalence" -c "Active Presymptomatic Prevalence" -c "Active Symptomatic Prevalence" -c "Active Sx Smear pos Prevalence" -c "Active Sx Smear neg Prevalence" -c "Active Sx Extrapulm Prevalence" diff --git a/Scenarios/TB/Disease_Progression/Active_presentation/plotAllCharts.ps1 b/Scenarios/TB/Disease_Progression/Active_presentation/plotAllCharts.ps1 index c6fb9d5..0babe55 100644 --- a/Scenarios/TB/Disease_Progression/Active_presentation/plotAllCharts.ps1 +++ b/Scenarios/TB/Disease_Progression/Active_presentation/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Active disease presentation" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Disease_Progression/Active_presentation/plotCompareWithBaseline.ps1 b/Scenarios/TB/Disease_Progression/Active_presentation/plotCompareWithBaseline.ps1 new file mode 100644 index 0000000..f5e6bb9 --- /dev/null +++ b/Scenarios/TB/Disease_Progression/Active_presentation/plotCompareWithBaseline.ps1 @@ -0,0 +1,7 @@ +Push-Location -Path $PSScriptRoot + +. ../../../../scripts/helpers.ps1 + +$chart = (Join-Path "output" "InsetChart.json") +$pyscript = (Join-Path "$BIN_ROOT" "plotTbResults_Progression_Comparison.py") +& python $pyscript -b ..\SEIR\output\InsetChart.json -C output\InsetChart.json -c "Latent TB Prevalence" -c "Active Presymptomatic Prevalence" -c "Active Symptomatic Prevalence" -c "Active Sx Smear pos Prevalence" -c "Active Sx Smear neg Prevalence" -c "Active Sx Extrapulm Prevalence" diff --git a/Scenarios/TB/Disease_Progression/Latency_progression/.scenario b/Scenarios/TB/Disease_Progression/Latency_progression/.scenario new file mode 100644 index 0000000..ebfc15c --- /dev/null +++ b/Scenarios/TB/Disease_Progression/Latency_progression/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Latency progression", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Latency progression\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "compareScenarios": { + "commandline": "python ../../../../bin/plotTbResults_Progression_Comparison.py -b ../SEIR/output/InsetChart.json -C output/InsetChart.json -c \"Latent TB Prevalence\" -c \"Active Presymptomatic Prevalence\" -c \"Active Symptomatic Prevalence\" -c \"Active Sx Smear pos Prevalence\" -c \"Active Sx Smear neg Prevalence\" -c \"Active Sx Extrapulm Prevalence\" -c \"Latent TB Prevalence\" -c \"Latent Fast TB Prevalence\" -c \"Latent Slow TB Prevalence\"", + "script": "compareScenarios.py" + } +} diff --git a/Scenarios/TB/Disease_Progression/Latency_progression/plotAllCharts.ps1 b/Scenarios/TB/Disease_Progression/Latency_progression/plotAllCharts.ps1 index a95226f..0babe55 100644 --- a/Scenarios/TB/Disease_Progression/Latency_progression/plotAllCharts.ps1 +++ b/Scenarios/TB/Disease_Progression/Latency_progression/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Latency progression" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Disease_Progression/SEIR/.scenario b/Scenarios/TB/Disease_Progression/SEIR/.scenario new file mode 100644 index 0000000..3b47fb8 --- /dev/null +++ b/Scenarios/TB/Disease_Progression/SEIR/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "TB as SEIR", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"TB as SEIR\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/TB/Disease_Progression/SEIR/plotAllCharts.ps1 b/Scenarios/TB/Disease_Progression/SEIR/plotAllCharts.ps1 index 8a8f9b9..0babe55 100644 --- a/Scenarios/TB/Disease_Progression/SEIR/plotAllCharts.ps1 +++ b/Scenarios/TB/Disease_Progression/SEIR/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "TB as SEIR" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/HIV_Coinfection/ART/.scenario b/Scenarios/TB/HIV_Coinfection/ART/.scenario new file mode 100644 index 0000000..556d8fd --- /dev/null +++ b/Scenarios/TB/HIV_Coinfection/ART/.scenario @@ -0,0 +1,15 @@ +{ + "plotTBHIVART": { + "commandline": "python ../../../bin/plotTBHIVART.py --title=\"ART\" output/Report_TBHIV_ByAge.csv", + "script": "plotTBHIVART.py" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"ART for HIV Coinfection\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "ART for HIV Coinfection", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/TB/HIV_Coinfection/ART/emodules_map.json b/Scenarios/TB/HIV_Coinfection/ART/emodules_map.json index 7530e4d..76d6b43 100644 --- a/Scenarios/TB/HIV_Coinfection/ART/emodules_map.json +++ b/Scenarios/TB/HIV_Coinfection/ART/emodules_map.json @@ -2,6 +2,6 @@ "disease_plugins": [], "interventions": [], "reporter_plugins": [ - "..\\..\\..\\..\\Demographics_Files\\libcustomreport_TBHIV_ByAge.dll" + "../../../../Demographics_Files/libcustomreport_TBHIV_ByAge.dll" ] } \ No newline at end of file diff --git a/Scenarios/TB/HIV_Coinfection/ART/plotAllCharts.ps1 b/Scenarios/TB/HIV_Coinfection/ART/plotAllCharts.ps1 index f4374b9..561a874 100644 --- a/Scenarios/TB/HIV_Coinfection/ART/plotAllCharts.ps1 +++ b/Scenarios/TB/HIV_Coinfection/ART/plotAllCharts.ps1 @@ -2,7 +2,10 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "ART for HIV Coinfection" -& python $pyscript $chart "$pytitle" + + +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/HIV_Coinfection/ART/plotTBHIVART.bat b/Scenarios/TB/HIV_Coinfection/ART/plotTBHIVART.bat new file mode 100644 index 0000000..b001819 --- /dev/null +++ b/Scenarios/TB/HIV_Coinfection/ART/plotTBHIVART.bat @@ -0,0 +1,5 @@ +@SETLOCAL +@SET PATH=%PATH%;C:\Python36 +python.exe ..\..\..\scripts\plotTBHIVART.py --title="ART" output/Report_TBHIV_ByAge.csv +@ENDLOCAL + diff --git a/Scenarios/TB/HIV_Coinfection/NoART/.scenario b/Scenarios/TB/HIV_Coinfection/NoART/.scenario new file mode 100644 index 0000000..ba5f55a --- /dev/null +++ b/Scenarios/TB/HIV_Coinfection/NoART/.scenario @@ -0,0 +1,15 @@ +{ + "plotTBHIVART": { + "commandline": "python ../../../bin/plotTBHIVART.py --title=\"NoART\" output/Report_TBHIV_ByAge.csv", + "script": "plotTBHIVART.py" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"No ART for HIV Coinfection\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "No ART for HIV Coinfection", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/TB/HIV_Coinfection/NoART/plotAllCharts.ps1 b/Scenarios/TB/HIV_Coinfection/NoART/plotAllCharts.ps1 index 52d0a4b..0babe55 100644 --- a/Scenarios/TB/HIV_Coinfection/NoART/plotAllCharts.ps1 +++ b/Scenarios/TB/HIV_Coinfection/NoART/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "No ART for HIV Coinfection" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/HIV_Coinfection/NoART/plotTBHIVART.bat b/Scenarios/TB/HIV_Coinfection/NoART/plotTBHIVART.bat new file mode 100644 index 0000000..b001819 --- /dev/null +++ b/Scenarios/TB/HIV_Coinfection/NoART/plotTBHIVART.bat @@ -0,0 +1,5 @@ +@SETLOCAL +@SET PATH=%PATH%;C:\Python36 +python.exe ..\..\..\scripts\plotTBHIVART.py --title="ART" output/Report_TBHIV_ByAge.csv +@ENDLOCAL + diff --git a/Scenarios/TB/HIV_Coinfection/plotARTScenarios.bat b/Scenarios/TB/HIV_Coinfection/plotARTScenarios.bat deleted file mode 100644 index d530d3b..0000000 --- a/Scenarios/TB/HIV_Coinfection/plotARTScenarios.bat +++ /dev/null @@ -1,6 +0,0 @@ -@SETLOCAL -@SET PATH=%PATH%;C:\Python36 -python.exe ..\..\..\scripts\plotTBHIVART.py 0 -python.exe ..\..\..\scripts\plotTBHIVART.py 1 -@ENDLOCAL - diff --git a/Scenarios/TB/Health_Systems/MultipleSystems/.scenario b/Scenarios/TB/Health_Systems/MultipleSystems/.scenario new file mode 100644 index 0000000..a073377 --- /dev/null +++ b/Scenarios/TB/Health_Systems/MultipleSystems/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Public and private health systems", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Public and private health systems\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -c \"Active TB Infections\" -c \"Statistical Population\" -c \"Infected\" output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Health_Systems/MultipleSystems/plotAllCharts.ps1 b/Scenarios/TB/Health_Systems/MultipleSystems/plotAllCharts.ps1 index 9ec9bd9..0babe55 100644 --- a/Scenarios/TB/Health_Systems/MultipleSystems/plotAllCharts.ps1 +++ b/Scenarios/TB/Health_Systems/MultipleSystems/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Public and private health systems" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Health_Systems/NoneToPublic/.scenario b/Scenarios/TB/Health_Systems/NoneToPublic/.scenario new file mode 100644 index 0000000..7cdf3d2 --- /dev/null +++ b/Scenarios/TB/Health_Systems/NoneToPublic/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Move individuals with no health care to the public system", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Move individuals with no health care to the public system\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -c \"Active TB Infections\" -c \"Statistical Population\" -c \"Infected\" output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Health_Systems/NoneToPublic/plotAllCharts.ps1 b/Scenarios/TB/Health_Systems/NoneToPublic/plotAllCharts.ps1 index 9d72ec9..0babe55 100644 --- a/Scenarios/TB/Health_Systems/NoneToPublic/plotAllCharts.ps1 +++ b/Scenarios/TB/Health_Systems/NoneToPublic/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Move individuals with no health care to the public system" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Health_Systems/PrivateToPublic/.scenario b/Scenarios/TB/Health_Systems/PrivateToPublic/.scenario new file mode 100644 index 0000000..24d0231 --- /dev/null +++ b/Scenarios/TB/Health_Systems/PrivateToPublic/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Move individuals in the private system to public", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Move individuals in the private system to public\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -c \"Active TB Infections\" -c \"Statistical Population\" -c \"Infected\" output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Health_Systems/PrivateToPublic/plotAllCharts.ps1 b/Scenarios/TB/Health_Systems/PrivateToPublic/plotAllCharts.ps1 index 84cefdd..0babe55 100644 --- a/Scenarios/TB/Health_Systems/PrivateToPublic/plotAllCharts.ps1 +++ b/Scenarios/TB/Health_Systems/PrivateToPublic/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Move individuals in the private system to public" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Health_Systems/SystemImprovement/.scenario b/Scenarios/TB/Health_Systems/SystemImprovement/.scenario new file mode 100644 index 0000000..c4c37f4 --- /dev/null +++ b/Scenarios/TB/Health_Systems/SystemImprovement/.scenario @@ -0,0 +1,15 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Improve quality in the private system", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Improve quality in the private system\" output/InsetChart.json", + "script": "plotSIRChannels.py" + }, + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py -c \"Active TB Infections:QualityOfCare:None\" -c \"Active TB Infections:QualityOfCare:Private\" -c \"Active TB Infections:QualityOfCare:Public\" -c \"Statistical Population:QualityOfCare:None\" -c \"Statistical Population:QualityOfCare:Private\" -c \"Statistical Population:QualityOfCare:Public\" -c \"Infected:QualityOfCare:None\" -c \"Infected:QualityOfCare:Private\" -c \"Infected:QualityOfCare:Public\" output/PropertyReportTB.json", + "script": "plotPropertyReport.py" + } +} diff --git a/Scenarios/TB/Health_Systems/SystemImprovement/plotAllCharts.ps1 b/Scenarios/TB/Health_Systems/SystemImprovement/plotAllCharts.ps1 index ada0380..0babe55 100644 --- a/Scenarios/TB/Health_Systems/SystemImprovement/plotAllCharts.ps1 +++ b/Scenarios/TB/Health_Systems/SystemImprovement/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Improve quality in the private system" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/MDR-TB/Effective_Treatment/.scenario b/Scenarios/TB/MDR-TB/Effective_Treatment/.scenario new file mode 100644 index 0000000..ec5b2ea --- /dev/null +++ b/Scenarios/TB/MDR-TB/Effective_Treatment/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Second line treatment", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Second line treatment\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/TB/MDR-TB/Effective_Treatment/plotAllCharts.ps1 b/Scenarios/TB/MDR-TB/Effective_Treatment/plotAllCharts.ps1 index d980e8b..0babe55 100644 --- a/Scenarios/TB/MDR-TB/Effective_Treatment/plotAllCharts.ps1 +++ b/Scenarios/TB/MDR-TB/Effective_Treatment/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Second line treatment" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/MDR-TB/Ineffective_Treatment/.scenario b/Scenarios/TB/MDR-TB/Ineffective_Treatment/.scenario new file mode 100644 index 0000000..3ca8a36 --- /dev/null +++ b/Scenarios/TB/MDR-TB/Ineffective_Treatment/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Ineffective treatment", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Ineffective treatment\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/TB/MDR-TB/Ineffective_Treatment/plotAllCharts.ps1 b/Scenarios/TB/MDR-TB/Ineffective_Treatment/plotAllCharts.ps1 index bd4c793..0babe55 100644 --- a/Scenarios/TB/MDR-TB/Ineffective_Treatment/plotAllCharts.ps1 +++ b/Scenarios/TB/MDR-TB/Ineffective_Treatment/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Ineffective treatment" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Population_BurnIn/Private_To_Public/.scenario b/Scenarios/TB/Population_BurnIn/Private_To_Public/.scenario new file mode 100644 index 0000000..e90dcbf --- /dev/null +++ b/Scenarios/TB/Population_BurnIn/Private_To_Public/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Private to public health care", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Private to public health care\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/TB/Population_BurnIn/Private_To_Public/plotAllCharts.ps1 b/Scenarios/TB/Population_BurnIn/Private_To_Public/plotAllCharts.ps1 index 7a595fa..0babe55 100644 --- a/Scenarios/TB/Population_BurnIn/Private_To_Public/plotAllCharts.ps1 +++ b/Scenarios/TB/Population_BurnIn/Private_To_Public/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Private to public health care" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/TB/Population_BurnIn/Steady_State/.scenario b/Scenarios/TB/Population_BurnIn/Steady_State/.scenario new file mode 100644 index 0000000..6ea63b8 --- /dev/null +++ b/Scenarios/TB/Population_BurnIn/Steady_State/.scenario @@ -0,0 +1,11 @@ +{ + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Steady state", + "report": "output/InsetChart.json" + }, + "plotSIRChannels": { + "commandline": "python ../../../../bin/plotSIRChannels.py -c SEIR -t \"Steady state\" output/InsetChart.json", + "script": "plotSIRChannels.py" + } +} diff --git a/Scenarios/TB/Population_BurnIn/Steady_State/plotAllCharts.ps1 b/Scenarios/TB/Population_BurnIn/Steady_State/plotAllCharts.ps1 index 913eb85..0babe55 100644 --- a/Scenarios/TB/Population_BurnIn/Steady_State/plotAllCharts.ps1 +++ b/Scenarios/TB/Population_BurnIn/Steady_State/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Steady state" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Typhoid/EnvironmentalDiagnostic/.scenario b/Scenarios/Typhoid/EnvironmentalDiagnostic/.scenario new file mode 100644 index 0000000..5cf0ad4 --- /dev/null +++ b/Scenarios/Typhoid/EnvironmentalDiagnostic/.scenario @@ -0,0 +1,11 @@ +{ + "plotPropertyReport": { + "commandline": "python ../../../bin/plotPropertyReport.py output/PropertyReportEnvironmental.json", + "script": "plotPropertyReport.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "EnvironmentalDiagnostic", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/Typhoid/EnvironmentalDiagnostic/plotAllCharts.ps1 b/Scenarios/Typhoid/EnvironmentalDiagnostic/plotAllCharts.ps1 index 4977f86..5793726 100644 --- a/Scenarios/Typhoid/EnvironmentalDiagnostic/plotAllCharts.ps1 +++ b/Scenarios/Typhoid/EnvironmentalDiagnostic/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "EnvironmentalDiagnostic" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Typhoid/Multi-Route_HINT/A_Baseline_MR-HINT/.scenario b/Scenarios/Typhoid/Multi-Route_HINT/A_Baseline_MR-HINT/.scenario new file mode 100644 index 0000000..eff586f --- /dev/null +++ b/Scenarios/Typhoid/Multi-Route_HINT/A_Baseline_MR-HINT/.scenario @@ -0,0 +1,11 @@ +{ + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py output/PropertyReportEnvironmental.json", + "script": "plotPropertyReport.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Multi-Route HINT", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/Typhoid/Multi-Route_HINT/A_Baseline_MR-HINT/plotAllCharts.ps1 b/Scenarios/Typhoid/Multi-Route_HINT/A_Baseline_MR-HINT/plotAllCharts.ps1 index 541a495..0babe55 100644 --- a/Scenarios/Typhoid/Multi-Route_HINT/A_Baseline_MR-HINT/plotAllCharts.ps1 +++ b/Scenarios/Typhoid/Multi-Route_HINT/A_Baseline_MR-HINT/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Multi-Route HINT" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Typhoid/Multi-Route_HINT/B_DownTheRiver_MR-HINT/.scenario b/Scenarios/Typhoid/Multi-Route_HINT/B_DownTheRiver_MR-HINT/.scenario new file mode 100644 index 0000000..1cc0150 --- /dev/null +++ b/Scenarios/Typhoid/Multi-Route_HINT/B_DownTheRiver_MR-HINT/.scenario @@ -0,0 +1,11 @@ +{ + "plotPropertyReport": { + "commandline": "python ../../../../bin/plotPropertyReport.py output/PropertyReportEnvironmental.json", + "script": "plotPropertyReport.py" + }, + "plotAllCharts": { + "script": "plotAllCharts.py", + "title": "Down The River MR-HINT", + "report": "output/InsetChart.json" + } +} diff --git a/Scenarios/Typhoid/Multi-Route_HINT/B_DownTheRiver_MR-HINT/plotAllCharts.ps1 b/Scenarios/Typhoid/Multi-Route_HINT/B_DownTheRiver_MR-HINT/plotAllCharts.ps1 index 0372166..0babe55 100644 --- a/Scenarios/Typhoid/Multi-Route_HINT/B_DownTheRiver_MR-HINT/plotAllCharts.ps1 +++ b/Scenarios/Typhoid/Multi-Route_HINT/B_DownTheRiver_MR-HINT/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Down The River MR-HINT" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Typhoid/Seasonality/plotAllCharts.ps1 b/Scenarios/Typhoid/Seasonality/plotAllCharts.ps1 index 420e952..5793726 100644 --- a/Scenarios/Typhoid/Seasonality/plotAllCharts.ps1 +++ b/Scenarios/Typhoid/Seasonality/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "Seasonality" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/Scenarios/Typhoid/TyphoidInfection/plotAllCharts.ps1 b/Scenarios/Typhoid/TyphoidInfection/plotAllCharts.ps1 index 81a1af1..5793726 100644 --- a/Scenarios/Typhoid/TyphoidInfection/plotAllCharts.ps1 +++ b/Scenarios/Typhoid/TyphoidInfection/plotAllCharts.ps1 @@ -2,7 +2,8 @@ Push-Location -Path $PSScriptRoot . ../../../scripts/helpers.ps1 -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "TyphoidInfection" -& python $pyscript $chart "$pytitle" +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/bin/plotAllCharts.py b/bin/plotAllCharts.py index f9098d1..f4da113 100644 --- a/bin/plotAllCharts.py +++ b/bin/plotAllCharts.py @@ -1,15 +1,12 @@ #!/usr/bin/env python -from __future__ import print_function -from __future__ import division -from builtins import str -import matplotlib.pyplot as plt import argparse import json -import sys -import pylab +from builtins import str from math import ceil, sqrt +import matplotlib.pyplot as plt + def main(report, title = "" ): @@ -42,10 +39,14 @@ def main(report, title = "" ): plt.subplots_adjust( left=0.05, right=0.95, bottom=0.035, top=0.915, wspace=0.4, hspace=0.5 ) plt.show() -if __name__ == '__main__': +def cli(): parser = argparse.ArgumentParser() - parser.add_argument("path", default="InsetChart.json", help="Path to the inset chart JSON file") - parser.add_argument("title", default="", help="The title for the chart window") + parser.add_argument("-t","--title", default="", help="The title for the chart window") + parser.add_argument("report", default="output/InsetChart.json", help="Path to the report file (JSON)") + return parser + +if __name__ == '__main__': + parser = cli() args = parser.parse_args() - main(args.path, args.title) + main(args.report, args.title) pass \ No newline at end of file diff --git a/bin/plotBinnedPopulation.py b/bin/plotBinnedPopulation.py index 323d230..b05ce34 100644 --- a/bin/plotBinnedPopulation.py +++ b/bin/plotBinnedPopulation.py @@ -6,8 +6,10 @@ from __future__ import print_function + import argparse import json + import matplotlib.pyplot as pyplot @@ -33,12 +35,15 @@ def main(filename, channel): pass +def cli(): + parser = argparse.ArgumentParser(description="Plot the population by age group.") + parser.add_argument('-c', '--channel', default='Population', help="Channel to plot") + parser.add_argument('report', default='output/BinnedReport.json', help="Path to the report file (JSON)") + return parser if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('path', default='BinnedReport.json', help="Path to the JSON report file") - parser.add_argument('-c', '--channel', default='Population', help="Channel to plot") + parser = cli() args = parser.parse_args() - main(args.path, args.channel) + main(args.report, args.channel) pass diff --git a/bin/plotEventRecorder.py b/bin/plotEventRecorder.py index b3eb70a..4623e43 100644 --- a/bin/plotEventRecorder.py +++ b/bin/plotEventRecorder.py @@ -5,13 +5,13 @@ # OUTPUT: figure drawn on screen from __future__ import print_function + import argparse import csv -import math -import matplotlib.pyplot as pyplot -import matplotlib.ticker as ticker import sys +import matplotlib.pyplot as pyplot + def main(filename, logplot): @@ -120,12 +120,14 @@ def main(filename, logplot): pass - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('filename', default='ReportEventRecorder.csv', help="Path to recoder CSV file") +def cli(): + parser = argparse.ArgumentParser(description="Plot events that occur during a simulation, disaggregated by gender.") parser.add_argument('-l', '--log', default=False, action='store_true', help="Enable verbose logging") + parser.add_argument('report', default='ReportEventRecorder.csv', help="Path to event recorder report file (CSV)") + return parser +if __name__ == '__main__': + parser = cli() args = parser.parse_args() - main(args.filename, args.log) + main(args.report, args.log) pass diff --git a/bin/plotHIVSummary_15_49.py b/bin/plotHIVSummary_15_49.py index 09ff351..7f2c175 100644 --- a/bin/plotHIVSummary_15_49.py +++ b/bin/plotHIVSummary_15_49.py @@ -5,14 +5,11 @@ # OUTPUT: figure drawn on screen -#from __future__ import print_function import argparse -import copy import csv import math -import matplotlib.pyplot as pyplot -import sys +import matplotlib.pyplot as pyplot MALE_ENUM = 0 FEMALE_ENUM = 1 @@ -68,6 +65,10 @@ def main(filename): pass +def cli(): + parser = argparse.ArgumentParser(description="Plot HIV prevalence, incidence rate, and mortality rate for ages 15-49 by gender") + parser.add_argument('report', default='output/ReportHIVByAgeAndGender.csv', help="Relative or absolute path to the report CSV file.") + return parser def plot_data(data, sex_index): @@ -195,9 +196,8 @@ def do_plot(male, female, timeline, plot_definition): if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('filename', default='ReportHIVByAgeAndGender.csv') + parser = cli() args = parser.parse_args() - main(args.filename) + main(args.report) pass diff --git a/bin/plotPropertyReport.py b/bin/plotPropertyReport.py index ab2d98e..0ffce9d 100644 --- a/bin/plotPropertyReport.py +++ b/bin/plotPropertyReport.py @@ -1,12 +1,11 @@ #!/usr/bin/env python -from __future__ import print_function -import os +import argparse import json + import matplotlib.pyplot as plt import numpy as np -import sys -import argparse + def openFile(filename): try: @@ -172,7 +171,7 @@ def plotTraces(args, traceValues, statpopValues): def main(args): try: - reportFile = openFile(args.filename) + reportFile = openFile(args.report) jsonText = readFile(reportFile) jsonData = parseJson(jsonText) poolData = getChannels(jsonData) @@ -186,21 +185,25 @@ def main(args): (traceValues, statpopValues) = accumulateTraceData(args, poolData, poolKeys) plotTraces(args, traceValues, statpopValues) -def processCommandline(): +def cli(): parser = argparse.ArgumentParser(description='Property Report Plotting') - parser.add_argument('filename', nargs='?', default='PropertyReport.json', help='property report filename [PropertyReport.json]') parser.add_argument('-c', '--channel', action='append', help='channel(s) to display [Infected]', metavar='channelName', dest='channels') parser.add_argument('-g', '--group', action='append', help='property or properties by which to group data', metavar='propertyName', dest='grouping') parser.add_argument('-n', '--normalize', help='plot channel(s) normalized by statistical population', action='store_true') parser.add_argument('-o', '--overlay', help='overlay pools of the same channel', action='store_true') parser.add_argument('-s', '--save', help='save figure to disk', action='store_true', dest='saveFigure') parser.add_argument('-m', '--matrix', help='plot matrix for all properties', action='store_true') + parser.add_argument('report', nargs='?', default='output/PropertyReport.json', help='Path to the property report [PropertyReport.json]') + return parser + +def processCommandline(): + parser = cli() args = parser.parse_args() if not args.channels: args.channels = ['Infected'] if not args.grouping: args.grouping = [] - print("Filename: '%s'" % (args.filename)) + print("Filename: '%s'" % (args.report)) print("Channel(s):", args.channels) print("Group: ", args.grouping) print("Normalize: ", args.normalize) diff --git a/bin/plotSIRChannels.py b/bin/plotSIRChannels.py index 062d600..d791de8 100644 --- a/bin/plotSIRChannels.py +++ b/bin/plotSIRChannels.py @@ -1,11 +1,10 @@ #!/usr/bin/env python -from __future__ import print_function import argparse import json + import matplotlib.pyplot as plt import pylab -import sys plt.rcParams['legend.loc'] = 'best' @@ -66,6 +65,14 @@ def finish_plotting(save): print("Error '%s' saving chart to '%s'" % (e, filename)) plt.show() +def cli(): + parser = argparse.ArgumentParser(description="") + parser.add_argument('report', help='Path to channel data filename [InsertChart.json]', nargs='?', + default='output/InsetChart.json') + parser.add_argument('-c', '--channels', help='channel[s] to display [SEIRW]', nargs='?', default='SEIRW', action='append', dest='channels', metavar='channel') + parser.add_argument('-t', '--title', help='Chart Title', type=str) + parser.add_argument('-s', '--save', help='save to filename', type=str) + return parser def main(filename, title, channels, save): json_data = loadJsonFromFile(filename) @@ -83,22 +90,17 @@ def main(filename, title, channels, save): if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument('filename', help='channel data filename [InsertChart.json]', nargs='?', default='InsetChart.json') - parser.add_argument('-c', '--channels', help='channel[s] to display [SEIRW]', nargs='?', default='SEIRW', type=str) - parser.add_argument('-t', '--title', help='Chart Title', type=str) - parser.add_argument('-s', '--save', help='save to filename', type=str) + parser = cli() args = parser.parse_args() try: - channels = processChannels(args.channels) - - print("Plotting '%s'" % (args.filename)) + print("Plotting '%s'" % (args.report)) print("Displaying channels '%s'" %(args.channels)) print("Chart Title = '%s'" % (args.title)) print("Save filename = '%s'" % (args.save)) + channels = processChannels(args.channels) - main(args.filename, args.title, channels, args.save) + main(args.report, args.title, channels, args.save) except (PlottingError) as pe: print(pe) except (Exception) as e: diff --git a/bin/plotTBHIVART.py b/bin/plotTBHIVART.py index 95f6f3f..494f070 100644 --- a/bin/plotTBHIVART.py +++ b/bin/plotTBHIVART.py @@ -1,67 +1,70 @@ #!/usr/bin/env python -import json -import os -import shutil -import sys +import argparse +import matplotlib.pyplot as plt import pandas as pd -import numpy as np import seaborn as sns -import matplotlib.pyplot as plt - -if sys.argv[1] == '0': - strdir = 'NoART' -elif sys.argv[1] == '1': - strdir = 'ART' - -df = pd.read_csv( strdir + '/output/Report_TBHIV_ByAge.csv', parse_dates= False, index_col='Year', skipinitialspace=True) - -df.rename(columns = lambda y: y.strip()) - -df.reset_index(inplace=True, drop=False) -colvals = list(df.columns.values) -if ' NodeID' in colvals: - a = 1 -df.reset_index() -df.set_index(['Year', 'NodeID', 'AgeBin'], inplace=True) -df_sum = df.groupby(['Year','NodeID']).sum() -df_sum.reset_index(inplace=True) -df.reset_index(inplace=True) -sns.tsplot(df_sum, unit = 'NodeID',time='Year', interpolate=True, value='Active', color='blue') -plt.ylabel('Number with Active TB') -plt.title( strdir, fontsize = 12 ) -plt.show() +def main(report, title): + fontsize = 12 + df = pd.read_csv(report, parse_dates=False, index_col='Year', + skipinitialspace=True) -sns.tsplot(df_sum, unit = 'NodeID',time='Year', interpolate=True, value='Incidence', color='blue') -plt.ylabel('Number of Incident Cases Active Symptomatic TB') -plt.title( strdir, fontsize = 12 ) -plt.show() + df.rename(columns=lambda y: y.strip()) -sns.tsplot(df_sum, unit = 'NodeID', time='Year', interpolate=True, value='HIV', color='blue') -plt.ylabel('Number HIV Positive') -plt.title( strdir, fontsize = 12 ) -plt.show() + df.reset_index(inplace=True, drop=False) + colvals = list(df.columns.values) + if ' NodeID' in colvals: + a = 1 + df.reset_index() + df.set_index(['Year', 'NodeID', 'AgeBin'], inplace=True) + df_sum = df.groupby(['Year', 'NodeID']).sum() -sns.tsplot(df_sum, unit = 'NodeID', time='Year', interpolate=True, value='ART', color='blue') -plt.ylabel('Number on ART') -plt.title( strdir, fontsize = 12 ) -plt.show() + df_sum.reset_index(inplace=True) + df.reset_index(inplace=True) -sns.tsplot(df, unit = 'NodeID', condition= 'AgeBin', time='Year', interpolate=True, value='Incidence', legend=True, err_style= 'unit_traces') -plt.legend(loc= 'upper left', borderaxespad=0, ncol=2) -plt.title( strdir, fontsize = 12 ) -plt.show() + sum_plots = ( + dict( + ylabel="Number with Active TB", + value='Active', + ), + dict( + ylabel='Number of Incident Cases Active Symptomatic TB', + value='Incidence' + ), + dict( + ylabel='Number HIV Positive', + value='HIV' + ), + dict( + ylabel='Number on ART', + value='ART' + ) + ) + for sum_plot in sum_plots: + sns.tsplot(df_sum, value=sum_plot['value'], unit='NodeID', time='Year', interpolate=True, color='blue') + plt.ylabel(sum_plot['ylabel']) + plt.title(title, fontsize=fontsize) + plt.show() -sns.tsplot(df, unit = 'NodeID', condition= 'AgeBin', time='Year', interpolate=True, value='TBTestPreDOTS', legend=True, err_style= 'unit_traces') -plt.legend(loc='upper left', borderaxespad=0, ncol=2) -plt.title( strdir, fontsize = 12 ) -plt.show() + bin_plots = ('Incidence', 'TBTestPreDOTS', 'Active') + for value in bin_plots: + sns.tsplot(df, value=value, unit='NodeID', condition='AgeBin', time='Year', interpolate=True, legend=True, + err_style='unit_traces') + plt.legend(loc='upper left', borderaxespad=0, ncol=2) + plt.title(title, fontsize=fontsize) + plt.show() -sns.tsplot(df, unit = 'NodeID', condition = 'AgeBin', time = 'Year', interpolate=True, value = 'Active', legend=True, err_style = 'unit_traces') -plt.legend(loc='upper left', borderaxespad=0, ncol=2) -plt.title( strdir, fontsize = 12 ) -plt.show() +def cli(): + parser = argparse.ArgumentParser(description="Plot ART or NoART scenarios", add_help=True) + parser.add_argument('-t','--title', help="Plot window title", type=str) + parser.add_argument('report', default="output/Report_TBHIV_ByAge.csv", + help="Relative or absolute path to the custom 'TBHIV by Age' report.") + return parser +if __name__ == '__main__': + parser = cli() + args = parser.parse_args() + main(args.report, args.title) \ No newline at end of file diff --git a/bin/plotTbResults_Progression_Baseline.py b/bin/plotTbResults_Progression_Baseline.py index f5fb89b..bd92162 100644 --- a/bin/plotTbResults_Progression_Baseline.py +++ b/bin/plotTbResults_Progression_Baseline.py @@ -1,19 +1,17 @@ #!/usr/bin/env python -from __future__ import division #allows you to do non-integer (ie floating point) division -from builtins import zip -from builtins import range +from __future__ import division # allows you to do non-integer (ie floating point) division + import argparse import json -import matplotlib.pyplot as plt -import numpy -import os -import subprocess +from builtins import range +from builtins import zip + from matplotlib.backends.backend_pdf import PdfPages from pylab import * -def plot_SEIR(filename, figurename): +def main(filename, figurename): with open(filename, 'r') as handle: baseline_output_data = json.load( handle ) @@ -77,13 +75,16 @@ def plot_SEIR(filename, figurename): pass +def cli(): + parser = argparse.ArgumentParser(description="Plot ") + parser.add_argument('report', help='Path to the report file (JSON)') + parser.add_argument('-s', '--save', help='Output file path for the saved chart') + return parser if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('filename', help='Inset chart filename') - parser.add_argument('-s', '--save', help='Filename to save chart') + parser = cli() args = parser.parse_args() - plot_SEIR(args.filename, args.save) + main(args.report, args.save) pass diff --git a/bin/plotTbResults_Progression_Comparison.py b/bin/plotTbResults_Progression_Comparison.py index b3e683d..85bf16c 100644 --- a/bin/plotTbResults_Progression_Comparison.py +++ b/bin/plotTbResults_Progression_Comparison.py @@ -1,14 +1,13 @@ #!/usr/bin/env python -from __future__ import division #allows you to do non-integer (ie floating point) division +from __future__ import division # allows you to do non-integer (ie floating point) division from __future__ import print_function -from builtins import range + import argparse import json -import matplotlib.pyplot as plt +from builtins import range + import numpy -import os -import subprocess from matplotlib.backends.backend_pdf import PdfPages from pylab import * @@ -77,13 +76,16 @@ def compareBaselineToNew(comparison_filename, baseline_filename, channels, save_ plt.show() pass - -if __name__ == '__main__': +def cli(): parser = argparse.ArgumentParser() - parser.add_argument('baseline', help='Baseline inset chart filename') - parser.add_argument('compare', help='Comparison inset chart filename') + parser.add_argument('-b','--baseline', help='Path to baseline report') + parser.add_argument('-C','--compare', help='Path to compare report') parser.add_argument('-c', '--channel', default=[], action='append', help='Channel(s) to display') - parser.add_argument('-s', '--save', help='Filename for saving figure(s)') + parser.add_argument('-s', '--save', help='Path to a directory for saving figure(s)') + return parser + +if __name__ == '__main__': + parser = cli() args = parser.parse_args() print("Comparing '{0}' against '{1}'".format(args.compare, args.baseline)) print("Saving figures to '{0}'".format(args.save) if args.save else "Not saving figures to file.") diff --git a/command.ps1 b/command.ps1 new file mode 100644 index 0000000..e5367a5 --- /dev/null +++ b/command.ps1 @@ -0,0 +1,4 @@ + +function PsScriptBaseName(){ + return (Split-Path -LeafBase $MyInvocation.PSCommandPath) +} \ No newline at end of file diff --git a/prog.py b/prog.py new file mode 100644 index 0000000..5f16d31 --- /dev/null +++ b/prog.py @@ -0,0 +1,3 @@ +import sys +if __name__ == '__main__': + print(sys.argv) \ No newline at end of file diff --git a/scenario.ps1 b/scenario.ps1 new file mode 100644 index 0000000..d208b57 --- /dev/null +++ b/scenario.ps1 @@ -0,0 +1,41 @@ +Push-Location $PSScriptRoot + +$scenarios = (Get-ChildItem -Force -Recurse -Filter "config.json" | Split-Path -Parent) +$config_file = ".scenario" + +$log = (Join-Path $PSScriptRoot 'scripts.log') + +$contents = (Get-Content -Path $log) +$data = @{ } +foreach ($line in $contents){ + $parts = $line -split ';' + $file = $parts[0] + $dir = (Split-Path -Path $file -Parent) + $filename = (Split-Path -Path $file -LeafBase) + $inputdata = @{ + "script" = "$filename.py" + "commandline" = $parts[1]; + } + if ($data.ContainsKey($dir)) { + $data[$dir].Add($filename, $inputdata) + } else { + $data.Add($dir, @{ + "$filename" = $inputdata + }) + } +} + +foreach ($scenario in $data.Keys){ + $title_file = (Join-Path $scenario "title.txt") + $title = (Get-Content -Path $title_file) -join "" + $data[$scenario].Add('plotAllCharts', @{ + "script" = "plotAllCharts.py"; + "title" = $title; + "report" = "output/InsetChart.json" + }) + + $outfile = (Join-Path $scenario $config_file) + ConvertTo-Json -InputObject $data[$scenario] | Out-File -FilePath $outfile -Encoding utf8 +} + +Write-Host "Done!" \ No newline at end of file diff --git a/scripts.log b/scripts.log new file mode 100644 index 0000000..c7f9ff3 --- /dev/null +++ b/scripts.log @@ -0,0 +1,60 @@ +Scenarios/Generic/DensityScaling/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c I -t "Density Scaling" output/InsetChart.json +Scenarios/Generic/HINT_AgeAndAccess/A_BaselineOutbreak/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py output/PropertyReport.json +Scenarios/Generic/HINT_AgeAndAccess/B_AgeTargetedVaccine/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py output/PropertyReport.json +Scenarios/Generic/HINT_AgeAndAccess/C_AccessTargetedVaccine/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py output/PropertyReport.json +Scenarios/Generic/HINT_SeattleCommuting/plotPropertyReport.bat;python ../../../bin/plotPropertyReport.py output/PropertyReport.json -m +Scenarios/Generic/SEIR/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c SEIR -t "Generic SEIR" output/InsetChart.json +Scenarios/Generic/SEIRS/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c SEIRW -t "SEIRS" output/InsetChart.json +Scenarios/Generic/SEIR_VitalDynamics/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c SEIR -t "Generic SEIR with vital dynamics" output/InsetChart.json +Scenarios/Generic/SI/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c SI -t "SI" output/InsetChart.json +Scenarios/Generic/SIR/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c SIR -t "SIR" output/InsetChart.json +Scenarios/Generic/SIRS/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c SIRW -t "SIRS" output/InsetChart.json +Scenarios/Generic/SIS/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c SI -t "SIS" output/InsetChart.json +Scenarios/Generic/Vaccinations/A_BaselineOutbreak/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -n output/PropertyReport.json +Scenarios/Generic/Vaccinations/A_BaselineOutbreak/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SIR -t "Vaccinations - Baseline" output/InsetChart.json +Scenarios/Generic/Vaccinations/B_Vaccinations/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -n output/PropertyReport.json +Scenarios/Generic/Vaccinations/B_Vaccinations/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SIR -t "Vaccinations - Vaccination All" output/InsetChart.json +Scenarios/Generic/Vaccinations/C_TargetedVaccinations/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -n output/PropertyReport.json +Scenarios/Generic/Vaccinations/C_TargetedVaccinations/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SIR -t "Vaccinations - Easy Targeted" output/InsetChart.json +Scenarios/Generic/Zoonosis/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c SEIRW -t "Zoonosis" output/InsetChart.json +Scenarios/HIV/Health_care/ART_Eligibility/plotEvents.bat;python ../../../../bin/plotEventRecorder.py output/ReportEventRecorder.csv +Scenarios/HIV/Health_care/plotBinnedChart.bat;python ../../../bin/plotBinnedPopulation.py -c "Infected" output/BinnedReport.json +Scenarios/HIV/Health_care/plotHIVSummary.bat;python ../../../bin/plotHIVSummary_15_49.py output/ReportHIVByAgeAndGender.csv +Scenarios/HIV/Health_care/Restricting_Multiple_Entries/plotEvents.bat;python ../../../../bin/plotEventRecorder.py output/ReportEventRecorder.csv +Scenarios/HIV/HIV-specific_biology/plotBinnedChart.bat;python ../../../bin/plotBinnedPopulation.py -c "Infected" output/BinnedReport.json +Scenarios/HIV/HIV-specific_biology/plotHIVSummary.bat;python ../../../bin/plotHIVSummary_15_49.py output/ReportHIVByAgeAndGender.csv +Scenarios/HIV/Transmission/plotHIVSummary.bat;python ../../../bin/plotHIVSummary_15_49.py output/ReportHIVByAgeAndGender.csv +Scenarios/HIV/Transmission/plotSIRChannels.bat;python ../../../bin/plotSIRChannels.py -c I -t "HIV Transmission" output/InsetChart.json +Scenarios/TB/Age_Immunity/Lifelong/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py output/PropertyReportTB.json +Scenarios/TB/Age_Immunity/Lifelong/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Lifelong age-dependent immunity" output/InsetChart.json +Scenarios/TB/Age_Immunity/Vaccines/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py output/PropertyReportTB.json +Scenarios/TB/Age_Immunity/Vaccines/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Vaccination and age-dependent immunity" output/InsetChart.json +Scenarios/TB/Age_Immunity/Waning/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py output/PropertyReportTB.json +Scenarios/TB/Age_Immunity/Waning/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Waning age-dependent immunity" output/InsetChart.json +Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -c "Active TB Infections" -c "Infected" -c "Active Smearpos TB Infections" -c "Statistical Population" -g InterventionStatus output/PropertyReportTB.json +Scenarios/TB/Cascade_Of_Care/Active_Case_Finding/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Active case finding" output/InsetChart.json +Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -c "Active TB Infections" -c "Infected" -c "Active Smearpos TB Infections" -c "Statistical Population" -g InterventionStatus output/PropertyReportTB.json +Scenarios/TB/Cascade_Of_Care/Passive_Case_Finding/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Passive case finding" output/InsetChart.json +Scenarios/TB/Disease_Progression/Active_presentation/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Active disease presentation" output/InsetChart.json +Scenarios/TB/Disease_Progression/Latency_progression/compareScenarios.bat;python ../../../../bin/plotTbResults_Progression_Comparison.py -b ../SEIR/output/InsetChart.json -C output/InsetChart.json -c "Latent TB Prevalence" -c "Active Presymptomatic Prevalence" -c "Active Symptomatic Prevalence" -c "Active Sx Smear pos Prevalence" -c "Active Sx Smear neg Prevalence" -c "Active Sx Extrapulm Prevalence" -c "Latent TB Prevalence" -c "Latent Fast TB Prevalence" -c "Latent Slow TB Prevalence" +Scenarios/TB/Disease_Progression/Latency_progression/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Latency progression" output/InsetChart.json +Scenarios/TB/Disease_Progression/SEIR/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "TB as SEIR" output/InsetChart.json +Scenarios/TB/Health_Systems/MultipleSystems/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -c "Active TB Infections" -c "Statistical Population" -c "Infected" output/PropertyReportTB.json +Scenarios/TB/Health_Systems/MultipleSystems/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Public and private health systems" output/InsetChart.json +Scenarios/TB/Health_Systems/NoneToPublic/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -c "Active TB Infections" -c "Statistical Population" -c "Infected" output/PropertyReportTB.json +Scenarios/TB/Health_Systems/NoneToPublic/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Move individuals with no health care to the public system" output/InsetChart.json +Scenarios/TB/Health_Systems/PrivateToPublic/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -c "Active TB Infections" -c "Statistical Population" -c "Infected" output/PropertyReportTB.json +Scenarios/TB/Health_Systems/PrivateToPublic/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Move individuals in the private system to public" output/InsetChart.json +Scenarios/TB/Health_Systems/SystemImprovement/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py -c "Active TB Infections:QualityOfCare:None" -c "Active TB Infections:QualityOfCare:Private" -c "Active TB Infections:QualityOfCare:Public" -c "Statistical Population:QualityOfCare:None" -c "Statistical Population:QualityOfCare:Private" -c "Statistical Population:QualityOfCare:Public" -c "Infected:QualityOfCare:None" -c "Infected:QualityOfCare:Private" -c "Infected:QualityOfCare:Public" output/PropertyReportTB.json +Scenarios/TB/Health_Systems/SystemImprovement/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Improve quality in the private system" output/InsetChart.json +Scenarios/TB/HIV_Coinfection/ART/plotTBHIVART.bat;python ../../../bin/plotTBHIVART.py --title="ART" output/Report_TBHIV_ByAge.csv +Scenarios/TB/HIV_Coinfection/ART/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "ART for HIV Coinfection" output/InsetChart.json +Scenarios/TB/HIV_Coinfection/NoART/plotTBHIVART.bat;python ../../../bin/plotTBHIVART.py --title="NoART" output/Report_TBHIV_ByAge.csv +Scenarios/TB/HIV_Coinfection/NoART/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "No ART for HIV Coinfection" output/InsetChart.json +Scenarios/TB/MDR-TB/Effective_Treatment/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Second line treatment" output/InsetChart.json +Scenarios/TB/MDR-TB/Ineffective_Treatment/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Ineffective treatment" output/InsetChart.json +Scenarios/TB/Population_BurnIn/Private_To_Public/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Private to public health care" output/InsetChart.json +Scenarios/TB/Population_BurnIn/Steady_State/plotSIRChannels.bat;python ../../../../bin/plotSIRChannels.py -c SEIR -t "Steady state" output/InsetChart.json +Scenarios/Typhoid/EnvironmentalDiagnostic/plotPropertyReport.bat;python ../../../bin/plotPropertyReport.py output/PropertyReportEnvironmental.json +Scenarios/Typhoid/Multi-Route_HINT/A_Baseline_MR-HINT/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py output/PropertyReportEnvironmental.json +Scenarios/Typhoid/Multi-Route_HINT/B_DownTheRiver_MR-HINT/plotPropertyReport.bat;python ../../../../bin/plotPropertyReport.py output/PropertyReportEnvironmental.json diff --git a/scripts/helpers.ps1 b/scripts/helpers.ps1 index 7303098..c3526c4 100644 --- a/scripts/helpers.ps1 +++ b/scripts/helpers.ps1 @@ -1,11 +1,27 @@ +Set-Variable -Name IsWindows -Value ($env:OS -eq "Windows_NT") -ErrorAction SilentlyContinue + $PROJECT_ROOT = (Join-Path $PSScriptRoot ".." -Resolve) $SCENARIOS_ROOT = (Join-Path $PROJECT_ROOT "Scenarios" -Resolve) $INPUT_ROOT = (Join-Path $PROJECT_ROOT "Demographics_Files" -Resolve) $DLL_ROOT = (Join-Path $PROJECT_ROOT "dll" -Resolve) $BIN_ROOT = (Join-Path $PROJECT_ROOT "bin" -Resolve) -$EMOD_EXE = (Join-Path $BIN_ROOT "Eradication") -Set-Variable -Name IsWindows -Value ($env:OS -eq "Windows_NT") -ErrorAction SilentlyContinue +$EMOD = (Join-Path $BIN_ROOT "Eradication") +if ($IsWindows) { + $EMOD = (Join-Path $BIN_ROOT "Eradication.exe") +} + +$PLOT = @{ +} + + +function PSScriptBaseName(){ + return (Split-Path -LeafBase $MyInvocation.PSCommandPath) +} + +function LoadScenarioConfig($namespace){ + $scenario = (Get-Content -Path ".scenario" | ConvertFrom-Json ) +} . (Join-Path $PROJECT_ROOT "console.ps1") Pop-Location \ No newline at end of file diff --git a/scripts/template.plotAllCharts.ps1 b/scripts/template.plotAllCharts.ps1 index a5c5bb3..1592629 100644 --- a/scripts/template.plotAllCharts.ps1 +++ b/scripts/template.plotAllCharts.ps1 @@ -2,7 +2,10 @@ Push-Location -Path $PSScriptRoot . {helpers_script} -$chart = (Join-Path "output" "InsetChart.json") -$pyscript = (Join-Path "$BIN_ROOT" "plotAllCharts.py") -$pytitle = "{title}" -& python $pyscript $chart "$pytitle" +Push-Location -Path $PSScriptRoot + +$sc = (Get-Content -Path ".scenario" | ConvertFrom-Json -AsHashtable) +$key = (Split-Path $MyInvocation.MyCommand.Name -LeafBase) +$config = $sc[$key] +$pyscript = (Join-Path "$BIN_ROOT" $config.script) +& python $pyscript --title="$($config.title)" $config.report diff --git a/scripts/template.runEmod.ps1 b/scripts/template.runEmod.ps1 index 10cbff7..59c6bc1 100644 --- a/scripts/template.runEmod.ps1 +++ b/scripts/template.runEmod.ps1 @@ -1,3 +1,9 @@ Push-Location -Path $PSScriptRoot -& {emod} -C config.json -I {input} -D {dll} -O output + +. {helpers_script} + +Push-Location -Path $PSScriptRoot +$emod = Resolve-Path -Relative -Path (Join-Path $BIN_ROOT "Eradication") + +& $emod --config="config.json" --input-path="$INPUT_ROOT" --dll-path="$DLL_ROOT" --output-path="output" Pop-Location \ No newline at end of file diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..37e7727 --- /dev/null +++ b/tasks.py @@ -0,0 +1,73 @@ +import sysconfig +import os +import sys +import glob +from pathlib import Path +from invoke import task, Responder + +def targets(start): + found = glob.glob(f"{start}/**/config.json", recursive=True) + return [os.path.dirname(file) for file in found] + +# Paths +project_root = Path(os.path.realpath(os.path.dirname(__file__))) +bin_root = project_root.joinpath('bin').resolve() +dll_root = project_root.joinpath('dll').resolve() +input_root = project_root.joinpath('Demographics_Files').resolve() +scenarios_root = project_root.joinpath('Scenarios').resolve() + +# Change working directories +os.chdir(project_root) + +# Add the bin/ folder to the path +sys.path.insert(0, bin_root) + +# Find all scenario folders (criteria: has a config.json file) +scenarios = targets(scenarios_root) + +@task +def emod(c): + """ + Run Eradication for all scenarios in the 'Scenarios' folder + """ + cont = input(f"Run all {len(scenarios)} scenarios? (y/n) ").lower() == 'y' + if (cont): + + emod_app = bin_root.joinpath('Eradication').resolve() + if(sys.platform == 'win32'): + emod_app = bin_root.joinpath('Eradication.exe').resolve() + command = f"{emod_app} -C config.json -I '{input_root}' -O output -D '{dll_root}'" + + for scenario in scenarios: + os.chdir(scenario) + c.run(command) + + os.chdir(project_root) + pass + +@task +def clean(c): + """ + Remove all execution artifacts in the 'Demographics_Files' and 'Scenarios' folders. + """ + c.run("git clean -ffdx Scenarios Demographics_Files") + pass + +@task +def purge(c): + """ + Remove ALL artifacts created by builds, RStudio, other IDEs, etc. + """ + c.run("git clean -ffdx") + pass + +@task +def list(c): + """ + List all scenarios + """ + cont = input(f"Show all {len(scenarios)} scenarios? (y/n) ").lower() == 'y' + if (cont): + for scenario in scenarios: + print(f" {scenario}") + diff --git a/test.ps1 b/test.ps1 new file mode 100644 index 0000000..9cff224 --- /dev/null +++ b/test.ps1 @@ -0,0 +1,9 @@ +Set-Location -Path $PSScriptRoot + +Write-Host "For test.ps1:" +Write-Output -InputObject "`tMyInvocation.PSCommandPath: $($MyInvocation.PSCommandPath)" +Write-Output -InputObject "`tPSCommandPath: $PSCommandPath" + +. "./command.ps1" +"From test.ps1 using function from command.ps1:" +PsScriptBaseName \ No newline at end of file