-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Almeida
committed
Feb 3, 2025
1 parent
fcc2d55
commit f247022
Showing
4 changed files
with
62 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.. _validation: | ||
|
||
.. currentmodule:: nomenclature | ||
|
||
Data validation | ||
=============== | ||
|
||
The **nomenclature** package allows users to validate IAMC data in several ways. | ||
|
||
For this, validation requirements and criteria can be specified in YAML configuration | ||
files. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
validation/data-validation | ||
validation/required-data-validation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.. _required-data-validation: | ||
|
||
.. currentmodule:: nomenclature | ||
|
||
Required data validation | ||
======================== | ||
|
||
**Required data validation** checks if certain models, variables, regions and/or | ||
periods of time are covered in the datapoints. | ||
|
||
For this, a configuration file specifies the model(s) and dimension(s) expected | ||
in the dataset. These are ``variable``, ``region`` and/or ``year``. | ||
Alternatively, instead of using ``variable``, it is possible to declare measurands, | ||
which jointly specify variables and units. | ||
|
||
.. code:: yaml | ||
description: Required variables for running MAGICC | ||
model: model_a | ||
required_data: | ||
- measurand: | ||
Emissions|CO2: | ||
unit: Mt CO2/yr | ||
region: World | ||
year: [2020, 2030, 2040, 2050] | ||
In the example above, for *model_a*, the dataset must include datapoints of the | ||
variable *Emissions|CO2* (measured in *Mt CO2/yr*), in the region *World*, for the | ||
years 2020, 2030, 2040 and 2050. | ||
|
||
Standard usage | ||
-------------- | ||
|
||
Run the following in a Python script to check that an IAMC dataset has valid | ||
required data. | ||
|
||
.. code-block:: python | ||
from nomenclature import RequiredDataValidator | ||
# ...setting directory/file paths and loading dataset | ||
RequiredDataValidator.from_file(req_data_yaml).apply(df) |