KTH-dESA / esom_gsa

snakemake workflow for performing a global sensitivity analysis of an OSeMOSYS model
MIT License
7 stars 3 forks source link

Modifying the workflow to enable the use of different methods (LHS, Sobol) allowing for scenario discovery applications #13

Open AgnesBelt opened 5 months ago

AgnesBelt commented 5 months ago

Hi @willu47, I have now started trying to modify the workflow to enable the option to choose between different methods for generating the model runs, so that I can opt for LHS or Sobol in case I am interested in doing Scenario Discovery. I am sure there is plenty of mistakes, but I have tried to use the following approach:

  1. Modify the config file to allow for selecting a sampling method different from Morris
  2. Modify the snakemake file to consider the method options and adjust the folder creation structure based on the number of model runs expected with each method.
  3. Create new create_sample.py scripts, one for LHS and one for Sobol, to generate the input data files needed for the runs.
  4. modify the sample.smk file to add if statement for redirecting the create_sample rule to the related script pertaining to the method chosen in the config file.

Would be great to look into it together at our next meeting.

AgnesBelt commented 5 months ago

Thanks to support from @HauHe, @willu47, and @camiloramirezgo, we seem to have now managed to fix the bugs I was encountering and the workflow should now be able to use different sampling methods (Morris, LHS, Sobol) to execute the workflow and produce results.

This should allow for the use of the esom_gsa workflow also in scenario discovery analysis.

Still pending: after having computed all scenarios and generated the results, the workflow proceed to compute some sensitivity analysis and fails to do so when LHS or Sobol are selected as methods. If I am not mistaken, this could be skipped for SD applications with LHS and Sobol methods. So, I might still look into it to clean up the process.

AgnesBelt commented 5 months ago

Current issue still pending: Screenshot 2024-04-17 at 17 39 39

AgnesBelt commented 5 months ago

I have now added also the option to specific a start_year for the interpolation, to allow for changing the start interpolation year to a year in the middle of the modelling period. This is of use for GLUCOSE SD application, but might be also useful for other cases.