IAMconsortium / common-definitions

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

Add sanity checks for variables? #51

Open orichters opened 4 months ago

orichters commented 4 months ago

Dear @danielhuppmann,

I wonder whether it is planned or advisable to add some "sanity checks" for variables:

- Consumption:
    description: total consumption of all goods, by all consumers in a region
    unit: billion US$2010/yr
    min: 0
- Consumption Share|Food:
    description: share of consumption allocated to food
    unit: %
    min: 0
    max: 100

There were such attempts in CDLINKS and I think that would be really useful (and could in the future also be checked in the submission process):

danielhuppmann commented 4 months ago

Yes, and pyam v2.1 added a validate() method that will be able to directly use attributes as in your suggestion. Just need some free time on our hands to implement it in nomenclature, and come up with a good syntax for the yaml files: shares should always be between 0 and 100, but global CO2 emissions should be between 35000 and 45000 Mt only in 2020 (but not apply the validation to other years).