I added in the following line to writePolicyScheduleExcelFile which is only run during runGUIlessSetup and mirrors the GUI 'Update EUROMOD Policy Schedule' process:
It means that even if the 'EUROMODpolicySchedule.xlsx' file is missing (as in previous versions, though I now see it's back in), the GUI-less run reads what input files are available in 'EUROMODoutput' folder and matches them by country/year and re-creates the spreadsheet from scratch. Downside is that even if a policy schedule file exists it just over-writes it and assumes all the files in the input folder match exactly by date.
Ideally, if running a headless setup and not able to visually match up policy files to years, the user should be able to specify them in a pre-customised 'EUROMODpolicySchedule.xlsx' file (like in the normal run where the database is not re-built and user can choose to 'Keep existing policy schedule').
Options for tweaking this I think are:
Test if the file exists and then not over-write it (although this would fail current tests on its own if a non-compatible policy schedule file existed)
Take a further CLI argument to 'use existing policy schedule' which skips the creation stage and returns error if a policy schedule file is missing (or is invalid - containing references to missing policy files).
Before attempting a fix, wanted to sense check this to see if I'm understanding best ways of running/using SimPaths and specifying EUROMOD files? Thanks for insights @pbronka @justin-ven!
I added in the following line to
writePolicyScheduleExcelFile
which is only run duringrunGUIlessSetup
and mirrors the GUI 'Update EUROMOD Policy Schedule' process:https://github.com/centreformicrosimulation/SimPaths/blob/441a4db25c5da23d899711819c62af31b340f7e3/src/main/java/simpaths/experiment/SimPathsStart.java#L219-L220
Running:
https://github.com/centreformicrosimulation/SimPaths/blob/441a4db25c5da23d899711819c62af31b340f7e3/src/main/java/simpaths/experiment/SimPathsStart.java#L258-L269
It means that even if the 'EUROMODpolicySchedule.xlsx' file is missing (as in previous versions, though I now see it's back in), the GUI-less run reads what input files are available in 'EUROMODoutput' folder and matches them by country/year and re-creates the spreadsheet from scratch. Downside is that even if a policy schedule file exists it just over-writes it and assumes all the files in the input folder match exactly by date.
Ideally, if running a headless setup and not able to visually match up policy files to years, the user should be able to specify them in a pre-customised 'EUROMODpolicySchedule.xlsx' file (like in the normal run where the database is not re-built and user can choose to 'Keep existing policy schedule').
Options for tweaking this I think are:
Before attempting a fix, wanted to sense check this to see if I'm understanding best ways of running/using SimPaths and specifying EUROMOD files? Thanks for insights @pbronka @justin-ven!