osemosys_global icon indicating copy to clipboard operation
osemosys_global copied to clipboard

Extract setup variables into a single yaml file for all scripts

Open tniet opened this issue 4 years ago • 2 comments

Make things more portable - instead of having to set the years, country selection, etc. in each script, make one over-arching setup file to make these types of changes. All scripts can read in this setup file for the variables they need.

tniet avatar Feb 09 '21 16:02 tniet

Check https://docs.python.org/3/library/configparser.html as an alternative

willu47 avatar Feb 09 '21 19:02 willu47

Suggest making a start on this by exposing all "configurable parameters" as global variables at the top of scripts. For example:

PLEXOS_URL = "https://dataverse.harvard.edu/api/access/datafile/4008393?format=original&gbrecs=true"
INPUT_PATH = "data"
PLEXOS_DATA = os.path.join(INPUT_PATH, "PLEXOS_World_2015_Gold_V1.1.xlsx")
OUTPUT_PATH = os.path.join("osemosys_global_model", "data")

MODE_LIST = [1, 2]

willu47 avatar Feb 22 '21 20:02 willu47

@trevorb1 @tniet I think this is mostly covered by means of the config file? Closing the issue for now, if there are still things that could be done here feel free to re-open.

maartenbrinkerink avatar Sep 02 '24 15:09 maartenbrinkerink