otoole
otoole copied to clipboard
TradeRoute not working with otoole
In OSeMOSYS, TradeRoute is defined by the following, with the double defeniton of REGION causing some issues:
param TradeRoute {r in REGION, rr in REGION, f in FUEL, y in YEAR} binary;
For example, updating the REGION.csv to be:
| VALUE |
|---|
| SIMPLICITY |
| DIFFICULTY |
and the TradeRoute.csv to be:
| REGION | REGION | FUEL | YEAR | VALUE |
|---|---|---|---|---|
| SIMPLICITY | DIFFICULTY | FEL1 | 2015 | 1 |
The datafile from otoole convert datapackage datafile ... is
param default 0.0 : TradeRoute :=
SIMPLICITY FEL1 2015 DIFFICULTY 1
Which will throw an error when building the model since DIFFICULTY is not indexed correctly.
osemosys_fast_1.0.1.txt:378: TradeRoute[SIMPLICITY,FEL1,2015,DIFFICULTY] out of domain
MathProg model processing error
If I try updating the definition of the datapackage so that its indexed over two regions, I get the error:
ValueError: cannot insert REGION, already exists
I'm not sure if the same behaviour will be seen when working on the results side. But I would probably guess yes :(