etsap-TIMES / xl2times

Open source tool to convert TIMES models specified in Excel
https://xl2times.readthedocs.io/
MIT License
12 stars 7 forks source link

VEDA Attribute variants possibly not correctly characterized in veda-attr-defaults? #225

Open Antti-L opened 6 months ago

Antti-L commented 6 months ago

The CEFF, CEFFICIENCY, CEFF-I and CEFF-O attributes are VEDA variants of the TIMES ACT_EFF attribute. However, they are not aliases, because CEFF, CEFFICIENCY, CEFF-I and CEFF-O accept only commodities. Other_Indexes should thus be ignored for these attributes (it is ignored under VEDA). On the other hand, ACT_EFF supports any CG, and Other_Indexes does take the highest priority, and so if e.g. both Other_Indexes and CSet_CN are filled in, the CG index is taken from Other_Indexes.

Similarly, the INPUT and OUTPUT attributes are VEDA variants of the TIMES VDA_FLOP attribute. Again, they are not aliases, because INPUT and OUTPUT accept only commodities. Other_Indexes should thus be ignored also for these attributes (it is ignored under VEDA). And here again, VDA_FLOP supports any CG, and Other_Indexes takes the highest priority for the CG index.

Notwithstanding, I can see that in the veda-attr-defaults file, all these attributes seem to be characterized as if they would be supporting the Other_Indexes field/column. I am not sure I am interpreting that correctly, but it looks suspicious to me. If those defaults impliy that a commodity index might be taken from Other_Indexes for CEFF, CEFFICIENCY, CEFF-I, CEFF-O, INPUT or OUTPUT, that would lead to incorrect model input data. @olejandro can you confirm whether this might be the case or not?

olejandro commented 6 months ago

@Antti-L thanks for a great question! I won't go into detail on the ACT_EFF variants yet, because they are pending revision.

Let me for now just explain what the data structure in veda-attr-defaults means. Meanwhile we naturally keep this issue open until all of the concerns are addressed.

Below is an entry for INPUT. times-attribute field identifies it as a variant of VDA_FLOP, while the defaults section indicates how to fill the other_indexes entry which is currently mapped to cg index of VDA_FLOP in times-info.json. As far as I understand your concern is related to a possibility that other_indexes may be not empty and so the defaults field won't be applied. Even though we have not seen this in our benchmarks, this is a vaild issue. At the same, the use of other_indexes in the internal data structures is temporary and will be soon changed to avoid issue, ensuring that the index is always filled correctly.

"INPUT": {
    "defaults": {
      "other_indexes": [
        "commodity",
        "commodity-in",
        "commodity-in-aux"
      ],
      "ts-level": "ANNUAL"
    },
    "times-attribute": "VDA_FLOP"
  }
olejandro commented 6 months ago

After the change the entries will look similar to below:

"INPUT": {
    "defaults": {
      "new_internal_name": [
        "commodity",
        "commodity-in",
        "commodity-in-aux"
      ],
      "ts-level": "ANNUAL"
    },
    "times-attribute": "VDA_FLOP"
  }
"VDA_FLOP": {
    "defaults": {
      "new_internal_name": [
        "other_indexes",
        "commodity",
        "commodity-in",
        "commodity-out",
        "commodity-in-aux",
        "commodity-out-aux"
      ],
      "ts-level": "ANNUAL"
    }
  }
Antti-L commented 6 months ago

As far as I understand your concern is related to a possibility that other_indexes may be not empty and so the defaults field won't be applied.

Exactly. As far as I can tell, that situation could be reasonably common in some models (in my models for sure). Thanks for confirming that it is currently an outstanding issue, and great if you can already say this issue will be resolved.