Flexibility to read/write every in/output from anywhere. Groups of in/outputs are decoupled.
The code is more self-explanatory/self-documenting
The CLI describes exactly what goes in and comes out. Documentation of all those dependencies are in one spot.
The following changes were made in scripts 3, 5, and 6
Removed hardcoded paths
Created a command line interface (with argparser) containing an argument for every in- and output file
Documented those in- and outputs based on the description in the Readme file
Removed dependency on where (which directory) the script was run from
The changes retain backwards compatibility in that the same default values are still used when running the scripts without arguments. The in- and output directories can also still be manipulated using the previously used environment variables.
The only place where I had to break this was in script 3, where country, sensitivity_type and sensitivity_survey_count are now named arguments instead of postional ones. So instead of Rscript 03_stock_and_flow.r ERI, you must use Rscript 03_stock_and_flow.r --country ERI. Similarly, --sensitivity_type and --sensitivity_survey_count are used for the other two.
Let me know if you have any concerns. If not, I'll make similar changes to the ITN cube scripts that are run on GCP.
The advantages of these changes are that:
The following changes were made in scripts 3, 5, and 6
The changes retain backwards compatibility in that the same default values are still used when running the scripts without arguments. The in- and output directories can also still be manipulated using the previously used environment variables.
The only place where I had to break this was in script 3, where
country
,sensitivity_type
andsensitivity_survey_count
are now named arguments instead of postional ones. So instead ofRscript 03_stock_and_flow.r ERI
, you must useRscript 03_stock_and_flow.r --country ERI
. Similarly,--sensitivity_type
and--sensitivity_survey_count
are used for the other two.Let me know if you have any concerns. If not, I'll make similar changes to the ITN cube scripts that are run on GCP.