DataStructureDefinition¶
- class nomenclature.DataStructureDefinition(path, dimensions=None)[source]¶
Definition of datastructure codelists for dimensions used in the IAMC format
Methods
check_aggregate
(df, **kwargs)Check for consistency of scenario data along the variable hierarchy
to_excel
(excel_writer, **kwargs)Write the codelists to an xlsx spreadsheet
validate
(df[, dimensions])Validate that the coordinates of df are defined in the codelists
- check_aggregate(df, **kwargs)[source]¶
Check for consistency of scenario data along the variable hierarchy
- Parameters:
- df
pyam.IamDataFrame
Scenario data to be checked for consistency along the variable hierarchy.
- kwargsTolerance arguments for comparison of values
Passed to
numpy.isclose
viapyam.IamDataFrame.check_aggregate
.
- df
- Returns:
pandas.DataFrame
or NoneData where a variable and its computed aggregate does not match.
- Raises:
- ValueError
If the
DataStructureDefinition
does not have a variable dimension.
- to_excel(excel_writer, **kwargs)[source]¶
Write the codelists to an xlsx spreadsheet
- Parameters:
- excel_writerstr or
pathlib.Path
File path as string or
pathlib.Path
.- **kwargs
Passed to
pandas.ExcelWriter
- excel_writerstr or
- validate(df, dimensions=None)[source]¶
Validate that the coordinates of df are defined in the codelists
- Parameters:
- df
pyam.IamDataFrame
Scenario data to be validated against the codelists of this instance.
- dimensionslist of str, optional
Dimensions to perform validation (defaults to all dimensions of self)
- df
- Returns:
- None
- Raises:
- ValueError
If df fails validation against any codelist.