esgvoc 0.2.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of esgvoc might be problematic. Click here for more details.
- {esgvoc-0.2.1 → esgvoc-0.3.0}/.github/workflows/docs.yml +2 -2
- esgvoc-0.3.0/.pre-commit-config.yaml +24 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/PKG-INFO +34 -3
- {esgvoc-0.2.1 → esgvoc-0.3.0}/README.md +32 -0
- esgvoc-0.3.0/docs/source/_static/API_Valid_Term.png +0 -0
- esgvoc-0.3.0/docs/source/_static/API_Valid_all_project.png +0 -0
- esgvoc-0.3.0/docs/source/_static/API_Valid_collection.png +0 -0
- esgvoc-0.3.0/docs/source/_static/API_Valid_project.png +0 -0
- esgvoc-0.3.0/docs/source/_static/API_drsgen_frombag.png +0 -0
- esgvoc-0.3.0/docs/source/_static/API_drsgen_map.png +0 -0
- esgvoc-0.3.0/docs/source/_static/API_drsvalid_one.png +0 -0
- esgvoc-0.3.0/docs/source/_static/CLI_Valid_all_project.png +0 -0
- esgvoc-0.3.0/docs/source/_static/CLI_Valid_collection.png +0 -0
- esgvoc-0.3.0/docs/source/_static/CLI_Valid_project.png +0 -0
- esgvoc-0.3.0/docs/source/_static/CLI_Valid_term.png +0 -0
- esgvoc-0.3.0/docs/source/_static/CLI_drsgen_frombag.png +0 -0
- esgvoc-0.3.0/docs/source/_static/CLI_drsvalid_one.png +0 -0
- esgvoc-0.3.0/docs/source/_static/Jup_one_term.png +0 -0
- esgvoc-0.3.0/docs/source/_static/Jup_one_term_from_one_CV.png +0 -0
- esgvoc-0.3.0/docs/source/_static/Jup_terms_from_one_collection.png +0 -0
- esgvoc-0.3.0/docs/source/_static/Jup_terms_from_one_dd.png +0 -0
- esgvoc-0.3.0/docs/source/_static/all_collection.png +0 -0
- esgvoc-0.3.0/docs/source/_static/all_term_from_one_collection.png +0 -0
- esgvoc-0.3.0/docs/source/_static/install.png +0 -0
- esgvoc-0.3.0/docs/source/_static/one_term.png +0 -0
- esgvoc-0.3.0/docs/source/_static/one_term_from_one_cv.png +0 -0
- esgvoc-0.3.0/docs/source/_static/status_after_install.png +0 -0
- esgvoc-0.3.0/docs/source/_static/status_before_install.png +0 -0
- esgvoc-0.3.0/docs/source/api_documentation/data_descriptors.md +21 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/api_documentation/drs.md +2 -2
- esgvoc-0.3.0/docs/source/api_documentation/projects.md +36 -0
- esgvoc-0.3.0/docs/source/api_documentation/universe.md +9 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/guides/basics_drs.ipynb +32 -32
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/guides/basics_esgvoc.ipynb +51 -43
- esgvoc-0.3.0/docs/source/how_to/generate_drs.rst +88 -0
- esgvoc-0.3.0/docs/source/how_to/get.rst +110 -0
- esgvoc-0.3.0/docs/source/how_to/valid.rst +127 -0
- esgvoc-0.3.0/docs/source/how_to/validate_drs.rst +45 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/index.md +10 -7
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/user/api.md +1 -2
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/user/introduction.md +19 -16
- esgvoc-0.3.0/docs/source/user/terms.md +35 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/pyproject.toml +10 -4
- esgvoc-0.3.0/src/esgvoc/__init__.py +3 -0
- esgvoc-0.3.0/src/esgvoc/api/__init__.py +62 -0
- esgvoc-0.3.0/src/esgvoc/api/_utils.py +53 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/api/data_descriptors/__init__.py +18 -12
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/activity.py +14 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/area_label.py +6 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/branded_suffix.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/branded_variable.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/consortium.py +26 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/data_descriptor.py +106 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/date.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/directory_date.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/experiment.py +25 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/forcing_index.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/frequency.py +8 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/grid_label.py +8 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/horizontal_label.py +6 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/initialisation_index.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/institution.py +15 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/license.py +7 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/mip_era.py +8 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/model_component.py +9 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/organisation.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/physic_index.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/product.py +6 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/realisation_index.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/realm.py +6 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/resolution.py +8 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/source.py +22 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/source_type.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/sub_experiment.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/table.py +8 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/temporal_label.py +6 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/time_range.py +4 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/variable.py +19 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/variant_label.py +5 -0
- esgvoc-0.3.0/src/esgvoc/api/data_descriptors/vertical_label.py +5 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/api/projects.py +187 -171
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/api/report.py +21 -12
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/api/search.py +3 -1
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/api/universe.py +44 -34
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/apps/__init__.py +3 -4
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/apps/drs/generator.py +166 -161
- esgvoc-0.3.0/src/esgvoc/apps/drs/report.py +492 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/apps/drs/validator.py +103 -105
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/cli/drs.py +29 -19
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/cli/get.py +26 -25
- esgvoc-0.3.0/src/esgvoc/cli/install.py +17 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/cli/main.py +0 -2
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/cli/status.py +5 -5
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/cli/valid.py +40 -40
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/db/models/universe.py +3 -3
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/db/project_ingestion.py +1 -1
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/db/universe_ingestion.py +6 -5
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/logging_handler.py +1 -1
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/repo_fetcher.py +4 -3
- esgvoc-0.3.0/src/esgvoc/core/service/__init__.py +40 -0
- esgvoc-0.3.0/src/esgvoc/core/service/configuration/config_manager.py +188 -0
- esgvoc-0.3.0/src/esgvoc/core/service/configuration/setting.py +88 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/service/state.py +49 -32
- esgvoc-0.3.0/tests/Dockerfile +13 -0
- esgvoc-0.3.0/tests/integration/test_scenario_basic.py +34 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/test_api_project.py +5 -10
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/test_api_universe.py +1 -1
- esgvoc-0.3.0/tests/test_cli_config.py +108 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/test_cli_drs.py +1 -1
- esgvoc-0.3.0/tests/test_config.py +54 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/test_data_handler.py +5 -3
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/test_data_merger.py +8 -4
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/test_drs_generator.py +45 -41
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/test_drs_validator.py +47 -54
- esgvoc-0.2.1/docs/source/api_documentation/projects.md +0 -62
- esgvoc-0.2.1/docs/source/api_documentation/universe.md +0 -28
- esgvoc-0.2.1/docs/source/guides/basic_cli.md +0 -47
- esgvoc-0.2.1/docs/source/guides/get_started.md +0 -22
- esgvoc-0.2.1/docs/source/how_to/get.md +0 -29
- esgvoc-0.2.1/docs/source/how_to/validate_drs.md +0 -2
- esgvoc-0.2.1/docs/source/how_to/validate_drs_name.md +0 -0
- esgvoc-0.2.1/docs/source/user/terms.md +0 -33
- esgvoc-0.2.1/src/esgvoc/__init__.py +0 -1
- esgvoc-0.2.1/src/esgvoc/api/__init__.py +0 -73
- esgvoc-0.2.1/src/esgvoc/api/_utils.py +0 -39
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/activity.py +0 -51
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/consortium.py +0 -66
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/date.py +0 -48
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/directory_date.py +0 -48
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/experiment.py +0 -60
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/forcing_index.py +0 -47
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/frequency.py +0 -45
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/grid_label.py +0 -46
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/initialisation_index.py +0 -46
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/institution.py +0 -58
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/license.py +0 -47
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/mip_era.py +0 -46
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/model_component.py +0 -47
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/organisation.py +0 -42
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/physic_index.py +0 -47
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/product.py +0 -45
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/realisation_index.py +0 -46
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/realm.py +0 -44
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/resolution.py +0 -46
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/source.py +0 -57
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/source_type.py +0 -43
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/sub_experiment.py +0 -43
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/table.py +0 -50
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/time_range.py +0 -28
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/variable.py +0 -77
- esgvoc-0.2.1/src/esgvoc/api/data_descriptors/variant_label.py +0 -49
- esgvoc-0.2.1/src/esgvoc/apps/drs/report.py +0 -401
- esgvoc-0.2.1/src/esgvoc/cli/config.py +0 -82
- esgvoc-0.2.1/src/esgvoc/cli/install.py +0 -14
- esgvoc-0.2.1/src/esgvoc/core/service/__init__.py +0 -8
- esgvoc-0.2.1/src/esgvoc/core/service/settings.py +0 -73
- esgvoc-0.2.1/src/esgvoc/core/service/settings.toml +0 -17
- esgvoc-0.2.1/src/esgvoc/core/service/settings_default.toml +0 -17
- esgvoc-0.2.1/tests/test_state.py +0 -105
- {esgvoc-0.2.1 → esgvoc-0.3.0}/.github/workflows/pypi-publish.yml +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/.gitignore +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/LICENSE.txt +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/Makefile +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/build.sh +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/api_documentation/project_specs.md +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/conf.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/guides/status_install.png +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/user/cached_database.md +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/docs/source/user/cli.md +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/api/project_specs.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/apps/drs/__init__.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/apps/drs/constants.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/constants.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/convert.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/data_handler.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/db/__init__.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/db/connection.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/db/models/mixins.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/db/models/project.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/logging.conf +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/service/data_merger.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/src/esgvoc/core/service/esg_voc.py +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/cli_input_drsgen.txt +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/cli_input_drsvalid.txt +0 -0
- {esgvoc-0.2.1 → esgvoc-0.3.0}/tests/test_repo_fetcher.py +0 -0
|
@@ -3,7 +3,7 @@ name: documentation
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
|
-
-
|
|
6
|
+
- documentation
|
|
7
7
|
paths:
|
|
8
8
|
- docs/**
|
|
9
9
|
- src/**
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
|
|
29
29
|
- name: deploy
|
|
30
30
|
uses: peaceiris/actions-gh-pages@v3
|
|
31
|
-
if: ${{ github.ref == 'refs/heads/
|
|
31
|
+
if: ${{ github.ref == 'refs/heads/documentation' }}
|
|
32
32
|
with:
|
|
33
33
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
34
34
|
publish_dir: ./docs/build/html
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: python3
|
|
3
|
+
|
|
4
|
+
repos:
|
|
5
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
6
|
+
rev: v4.5.0
|
|
7
|
+
hooks:
|
|
8
|
+
- id: trailing-whitespace
|
|
9
|
+
exclude: '(setup.cfg|.svg)'
|
|
10
|
+
- id: end-of-file-fixer
|
|
11
|
+
- id: check-toml
|
|
12
|
+
- id: debug-statements
|
|
13
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
14
|
+
# Ruff version.
|
|
15
|
+
rev: v0.9.4
|
|
16
|
+
hooks:
|
|
17
|
+
# Run the linter.
|
|
18
|
+
- id: ruff
|
|
19
|
+
language_version: python3
|
|
20
|
+
args: [ --fix, --exit-non-zero-on-fix, --show-fixes ]
|
|
21
|
+
- repo: https://github.com/PyCQA/isort
|
|
22
|
+
rev: 5.13.2
|
|
23
|
+
hooks:
|
|
24
|
+
- id: isort
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: esgvoc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: python library and CLI to interact with WCRP CVs
|
|
5
5
|
Project-URL: Repository, https://github.com/ESGF/esgf-vocab
|
|
6
6
|
Author-email: Sébastien Gardoll <sebastien@gardoll.fr>, Guillaume Levavasseur <guillaume.levavasseur@ipsl.fr>, Laurent Troussellier <laurent.troussellier@ipsl.fr>
|
|
7
7
|
License: CECILL-2.1
|
|
8
8
|
Requires-Python: <3.13,>=3.12
|
|
9
9
|
Requires-Dist: idna>=3.10
|
|
10
|
+
Requires-Dist: platformdirs>=4.3.6
|
|
10
11
|
Requires-Dist: pydantic>=2.9.2
|
|
11
12
|
Requires-Dist: pyld>=2.0.4
|
|
12
13
|
Requires-Dist: requests>=2.32.3
|
|
13
|
-
Requires-Dist: sphinx-copybutton>=0.5.2
|
|
14
|
-
Requires-Dist: sphinx-tabs>=3.4.7
|
|
15
14
|
Requires-Dist: sqlalchemy>=2.0.36
|
|
16
15
|
Requires-Dist: sqlmodel>=0.0.22
|
|
17
16
|
Requires-Dist: toml>=0.10.2
|
|
@@ -56,3 +55,35 @@ Following this command to install or update the latest CVs.
|
|
|
56
55
|
```bash
|
|
57
56
|
esgvoc install
|
|
58
57
|
```
|
|
58
|
+
|
|
59
|
+
## How to contribute
|
|
60
|
+
|
|
61
|
+
### Install Python dev environment
|
|
62
|
+
|
|
63
|
+
* Pip
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pip install -e .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
* Rye
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
rye sync
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Linters & code formatters
|
|
76
|
+
|
|
77
|
+
* Pip
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install pre-commit
|
|
81
|
+
pre-commit install
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
* Rye
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
rye install
|
|
88
|
+
rye run pre-commit install
|
|
89
|
+
```
|
|
@@ -36,3 +36,35 @@ Following this command to install or update the latest CVs.
|
|
|
36
36
|
```bash
|
|
37
37
|
esgvoc install
|
|
38
38
|
```
|
|
39
|
+
|
|
40
|
+
## How to contribute
|
|
41
|
+
|
|
42
|
+
### Install Python dev environment
|
|
43
|
+
|
|
44
|
+
* Pip
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install -e .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
* Rye
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
rye sync
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Linters & code formatters
|
|
57
|
+
|
|
58
|
+
* Pip
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install pre-commit
|
|
62
|
+
pre-commit install
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
* Rye
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
rye install
|
|
69
|
+
rye run pre-commit install
|
|
70
|
+
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Data descriptors
|
|
2
|
+
|
|
3
|
+
## Data descriptors
|
|
4
|
+
|
|
5
|
+
```{eval-rst}
|
|
6
|
+
.. automodule:: esgvoc.api.data_descriptors
|
|
7
|
+
:members:
|
|
8
|
+
:exclude-members: DataDescriptor
|
|
9
|
+
:inherited-members: BaseModel
|
|
10
|
+
:imported-members:
|
|
11
|
+
:member-order: groupwise
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Generic classes
|
|
15
|
+
|
|
16
|
+
```{eval-rst}
|
|
17
|
+
.. automodule:: esgvoc.api.data_descriptors.data_descriptor
|
|
18
|
+
:members:
|
|
19
|
+
:inherited-members: BaseModel
|
|
20
|
+
:member-order: groupwise
|
|
21
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Projects
|
|
2
|
+
|
|
3
|
+
## Get, find and validation functions
|
|
4
|
+
|
|
5
|
+
```{eval-rst}
|
|
6
|
+
.. note::
|
|
7
|
+
Values are validated against the DRS name of the terms of the projects whereas find functions are based on the id of the terms.
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```{eval-rst}
|
|
11
|
+
.. automodule:: esgvoc.api.projects
|
|
12
|
+
:members:
|
|
13
|
+
:member-order: groupwise
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Validation reporting
|
|
17
|
+
|
|
18
|
+
```{eval-rst}
|
|
19
|
+
.. automodule:: esgvoc.api.report
|
|
20
|
+
:members:
|
|
21
|
+
:inherited-members: BaseModel
|
|
22
|
+
:member-order: groupwise
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Search settings
|
|
26
|
+
|
|
27
|
+
```{eval-rst}
|
|
28
|
+
.. automodule:: esgvoc.api.search
|
|
29
|
+
:members:
|
|
30
|
+
:member-order: groupwise
|
|
31
|
+
```
|
|
32
|
+
```{eval-rst}
|
|
33
|
+
.. autoclass:: esgvoc.core.db.models.mixins.TermKind
|
|
34
|
+
:members:
|
|
35
|
+
:member-order: groupwise
|
|
36
|
+
```
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
{
|
|
255
255
|
"data": {
|
|
256
256
|
"text/plain": [
|
|
257
|
-
"[missing
|
|
257
|
+
"[missing term for time_range at position 7]"
|
|
258
258
|
]
|
|
259
259
|
},
|
|
260
260
|
"execution_count": 8,
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
"id": "b9886b6b-baf1-444f-891f-766fafc911ca",
|
|
272
272
|
"metadata": {},
|
|
273
273
|
"source": [
|
|
274
|
-
"The validator supports a wild range issues, such as blank
|
|
274
|
+
"The validator supports a wild range issues, such as blank term:"
|
|
275
275
|
]
|
|
276
276
|
},
|
|
277
277
|
{
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
"output_type": "stream",
|
|
286
286
|
"text": [
|
|
287
287
|
"'CMIP6Plus/CMIP/ /NCC/MIROC6/amip/r2i2p1f2/ACmon/od550aer/gn/v20190923' has 1 error(s) and 0 warning(s)\n",
|
|
288
|
-
"report.errors=[blank
|
|
288
|
+
"report.errors=[blank term at column 16]\n"
|
|
289
289
|
]
|
|
290
290
|
}
|
|
291
291
|
],
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
"id": "76ff0c16",
|
|
302
302
|
"metadata": {},
|
|
303
303
|
"source": [
|
|
304
|
-
"Extra
|
|
304
|
+
"Extra terms at the end of the expression or separator stuttering:"
|
|
305
305
|
]
|
|
306
306
|
},
|
|
307
307
|
{
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
"output_type": "stream",
|
|
320
320
|
"text": [
|
|
321
321
|
"'CMIP6Plus.CMIP.IPSL.MIROC6.amip..r2i2p1f2.ACmon.od550aer.gn.some_thing' has 2 error(s) and 0 warning(s)\n",
|
|
322
|
-
"report.errors=[extra separator(s) at column 33, extra
|
|
322
|
+
"report.errors=[extra separator(s) at column 33, extra term some_thing at position 9]\n"
|
|
323
323
|
]
|
|
324
324
|
}
|
|
325
325
|
],
|
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
"output_type": "stream",
|
|
354
354
|
"text": [
|
|
355
355
|
"'CMIP6Plus/CMIP_ERROR_HERE/NCC/MIROC6/amip/r2i2p1f2/ACmon/od550aer/gn/v20190923' has 1 error(s) and 0 warning(s)\n",
|
|
356
|
-
"report.errors=[
|
|
356
|
+
"report.errors=[term 'CMIP_ERROR_HERE' not compliant with activity_id at position 2]\n"
|
|
357
357
|
]
|
|
358
358
|
}
|
|
359
359
|
],
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
"id": "3643f5ee-a11b-4bbb-a2b8-fd55ddfee003",
|
|
370
370
|
"metadata": {},
|
|
371
371
|
"source": [
|
|
372
|
-
"The validation issues can be processed by implementing a [
|
|
372
|
+
"The validation issues can be processed by implementing a [parsing issue visitor](https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.ParsingIssueVisitor) and a [compliance issue visitor](https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.ComplianceIssueVisitor):"
|
|
373
373
|
]
|
|
374
374
|
},
|
|
375
375
|
{
|
|
@@ -382,17 +382,17 @@
|
|
|
382
382
|
"name": "stdout",
|
|
383
383
|
"output_type": "stream",
|
|
384
384
|
"text": [
|
|
385
|
-
"Doing something automatically with a invalid
|
|
385
|
+
"Doing something automatically with a invalid term issue, rather then printing it\n"
|
|
386
386
|
]
|
|
387
387
|
}
|
|
388
388
|
],
|
|
389
389
|
"source": [
|
|
390
390
|
"class MyValidationVisitor:\n",
|
|
391
|
-
" def
|
|
392
|
-
" print('Doing something automatically with a invalid
|
|
391
|
+
" def visit_invalid_term_issue(self, issue):\n",
|
|
392
|
+
" print('Doing something automatically with a invalid term issue, ' +\n",
|
|
393
393
|
" 'rather then printing it')\n",
|
|
394
|
-
" # You should implement the other methods of
|
|
395
|
-
" #
|
|
394
|
+
" # You should implement the other methods of ParsingIssueVisitor and \n",
|
|
395
|
+
" # ComplianceIssueVisitor too!\n",
|
|
396
396
|
" # Read https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.ValidationIssueVisitor\n",
|
|
397
397
|
"\n",
|
|
398
398
|
"my_visitor = MyValidationVisitor()\n",
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
"id": "d7e4c7ab-8578-4153-8fe8-e049f0febeaa",
|
|
413
413
|
"metadata": {},
|
|
414
414
|
"source": [
|
|
415
|
-
"The DRS generation consists of generate a DRS expression from an unordered mapping of collections and
|
|
415
|
+
"The DRS generation consists of generate a DRS expression from an unordered mapping of collections and terms or a bag of unordered terms."
|
|
416
416
|
]
|
|
417
417
|
},
|
|
418
418
|
{
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
"id": "c2455012-e8ce-44c7-9bee-19ffc4fe480f",
|
|
481
481
|
"metadata": {},
|
|
482
482
|
"source": [
|
|
483
|
-
"Build a dictionary that maps
|
|
483
|
+
"Build a dictionary that maps terms with their collections:"
|
|
484
484
|
]
|
|
485
485
|
},
|
|
486
486
|
{
|
|
@@ -590,7 +590,7 @@
|
|
|
590
590
|
"id": "0d8a263d-0e3e-483a-9a1b-9b8c8e7c5b94",
|
|
591
591
|
"metadata": {},
|
|
592
592
|
"source": [
|
|
593
|
-
"As for the DRS validation, the generator returns a report that you can display or visit (
|
|
593
|
+
"As for the DRS validation, the generator returns a report that you can display or visit (generation report [class](https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.DrsGenerationReport), generator visitor [specifications](https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.GeneratorIssueVisitor)):"
|
|
594
594
|
]
|
|
595
595
|
},
|
|
596
596
|
{
|
|
@@ -603,7 +603,7 @@
|
|
|
603
603
|
"name": "stdout",
|
|
604
604
|
"output_type": "stream",
|
|
605
605
|
"text": [
|
|
606
|
-
"report.warnings=[missing
|
|
606
|
+
"report.warnings=[missing term for time_range at position 7]\n"
|
|
607
607
|
]
|
|
608
608
|
}
|
|
609
609
|
],
|
|
@@ -622,14 +622,14 @@
|
|
|
622
622
|
"name": "stdout",
|
|
623
623
|
"output_type": "stream",
|
|
624
624
|
"text": [
|
|
625
|
-
"Doing something automatically with a missing
|
|
625
|
+
"Doing something automatically with a missing term issue, rather then printing it\n"
|
|
626
626
|
]
|
|
627
627
|
}
|
|
628
628
|
],
|
|
629
629
|
"source": [
|
|
630
630
|
"class MyGeneratorVisitor:\n",
|
|
631
|
-
" def
|
|
632
|
-
" print('Doing something automatically with a missing
|
|
631
|
+
" def visit_missing_term_issue(self, issue):\n",
|
|
632
|
+
" print('Doing something automatically with a missing term issue, ' +\n",
|
|
633
633
|
" 'rather then printing it')\n",
|
|
634
634
|
" # You should implement the other methods of GeneratorIssueVisitor too!\n",
|
|
635
635
|
" # Read https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.GeneratorIssueVisitor\n",
|
|
@@ -690,8 +690,8 @@
|
|
|
690
690
|
"output_type": "stream",
|
|
691
691
|
"text": [
|
|
692
692
|
"'od550aer_ACmon_[INVALID]_amip_[MISSING]_gn.nc' has 2 error(s) and 1 warning(s)\n",
|
|
693
|
-
"report.errors=[
|
|
694
|
-
"report.warnings=[missing
|
|
693
|
+
"report.errors=[term 'MiRoC6' not compliant with source_id at position 3, missing term for member_id at position 5]\n",
|
|
694
|
+
"report.warnings=[missing term for time_range at position 7]\n"
|
|
695
695
|
]
|
|
696
696
|
}
|
|
697
697
|
],
|
|
@@ -711,8 +711,8 @@
|
|
|
711
711
|
"id": "e9c97077",
|
|
712
712
|
"metadata": {},
|
|
713
713
|
"source": [
|
|
714
|
-
"### Bag of
|
|
715
|
-
"The bag of
|
|
714
|
+
"### Bag of terms\n",
|
|
715
|
+
"The bag of terms methods consist of generating a DRS expression from a set of unordered terms. The generator try to build a mapping between the collections of the DRS specification target and the given terms, then it generates an expression."
|
|
716
716
|
]
|
|
717
717
|
},
|
|
718
718
|
{
|
|
@@ -729,7 +729,7 @@
|
|
|
729
729
|
"name": "stdout",
|
|
730
730
|
"output_type": "stream",
|
|
731
731
|
"text": [
|
|
732
|
-
"
|
|
732
|
+
"bag_of_terms=['r2i2p1f2', 'CMIP', 'MIROC6', 'CMIP6Plus', 'amip', 'od550aer', 'ACmon', 'gn', 'v20190923', 'IPSL', 'some_value']\n"
|
|
733
733
|
]
|
|
734
734
|
},
|
|
735
735
|
{
|
|
@@ -744,9 +744,9 @@
|
|
|
744
744
|
}
|
|
745
745
|
],
|
|
746
746
|
"source": [
|
|
747
|
-
"
|
|
748
|
-
"print(f'{
|
|
749
|
-
"generator.
|
|
747
|
+
"bag_of_terms = list(mapping.values())\n",
|
|
748
|
+
"print(f'{bag_of_terms=}')\n",
|
|
749
|
+
"generator.generate_from_bag_of_terms(terms=bag_of_terms, drs_type='dataset_id')"
|
|
750
750
|
]
|
|
751
751
|
},
|
|
752
752
|
{
|
|
@@ -754,7 +754,7 @@
|
|
|
754
754
|
"id": "aeff5174",
|
|
755
755
|
"metadata": {},
|
|
756
756
|
"source": [
|
|
757
|
-
"Due to the lack of precision of some
|
|
757
|
+
"Due to the lack of precision of some pattern terms, some terms can fit to more than one collection or fit the same collection. The generator supports these cases and try to untangle terms and collections as it is possible to be. Warnings are raised if the generator makes unobvious assignments. But most of the time, the generator will raise errors. **So the mapping methods should always be preferred**."
|
|
758
758
|
]
|
|
759
759
|
},
|
|
760
760
|
{
|
|
@@ -768,7 +768,7 @@
|
|
|
768
768
|
"output_type": "stream",
|
|
769
769
|
"text": [
|
|
770
770
|
"'CMIP6Plus.CMIP.[MISSING].MIROC6.amip.r2i2p1f2.ACmon.od550aer.gn' has 2 error(s) and 0 warning(s)\n",
|
|
771
|
-
"report.errors=[collection institution_id has more than one
|
|
771
|
+
"report.errors=[collection institution_id has more than one term (IPSL, UA), missing term for institution_id at position 3]\n"
|
|
772
772
|
]
|
|
773
773
|
}
|
|
774
774
|
],
|
|
@@ -777,9 +777,9 @@
|
|
|
777
777
|
"# This leads to two kinds of error:\n",
|
|
778
778
|
"# - The collection institution_id has more than one choice.\n",
|
|
779
779
|
"# - As the generator cannot choose, UA and IPSL are withdrawn,\n",
|
|
780
|
-
"# hence the missing
|
|
781
|
-
"
|
|
782
|
-
"report = generator.
|
|
780
|
+
"# hence the missing term error.\n",
|
|
781
|
+
"bag_of_terms.append('UA')\n",
|
|
782
|
+
"report = generator.generate_from_bag_of_terms(terms=bag_of_terms,\n",
|
|
783
783
|
" drs_type='dataset_id')\n",
|
|
784
784
|
"print(report)\n",
|
|
785
785
|
"print(f'{report.errors=}')"
|