centreformicrosimulation / SimPaths

SimPaths is an open-source microsimulation framework for life course analysis, developed and maintained by CeMPA at the University of Essex
6 stars 16 forks source link

Check if EUROMODpolicySchedule excel file exists before over-writing? #44

Closed andrewbaxter439 closed 9 months ago

andrewbaxter439 commented 9 months ago

I added in the following line to writePolicyScheduleExcelFile which is only run during runGUIlessSetup 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!