Dimensions other than region
and variable
are not read from repositories listed in nomenclature.yaml
#414
Labels
bug
Something isn't working
When creating a new
DataStructureDefinition
object from a path that includes external repositories in anomenclature.yaml
file, only theregion
andvariable
dimensions get read from the repository. If I list, e.g.,model
andscenario
in thedimensions
list in nomenclature.yaml, I get a ValueError with message"Empty codelist: model, scenario"
. Those dimensions are present with valid yaml files in the repository, and are read without any problems if I clone the repository to my computer and read itsdefinitions
folder locally.I have pasted the nomenclature.yaml file at the bottom. It will reproduce the problem if put in a folder with empty
definitions
andmappings
subdirectories, and read withdsd = nomenclature.DataStructureDefinition('./definitions')
.I'm not fluent enough in pydantic to diagnose the problem 100% certainly or know for sure how to fix it, but I think the problem lies in the definition of
config.DataStructureConfig
, which defines thedefinitions
field inconfig.NomenclatureConfig
. The definition looks suspiciously like it only definesregion
andvariable
as valid fields, which I suspect means that the other dimensions underdefinitions
innomenclature.yaml
get discarded. Relevant part of the code here:nomenclature/nomenclature/config.py
Lines 115 to 139 in 829844a
I'd greatly appreciate if someone who is familiar with the pydantic definitions and how they are processed can take a look at this relatively soon. At the moment it's a roadblock for deploying a validation tool in an ongoing project.
Here is the content of the nomenclature.yaml file I used:
The error traceI get is the following:
If I enter debug mode, I get the following content in
self.config.dict()
:In other words, only
variable:
andregion:
have been read from thedefinitions
section of the config file.The text was updated successfully, but these errors were encountered: