osemosys_global icon indicating copy to clipboard operation
osemosys_global copied to clipboard

[FEATURE]: Get expected otoole data/result files from the config file

Open trevorb1 opened this issue 1 year ago • 0 comments

Idea

Remove the csv files in resources/otoole/data, and just use the otoole config file to extract out the params and results.

Is your feature related to a bug?

No response

Suggested Soltuion

def get_otoole_data(otoole_config: str, var: str) -> list[str]:
    """Gets parameter/result files to be created"""

    assert var in ("param", "result", "set")

    with open(otoole_config) as f:
        otoole = yaml.safe_load(f)

    results = [x for x in otoole if otoole[x]["type"] == var]

    missing = [
        "NewStorageCapacity",
        "NumberOfNewTechnologyUnits",
        "SalvageValueStorage",
        "StorageLevelDayTypeStart",
        "StorageLevelDayTypeFinish",
        "StorageLevelSeasonStart",
        "StorageLevelSeasonFinish",
        "StorageLevelYearStart",
        "StorageLevelYearFinish",
        "Trade",
    ]

    return [x for x in results if x not in missing]

The missing accounts for some bugs with otoole where the result calculations are not implemented

Additional Info

No response

trevorb1 avatar Sep 09 '24 21:09 trevorb1