Release v0.7
New features
Improved tag replacement logic. Occurrences of {tag}
inside a code object are now replaced with the tag name if the tag in question does not feature the attribute in question.
For further details please see https://nomenclature-iamc.readthedocs.io/en/stable/user_guide/codelist.html#the-tag-feature.
Breaking changes
The CodeList
classes now contain dictionaries mapping the name of a code to a Code
object. Previously instead of the Code
object, a dictionary was used. Therefore attribute access has changed.
As an example, to access the file attribute of a code called "code1", previously we would have used codelist["code1"]["file"]
.
This will no longer work, instead codelist["code1"].file
, has to be used.
In order to make this attribute access work, the allowed names of attributes have been restricted to valid, non-keyword, python identifiers. An attribute called "iso2" is allowed while an attribute called "while" or "2iso" is not. This restriction is enforced using a pydantic validator.
What's Changed
- Codelist/variable subclass by @luciecastella in #174
- Fix RegionAggregationMapping.common_region_names docstring by @phackstock in #178
- Quickfix to make yaml-check less stringent by @danielhuppmann in #179
- Add a
to_csv()
method by @danielhuppmann in #185 - Codelist/region subclass by @luciecastella in #177
- Cleanup RegionCodeList by @phackstock in #187
- Feature/code usage by @phackstock in #188
- Add multi unit support by @phackstock in #197
- Apply tag replacing to named attributes as well by @phackstock in #199
- Change attributes to extra_attributes by @phackstock in #200
- Simplify Code.attributes type hint by @phackstock in #195
- Check names of additional attribute keys by @phackstock in #196
- Improve tag replacement by @phackstock in #201
Full Changelog: v0.6...v0.7