IAMconsortium / common-definitions

Repository for definitions and mappings in model comparison projects
Creative Commons Zero v1.0 Universal
9 stars 18 forks source link

Question on how template will be made available to modellers #24

Closed orichters closed 2 weeks ago

orichters commented 10 months ago

For REMIND-MAgPIE to prepare a submission, we need to read the template into R. We currently use this function that can read xlsx files but also yaml files such as:

- Final Energy:
    unit: EJ/yr

But: It does not yet understand things such as:

- Emissions|{Tier-1 Species}:
-     unit: "{Tier-1 Species}"

How will the template be made available to modellers, such that we can prepare? Thanks!

danielhuppmann commented 10 months ago

Thank you for raising this issue. My preferred approach would be to use the R package reticulate to read and process the yaml files, and then convert to a suitable R object. Does that sound acceptable?

orichters commented 10 months ago

Yes, as long as we somehow get an R object containing the full variable names out of it, we should be able to convert it into something our scripts understands.

FlorianLeblancDr commented 4 months ago

Hi Oliver, Daniel, Do you know any equivalent of reticulate for python?

I am not sure the question was fully answered: wether each teams should use an appropriate script to convert the .yaml file to a full variable list, Or if it is here on github that the community (we) should provide automatic conversion of the .yaml full (i-e, expanding the Tag on variables).

danielhuppmann commented 4 months ago

Hi Florian, thank you for the reminder.

I wanted to write a tutorial for it with reticulate, just never got to it.

And @phackstock and I discussed usability for non-programmers: we are planning to create a full xlsx spreadsheet of all variables and regions including attributes, etc. for each Scenario Explorer instance and also for common-definitions. Just need a bit more time to implement it...

danielhuppmann commented 3 months ago

We now implemented a feature where the lists of variables and regions will be made available as an xlsx spreadsheet at https://files.ece.iiasa.ac.at/common-definitions/project-template.xlsx (and will be updated automatically to be in sync with the repository). The link to the file is already added to the Readme of this repository.

@orichters, is that sufficient for you?

orichters commented 3 months ago

Yes, that is perfect! loadIIASATemplate happily read the file and we can figure out how we automate the download.

orichters commented 3 months ago

Will the min, max specification, summation rules etc. also be exported?

danielhuppmann commented 3 months ago

Yes, all attributes in the yaml are included as columns. We still need to come up with conventions on attribute-names for min/max-attributes, but that’s a different discussion…

orichters commented 3 months ago

Thanks, excellent!

orichters commented 2 months ago

There is another small issue: The expansion of the tags does not work yet in the components field:

image

danielhuppmann commented 2 months ago

Yes, it's on the to-do list: https://github.com/IAMconsortium/nomenclature/issues/342