diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml new file mode 100644 index 0000000..31fd42b --- /dev/null +++ b/.github/workflows/integration.yaml @@ -0,0 +1,30 @@ +# This workflow checks that no conflicts exist with the common-definitions repo + +name: Check consistency with common-definitions + +on: + push: + branches: [ main ] + pull_request: + branches: [ '**' ] + schedule: + - cron: '45 5 * * *' + +jobs: + project-validation: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install requirements + run: pip install nomenclature-iamc pytest + + - name: Run the integration test + run: pytest tests/test_integration.py --rootdir='tests' diff --git a/.gitignore b/.gitignore index 259f1a5..95f691e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ ### common-definitions ### common-definitions + ### IntelliJ PyCharm ### .idea/ diff --git a/definitions/variable/variable.yaml b/definitions/variable/variable.yaml index 0ae2768..56bb2fa 100644 --- a/definitions/variable/variable.yaml +++ b/definitions/variable/variable.yaml @@ -513,12 +513,6 @@ - Consumption: definition: total consumption of all goods, by all consumers in a region unit: billion US$2010/yr -- GDP|MER: - definition: GDP at market exchange rate - unit: billion US$2010/yr -- GDP|PPP: - definition: GDP converted to International $ using purchasing power parity (PPP) - unit: billion US$2010/yr - Value Added|Agriculture: definition: value added of the agricultural sector unit: billion US$2010/yr diff --git a/tests/test_integration.py b/tests/test_integration.py new file mode 100644 index 0000000..6a06fa3 --- /dev/null +++ b/tests/test_integration.py @@ -0,0 +1,29 @@ +import pathlib +import yaml + +import nomenclature + + +def test_integration_common_definitions(): + + config_file = "nomenclature.yaml" + config = { + "repositories": { + "common-definitions": { + "url": "https://github.com/IAMconsortium/common-definitions.git/" + } + }, + "definitions": { + "region": {"repository": "common-definitions"}, + "variable": {"repository": "common-definitions"}, + }, + } + + with open(config_file, "w") as file: + yaml.dump(config, file) + + try: + nomenclature.DataStructureDefinition("definitions") + + finally: + pathlib.Path(config_file).unlink()