IAMconsortium / nomenclature

A package to work with IAMC-style variable templates
https://nomenclature-iamc.readthedocs.io/
Apache License 2.0
18 stars 11 forks source link

Remove trailing whitespaces #347

Open phackstock opened 1 month ago

phackstock commented 1 month ago

It might be a good idea to remove training white spaces from the dimensions of model, scenario, variable and unit. The fact that we currently don't do this causes some overhead in fixing these issues that could be fixed automatically.

danielhuppmann commented 1 month ago

Nice idea, and we already do this for codelists...

https://github.com/IAMconsortium/nomenclature/blob/48dc9e1c487deac23ff1c074c6677b61104887a2/nomenclature/codelist.py#L57

Question is whether that should be used on columns that are not explicitly checked as part of DataStructureDefinition.validate().

phackstock commented 1 month ago

Good question, maybe this should be part of pyam anyway. Just as part of the reading in process stripping all the trailing whitespace of all values in all columns. Then we wouldn't need to even think about where to add it. We could just assume that all the values inside a pyam.IamDataFrame are clean.