Closed andrewbaxter439 closed 11 months ago
Hi @pbronka - have tested this out and it should work smoothly to fix my accidentally introduced bug. SimPathsStart
accepts a new command-line argument:
usage: SimPathsStart [-c <CC>] [-s <year>] [-Setup] [-r] [-g <true/false>]
[-h]
SimPathsStart will start the SimPaths run. When using the argument
`Setup`, this will create the population database and exit before starting
the first run. It takes the following options:
...
-r,--rewrite-policy-schedule Re-write policy schedule from detected
policy files
This will mean that it defaults to false - not overwriting the 'EUROMODpolicySchedule.xlsx' file. But I've added a check to see if the file exists and exit with message if both missing and no-rewrite. The rewrite option (-r
) will instead not check for an existing file, will read the contents of 'input/EUROMODoutput' directory and will attempt to automatically match year by filename. The user can thus customise their run by providing either a set of output files with non-overlapping year values in filenames or a pre-set 'EUROMODpolicySchedule.xlsx' file to specify which file/year combinations to use.
This pull request also makes some small additional changes:
calculateEUROMODpolicySchedule
was reading the policy schedule workbook and detecting ""
as a do-not-use-file entry; manually editing xlsx file left a blank which was read in as a null
value which it failed to detect. Have added extra test so that leaving a blank cell is correctly interpreted as 'do not use this file for this year'.singlerun.jar
stage but not returning an error. multirun.jar
then gets stuck in an infinite loop before Actions force-quits after 6 hours. Have added a check for the expected output files of singlerun.jar
to stop this and return 'fail' more quickly if presents a problem.-r
argument to 'README.md'As an aside, I think a potential wiki page could cover "Customising your SimPaths run" to outline best practices for using features to make SimPaths fit user purpose (summarising the above bit clearly and adding in other parts such as customising config file). I'll aim to make a draft at some point.
Thank you @andrewbaxter439 . A wiki page sounds like a great idea to me. I'm not sure if you can currently edit it - if not, please let me know and we will figure it out.
As a brief side point - apologies @pbronka if you get a stream of notification emails every time I do a pull request with a GitHub Actions run that fails! I might start test-pull-requests to my own repo first as they can get quite annoying if they keep crashing!
Closes #44 by adding an option to not rebuild Excel file and exit with error if no file found.