esgvoc 0.3.0__tar.gz → 0.4.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.4.0/.flake8 +3 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/.gitignore +1 -0
- esgvoc-0.4.0/.pre-commit-config.yaml +36 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/PKG-INFO +1 -1
- esgvoc-0.4.0/docs/source/_static/Jup_one_term.png +0 -0
- esgvoc-0.4.0/docs/source/_static/Jup_one_term_from_one_CV.png +0 -0
- esgvoc-0.4.0/docs/source/api_documentation/miscellaneous.md +18 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/api_documentation/projects.md +0 -13
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/guides/basics_esgvoc.ipynb +229 -32
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/how_to/get.rst +5 -5
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/index.md +1 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/user/api.md +20 -7
- {esgvoc-0.3.0 → esgvoc-0.4.0}/pyproject.toml +36 -13
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/__init__.py +1 -1
- esgvoc-0.4.0/src/esgvoc/api/__init__.py +97 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/project_specs.py +3 -2
- esgvoc-0.4.0/src/esgvoc/api/projects.py +1165 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/report.py +12 -8
- esgvoc-0.4.0/src/esgvoc/api/search.py +155 -0
- esgvoc-0.4.0/src/esgvoc/api/universe.py +423 -0
- esgvoc-0.4.0/src/esgvoc/apps/drs/constants.py +2 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/apps/drs/generator.py +51 -69
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/apps/drs/report.py +60 -15
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/apps/drs/validator.py +60 -71
- esgvoc-0.4.0/src/esgvoc/apps/py.typed +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/cli/drs.py +3 -2
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/cli/get.py +9 -6
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/constants.py +1 -1
- esgvoc-0.4.0/src/esgvoc/core/convert.py +0 -0
- esgvoc-0.4.0/src/esgvoc/core/db/__init__.py +3 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/db/connection.py +5 -3
- esgvoc-0.4.0/src/esgvoc/core/db/models/project.py +102 -0
- esgvoc-0.4.0/src/esgvoc/core/db/models/universe.py +98 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/db/project_ingestion.py +60 -46
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/db/universe_ingestion.py +55 -27
- esgvoc-0.4.0/src/esgvoc/core/exceptions.py +33 -0
- esgvoc-0.4.0/tests/__init__.py +0 -0
- esgvoc-0.4.0/tests/api_inputs.py +829 -0
- esgvoc-0.4.0/tests/test_api_project.py +192 -0
- esgvoc-0.4.0/tests/test_api_universe.py +76 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/test_cli_drs.py +1 -1
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/test_data_handler.py +1 -1
- esgvoc-0.4.0/tests/test_drs_generator.py +224 -0
- esgvoc-0.4.0/tests/test_drs_validator.py +111 -0
- esgvoc-0.3.0/.pre-commit-config.yaml +0 -24
- 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/src/esgvoc/api/__init__.py +0 -62
- esgvoc-0.3.0/src/esgvoc/api/_utils.py +0 -53
- esgvoc-0.3.0/src/esgvoc/api/projects.py +0 -900
- esgvoc-0.3.0/src/esgvoc/api/search.py +0 -112
- esgvoc-0.3.0/src/esgvoc/api/universe.py +0 -227
- esgvoc-0.3.0/src/esgvoc/apps/drs/constants.py +0 -2
- esgvoc-0.3.0/src/esgvoc/core/db/__init__.py +0 -5
- esgvoc-0.3.0/src/esgvoc/core/db/models/project.py +0 -60
- esgvoc-0.3.0/src/esgvoc/core/db/models/universe.py +0 -59
- esgvoc-0.3.0/tests/test_api_project.py +0 -178
- esgvoc-0.3.0/tests/test_api_universe.py +0 -68
- esgvoc-0.3.0/tests/test_drs_generator.py +0 -294
- esgvoc-0.3.0/tests/test_drs_validator.py +0 -624
- {esgvoc-0.3.0 → esgvoc-0.4.0}/.github/workflows/docs.yml +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/.github/workflows/pypi-publish.yml +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/LICENSE.txt +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/README.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/Makefile +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/build.sh +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/API_Valid_Term.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/API_Valid_all_project.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/API_Valid_collection.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/API_Valid_project.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/API_drsgen_frombag.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/API_drsgen_map.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/API_drsvalid_one.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/CLI_Valid_all_project.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/CLI_Valid_collection.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/CLI_Valid_project.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/CLI_Valid_term.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/CLI_drsgen_frombag.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/CLI_drsvalid_one.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/Jup_terms_from_one_collection.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/Jup_terms_from_one_dd.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/all_collection.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/all_term_from_one_collection.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/install.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/one_term.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/one_term_from_one_cv.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/status_after_install.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/_static/status_before_install.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/api_documentation/data_descriptors.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/api_documentation/drs.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/api_documentation/project_specs.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/api_documentation/universe.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/conf.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/guides/basics_drs.ipynb +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/guides/status_install.png +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/how_to/generate_drs.rst +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/how_to/valid.rst +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/how_to/validate_drs.rst +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/user/cached_database.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/user/cli.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/user/introduction.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/docs/source/user/terms.md +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/__init__.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/activity.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/area_label.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/branded_suffix.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/branded_variable.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/consortium.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/data_descriptor.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/date.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/directory_date.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/experiment.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/forcing_index.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/frequency.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/grid_label.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/horizontal_label.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/initialisation_index.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/institution.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/license.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/mip_era.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/model_component.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/organisation.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/physic_index.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/product.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/realisation_index.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/realm.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/resolution.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/source.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/source_type.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/sub_experiment.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/table.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/temporal_label.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/time_range.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/variable.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/variant_label.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/vertical_label.py +0 -0
- /esgvoc-0.3.0/src/esgvoc/apps/drs/__init__.py → /esgvoc-0.4.0/src/esgvoc/api/py.typed +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/apps/__init__.py +0 -0
- /esgvoc-0.3.0/src/esgvoc/core/convert.py → /esgvoc-0.4.0/src/esgvoc/apps/drs/__init__.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/cli/install.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/cli/main.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/cli/status.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/cli/valid.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/data_handler.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/db/models/mixins.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/logging.conf +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/logging_handler.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/repo_fetcher.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/service/__init__.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/service/configuration/config_manager.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/service/configuration/setting.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/service/data_merger.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/service/esg_voc.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/src/esgvoc/core/service/state.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/Dockerfile +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/cli_input_drsgen.txt +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/cli_input_drsvalid.txt +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/integration/test_scenario_basic.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/test_cli_config.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/test_config.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/test_data_merger.py +0 -0
- {esgvoc-0.3.0 → esgvoc-0.4.0}/tests/test_repo_fetcher.py +0 -0
esgvoc-0.4.0/.flake8
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: python3
|
|
3
|
+
|
|
4
|
+
repos:
|
|
5
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
6
|
+
rev: v5.0.0
|
|
7
|
+
hooks:
|
|
8
|
+
- id: trailing-whitespace
|
|
9
|
+
exclude: '(setup.cfg|.svg|.md)'
|
|
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.11.0
|
|
16
|
+
hooks:
|
|
17
|
+
# Run the linter.
|
|
18
|
+
- id: ruff
|
|
19
|
+
language_version: python3
|
|
20
|
+
args: [ --exit-non-zero-on-fix ]
|
|
21
|
+
# Sort imports.
|
|
22
|
+
- id: ruff
|
|
23
|
+
name: ruff-sort-imports
|
|
24
|
+
args: [--select, I, --fix]
|
|
25
|
+
- repo: local
|
|
26
|
+
hooks:
|
|
27
|
+
- id: wily
|
|
28
|
+
name: wily
|
|
29
|
+
entry: wily diff
|
|
30
|
+
verbose: true
|
|
31
|
+
language: python
|
|
32
|
+
additional_dependencies: [wily]
|
|
33
|
+
- repo: https://github.com/PyCQA/flake8
|
|
34
|
+
rev: 7.1.2
|
|
35
|
+
hooks:
|
|
36
|
+
- id: flake8
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: esgvoc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.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>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Miscellaneous
|
|
2
|
+
|
|
3
|
+
```{eval-rst}
|
|
4
|
+
.. automodule:: esgvoc.api.search
|
|
5
|
+
:members: Item
|
|
6
|
+
:imported-members:
|
|
7
|
+
:member-order: groupwise
|
|
8
|
+
.. autoclass:: esgvoc.api.search.ItemKind
|
|
9
|
+
:members:
|
|
10
|
+
:member-order: groupwise
|
|
11
|
+
.. autoclass:: esgvoc.core.db.models.mixins.TermKind
|
|
12
|
+
:members:
|
|
13
|
+
:member-order: groupwise
|
|
14
|
+
.. automodule:: esgvoc.core.exceptions
|
|
15
|
+
:members:
|
|
16
|
+
:imported-members:
|
|
17
|
+
:member-order: groupwise
|
|
18
|
+
```
|
|
@@ -21,16 +21,3 @@
|
|
|
21
21
|
:inherited-members: BaseModel
|
|
22
22
|
:member-order: groupwise
|
|
23
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
|
-
```
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
{
|
|
10
10
|
"data": {
|
|
11
11
|
"text/plain": [
|
|
12
|
-
"datetime.datetime(2025, 3,
|
|
12
|
+
"datetime.datetime(2025, 3, 21, 11, 3, 21, 470482)"
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
"execution_count": 1,
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"source": [
|
|
21
21
|
"from datetime import datetime\n",
|
|
22
|
+
"\n",
|
|
22
23
|
"datetime.now()"
|
|
23
24
|
]
|
|
24
25
|
},
|
|
@@ -84,8 +85,8 @@
|
|
|
84
85
|
"\n",
|
|
85
86
|
"The API functions are sorted as follows:\n",
|
|
86
87
|
"\n",
|
|
87
|
-
"- **get** functions return a list of something (collections from a project, terms from a collection, etc.)\n",
|
|
88
|
-
"- **find** functions try to find terms corresponding to an
|
|
88
|
+
"- **get** functions return a list of something based on an id (collections from a project, terms from a collection, etc.)\n",
|
|
89
|
+
"- **find** functions try to find terms, data descriptors or collections corresponding to an expression. \n",
|
|
89
90
|
"- **valid** functions check the compliance of an input string to the DRS of terms."
|
|
90
91
|
]
|
|
91
92
|
},
|
|
@@ -142,7 +143,6 @@
|
|
|
142
143
|
" 'vertical_label',\n",
|
|
143
144
|
" 'source',\n",
|
|
144
145
|
" 'date',\n",
|
|
145
|
-
" 'branded_variable',\n",
|
|
146
146
|
" 'model_component',\n",
|
|
147
147
|
" 'product',\n",
|
|
148
148
|
" 'institution',\n",
|
|
@@ -150,7 +150,6 @@
|
|
|
150
150
|
" 'time_range',\n",
|
|
151
151
|
" 'table',\n",
|
|
152
152
|
" 'variant_label',\n",
|
|
153
|
-
" 'branded_suffix',\n",
|
|
154
153
|
" 'organisation',\n",
|
|
155
154
|
" 'experiment',\n",
|
|
156
155
|
" 'area_label',\n",
|
|
@@ -187,7 +186,7 @@
|
|
|
187
186
|
}
|
|
188
187
|
],
|
|
189
188
|
"source": [
|
|
190
|
-
"ev.get_all_terms_in_data_descriptor(data_descriptor_id=\"activity\")[:3]
|
|
189
|
+
"ev.get_all_terms_in_data_descriptor(data_descriptor_id=\"activity\")[:3]\n",
|
|
191
190
|
"# each datadescriptor from the above cell could be use as argument\n",
|
|
192
191
|
"# [:3] just to limit the result with the 3 first one"
|
|
193
192
|
]
|
|
@@ -201,7 +200,7 @@
|
|
|
201
200
|
{
|
|
202
201
|
"data": {
|
|
203
202
|
"text/plain": [
|
|
204
|
-
"
|
|
203
|
+
"Activity(id='aerchemmip', type='activity', drs_name='AerChemMIP', name='AerChemMIP', long_name='Aerosols and Chemistry Model Intercomparison Project', url=None, @context='000_context.jsonld', cmip_acronym='AerChemMIP')"
|
|
205
204
|
]
|
|
206
205
|
},
|
|
207
206
|
"execution_count": 5,
|
|
@@ -210,7 +209,7 @@
|
|
|
210
209
|
}
|
|
211
210
|
],
|
|
212
211
|
"source": [
|
|
213
|
-
"ev.
|
|
212
|
+
"ev.get_term_in_data_descriptor(data_descriptor_id=\"activity\", term_id=\"aerchemmip\")"
|
|
214
213
|
]
|
|
215
214
|
},
|
|
216
215
|
{
|
|
@@ -247,7 +246,7 @@
|
|
|
247
246
|
}
|
|
248
247
|
],
|
|
249
248
|
"source": [
|
|
250
|
-
"my_activity = ev.
|
|
249
|
+
"my_activity = ev.get_term_in_data_descriptor(data_descriptor_id=\"activity\", term_id=\"aerchemmip\")\n",
|
|
251
250
|
"print(my_activity.id)\n",
|
|
252
251
|
"print(my_activity.drs_name)\n",
|
|
253
252
|
"print(my_activity.long_name)\n",
|
|
@@ -263,7 +262,7 @@
|
|
|
263
262
|
{
|
|
264
263
|
"data": {
|
|
265
264
|
"text/plain": [
|
|
266
|
-
"
|
|
265
|
+
"Activity(id='aerchemmip', type='activity', drs_name='AerChemMIP', name='AerChemMIP', long_name='Aerosols and Chemistry Model Intercomparison Project', url=None, @context='000_context.jsonld', cmip_acronym='AerChemMIP')"
|
|
267
266
|
]
|
|
268
267
|
},
|
|
269
268
|
"execution_count": 7,
|
|
@@ -272,7 +271,105 @@
|
|
|
272
271
|
}
|
|
273
272
|
],
|
|
274
273
|
"source": [
|
|
275
|
-
"ev.
|
|
274
|
+
"ev.get_term_in_universe(term_id=\"aerchemmip\") # give the same result as above"
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"cell_type": "markdown",
|
|
279
|
+
"id": "f8cfc8db",
|
|
280
|
+
"metadata": {},
|
|
281
|
+
"source": [
|
|
282
|
+
"### Find terms in universe"
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"cell_type": "markdown",
|
|
287
|
+
"id": "80475d91",
|
|
288
|
+
"metadata": {},
|
|
289
|
+
"source": [
|
|
290
|
+
"The find functions perform full text search (FTS) over terms or data descriptor specs. They accept expressions composed not only of keywords but boolean operators that relate them together. The result is sorted according to the hit rank (bm25): the first term in the list is the better match (index zero)."
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"cell_type": "code",
|
|
295
|
+
"execution_count": 8,
|
|
296
|
+
"id": "c53bbf14",
|
|
297
|
+
"metadata": {},
|
|
298
|
+
"outputs": [
|
|
299
|
+
{
|
|
300
|
+
"data": {
|
|
301
|
+
"text/plain": [
|
|
302
|
+
"[DataDescriptorSubSet(id='ipsl', type='institution', location={'city': 'Paris', 'country': ['France', 'FR'], 'lat': 48.855675, 'lon': 2.332105})]"
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
"execution_count": 8,
|
|
306
|
+
"metadata": {},
|
|
307
|
+
"output_type": "execute_result"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"source": [
|
|
311
|
+
"# The headquarter of the institution IPSL and the CNES are both located in Paris.\n",
|
|
312
|
+
"# We want to find the term which corresponds to the IPSL institution, but not the CNES one:\n",
|
|
313
|
+
"ev.find_terms_in_data_descriptor(expression='pArIs NOT CNES',\n",
|
|
314
|
+
" data_descriptor_id='institution',\n",
|
|
315
|
+
" selected_term_fields=['location'])"
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"cell_type": "code",
|
|
320
|
+
"execution_count": 9,
|
|
321
|
+
"id": "73f624f4",
|
|
322
|
+
"metadata": {},
|
|
323
|
+
"outputs": [
|
|
324
|
+
{
|
|
325
|
+
"data": {
|
|
326
|
+
"text/plain": [
|
|
327
|
+
"[DataDescriptorSubSet(id='ipsl', type='institution', location={'city': 'Paris', 'country': ['France', 'FR'], 'lat': 48.855675, 'lon': 2.332105}),\n",
|
|
328
|
+
" DataDescriptorSubSet(id='institution/ipsl', type='institution', location={'city': 'Paris', 'country': ['France', 'FR'], 'lat': 48.855675, 'lon': 2.332105})]"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
"execution_count": 9,
|
|
332
|
+
"metadata": {},
|
|
333
|
+
"output_type": "execute_result"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"source": [
|
|
337
|
+
"# We can also search in the whole universe, but expect to find many more terms:\n",
|
|
338
|
+
"ev.find_terms_in_universe(expression='pArIs NOT CNES',\n",
|
|
339
|
+
" selected_term_fields=['location'])"
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"cell_type": "markdown",
|
|
344
|
+
"id": "ab8e31bf",
|
|
345
|
+
"metadata": {},
|
|
346
|
+
"source": [
|
|
347
|
+
"### Find terms or data decriptors in universe"
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"cell_type": "code",
|
|
352
|
+
"execution_count": 10,
|
|
353
|
+
"id": "c205dff9",
|
|
354
|
+
"metadata": {},
|
|
355
|
+
"outputs": [
|
|
356
|
+
{
|
|
357
|
+
"data": {
|
|
358
|
+
"text/plain": [
|
|
359
|
+
"[Item(id='daily', kind=<ItemKind.TERM: 'term'>, parent_id='time_range'),\n",
|
|
360
|
+
" Item(id='monthly', kind=<ItemKind.TERM: 'term'>, parent_id='time_range'),\n",
|
|
361
|
+
" Item(id='hourly', kind=<ItemKind.TERM: 'term'>, parent_id='time_range'),\n",
|
|
362
|
+
" Item(id='time_range', kind=<ItemKind.DATA_DESCRIPTOR: 'data_descriptor'>, parent_id='universe')]"
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
"execution_count": 10,
|
|
366
|
+
"metadata": {},
|
|
367
|
+
"output_type": "execute_result"
|
|
368
|
+
}
|
|
369
|
+
],
|
|
370
|
+
"source": [
|
|
371
|
+
"# We want to find the data descriptors time_range and its terms:\n",
|
|
372
|
+
"ev.find_items_in_universe(expression='time_range')"
|
|
276
373
|
]
|
|
277
374
|
},
|
|
278
375
|
{
|
|
@@ -283,9 +380,17 @@
|
|
|
283
380
|
"## Project example: CMIP6plus"
|
|
284
381
|
]
|
|
285
382
|
},
|
|
383
|
+
{
|
|
384
|
+
"cell_type": "markdown",
|
|
385
|
+
"id": "173137f6",
|
|
386
|
+
"metadata": {},
|
|
387
|
+
"source": [
|
|
388
|
+
"The API provides the same functions for the projects (get, find) and adds the validation functions."
|
|
389
|
+
]
|
|
390
|
+
},
|
|
286
391
|
{
|
|
287
392
|
"cell_type": "code",
|
|
288
|
-
"execution_count":
|
|
393
|
+
"execution_count": 11,
|
|
289
394
|
"id": "d12f6c7e-081d-42eb-922f-64e84a999e26",
|
|
290
395
|
"metadata": {},
|
|
291
396
|
"outputs": [
|
|
@@ -295,7 +400,7 @@
|
|
|
295
400
|
"['cmip6', 'cmip6plus']"
|
|
296
401
|
]
|
|
297
402
|
},
|
|
298
|
-
"execution_count":
|
|
403
|
+
"execution_count": 11,
|
|
299
404
|
"metadata": {},
|
|
300
405
|
"output_type": "execute_result"
|
|
301
406
|
}
|
|
@@ -306,7 +411,7 @@
|
|
|
306
411
|
},
|
|
307
412
|
{
|
|
308
413
|
"cell_type": "code",
|
|
309
|
-
"execution_count":
|
|
414
|
+
"execution_count": 12,
|
|
310
415
|
"id": "d92926f3-7494-4219-9f74-eb5dabe5a134",
|
|
311
416
|
"metadata": {},
|
|
312
417
|
"outputs": [
|
|
@@ -326,7 +431,7 @@
|
|
|
326
431
|
" 'variable_id']"
|
|
327
432
|
]
|
|
328
433
|
},
|
|
329
|
-
"execution_count":
|
|
434
|
+
"execution_count": 12,
|
|
330
435
|
"metadata": {},
|
|
331
436
|
"output_type": "execute_result"
|
|
332
437
|
}
|
|
@@ -337,7 +442,7 @@
|
|
|
337
442
|
},
|
|
338
443
|
{
|
|
339
444
|
"cell_type": "code",
|
|
340
|
-
"execution_count":
|
|
445
|
+
"execution_count": 13,
|
|
341
446
|
"id": "8cef4296-b9a6-42a9-8c2b-d52eeda55aa2",
|
|
342
447
|
"metadata": {},
|
|
343
448
|
"outputs": [
|
|
@@ -348,7 +453,7 @@
|
|
|
348
453
|
" Activity(id='lesfmip', type='activity', drs_name='LESFMIP', name='LESFMIP', long_name='The Large Ensemble Single Forcing Model Intercomparison Project', url='https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full', @context='000_context.jsonld', cmip_acronym='LESFMIP')]"
|
|
349
454
|
]
|
|
350
455
|
},
|
|
351
|
-
"execution_count":
|
|
456
|
+
"execution_count": 13,
|
|
352
457
|
"metadata": {},
|
|
353
458
|
"output_type": "execute_result"
|
|
354
459
|
}
|
|
@@ -359,23 +464,115 @@
|
|
|
359
464
|
},
|
|
360
465
|
{
|
|
361
466
|
"cell_type": "code",
|
|
362
|
-
"execution_count":
|
|
467
|
+
"execution_count": 14,
|
|
363
468
|
"id": "f99b6067-e323-4fa9-b423-d64e072ebe31",
|
|
364
469
|
"metadata": {},
|
|
365
470
|
"outputs": [
|
|
366
471
|
{
|
|
367
472
|
"data": {
|
|
368
473
|
"text/plain": [
|
|
369
|
-
"
|
|
474
|
+
"Activity(id='cmip', type='activity', drs_name='CMIP', name='CMIP', long_name='CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments', url='https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf', @context='000_context.jsonld', cmip_acronym='CMIP')"
|
|
370
475
|
]
|
|
371
476
|
},
|
|
372
|
-
"execution_count":
|
|
477
|
+
"execution_count": 14,
|
|
478
|
+
"metadata": {},
|
|
479
|
+
"output_type": "execute_result"
|
|
480
|
+
}
|
|
481
|
+
],
|
|
482
|
+
"source": [
|
|
483
|
+
"ev.get_term_in_collection(project_id=\"cmip6plus\", collection_id=\"activity_id\", term_id=\"cmip\")"
|
|
484
|
+
]
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"cell_type": "markdown",
|
|
488
|
+
"id": "f20b9976",
|
|
489
|
+
"metadata": {},
|
|
490
|
+
"source": [
|
|
491
|
+
"### Find terms in a project"
|
|
492
|
+
]
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"cell_type": "code",
|
|
496
|
+
"execution_count": 15,
|
|
497
|
+
"id": "8bdd8a84",
|
|
498
|
+
"metadata": {},
|
|
499
|
+
"outputs": [
|
|
500
|
+
{
|
|
501
|
+
"data": {
|
|
502
|
+
"text/plain": [
|
|
503
|
+
"[DataDescriptorSubSet(id='miroc6', type='source'),\n",
|
|
504
|
+
" DataDescriptorSubSet(id='miroc', type='organisation')]"
|
|
505
|
+
]
|
|
506
|
+
},
|
|
507
|
+
"execution_count": 15,
|
|
373
508
|
"metadata": {},
|
|
374
509
|
"output_type": "execute_result"
|
|
375
510
|
}
|
|
376
511
|
],
|
|
377
512
|
"source": [
|
|
378
|
-
"
|
|
513
|
+
"# We want to find all the term related to miroc:\n",
|
|
514
|
+
"ev.find_terms_in_project(expression='mir*', project_id='cmip6plus', selected_term_fields=[])"
|
|
515
|
+
]
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"cell_type": "markdown",
|
|
519
|
+
"id": "c386b5a7",
|
|
520
|
+
"metadata": {},
|
|
521
|
+
"source": [
|
|
522
|
+
"### Find terms and collections"
|
|
523
|
+
]
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"cell_type": "code",
|
|
527
|
+
"execution_count": 16,
|
|
528
|
+
"id": "635337a7",
|
|
529
|
+
"metadata": {},
|
|
530
|
+
"outputs": [
|
|
531
|
+
{
|
|
532
|
+
"name": "stdout",
|
|
533
|
+
"output_type": "stream",
|
|
534
|
+
"text": [
|
|
535
|
+
"number of items: 41\n",
|
|
536
|
+
"id='institution_id' kind=<ItemKind.COLLECTION: 'collection'> parent_id='cmip6plus'\n"
|
|
537
|
+
]
|
|
538
|
+
}
|
|
539
|
+
],
|
|
540
|
+
"source": [
|
|
541
|
+
"# We want to find the collection named 'institution_id'\n",
|
|
542
|
+
"items_found = ev.find_items_in_project(expression='instit*', project_id='cmip6plus')\n",
|
|
543
|
+
"print(f'number of items: {len(items_found)}')\n",
|
|
544
|
+
"for item in items_found:\n",
|
|
545
|
+
" if item.kind == 'collection':\n",
|
|
546
|
+
" break\n",
|
|
547
|
+
"print(item)"
|
|
548
|
+
]
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"cell_type": "code",
|
|
552
|
+
"execution_count": 17,
|
|
553
|
+
"id": "fe8ad2ca",
|
|
554
|
+
"metadata": {},
|
|
555
|
+
"outputs": [
|
|
556
|
+
{
|
|
557
|
+
"data": {
|
|
558
|
+
"text/plain": [
|
|
559
|
+
"[('institution_id',\n",
|
|
560
|
+
" {'@context': {'id': '@id',\n",
|
|
561
|
+
" 'type': '@type',\n",
|
|
562
|
+
" '@base': 'https://espri-mod.github.io/mip-cmor-tables/organisation/',\n",
|
|
563
|
+
" 'organisation': 'https://espri-mod.github.io/mip-cmor-tables/organisation',\n",
|
|
564
|
+
" 'myprop': 'http://TEST',\n",
|
|
565
|
+
" 'established': {'@id': 'https://schema.org/foundingDate'}}})]"
|
|
566
|
+
]
|
|
567
|
+
},
|
|
568
|
+
"execution_count": 17,
|
|
569
|
+
"metadata": {},
|
|
570
|
+
"output_type": "execute_result"
|
|
571
|
+
}
|
|
572
|
+
],
|
|
573
|
+
"source": [
|
|
574
|
+
"# But we probably should execute this function:\n",
|
|
575
|
+
"ev.find_collections_in_project(expression='instit*', project_id='cmip6plus')"
|
|
379
576
|
]
|
|
380
577
|
},
|
|
381
578
|
{
|
|
@@ -388,13 +585,13 @@
|
|
|
388
585
|
},
|
|
389
586
|
{
|
|
390
587
|
"cell_type": "code",
|
|
391
|
-
"execution_count":
|
|
588
|
+
"execution_count": 18,
|
|
392
589
|
"id": "79a4d58e-3560-4c8c-aef3-9a1e80e862a4",
|
|
393
590
|
"metadata": {},
|
|
394
591
|
"outputs": [],
|
|
395
592
|
"source": [
|
|
396
593
|
"valid_string = \"IPSL\" # the standard name of the institution : \"Institut Pierre Simon Laplace\"\n",
|
|
397
|
-
"unvalid_string = \"ipsl\" # NOT the DRS name ! but in that case it is the 'id' of the term
|
|
594
|
+
"unvalid_string = \"ipsl\" # NOT the DRS name ! but in that case it is the 'id' of the term"
|
|
398
595
|
]
|
|
399
596
|
},
|
|
400
597
|
{
|
|
@@ -407,7 +604,7 @@
|
|
|
407
604
|
},
|
|
408
605
|
{
|
|
409
606
|
"cell_type": "code",
|
|
410
|
-
"execution_count":
|
|
607
|
+
"execution_count": 19,
|
|
411
608
|
"id": "d67f80f0-ed4e-4c15-9c22-0cf00c2b20be",
|
|
412
609
|
"metadata": {},
|
|
413
610
|
"outputs": [
|
|
@@ -417,7 +614,7 @@
|
|
|
417
614
|
"[MatchingTerm(project_id='cmip6plus', collection_id='institution_id', term_id='ipsl')]"
|
|
418
615
|
]
|
|
419
616
|
},
|
|
420
|
-
"execution_count":
|
|
617
|
+
"execution_count": 19,
|
|
421
618
|
"metadata": {},
|
|
422
619
|
"output_type": "execute_result"
|
|
423
620
|
}
|
|
@@ -428,7 +625,7 @@
|
|
|
428
625
|
},
|
|
429
626
|
{
|
|
430
627
|
"cell_type": "code",
|
|
431
|
-
"execution_count":
|
|
628
|
+
"execution_count": 20,
|
|
432
629
|
"id": "16cdaf0a-17b3-4080-a910-6e590cafb0d0",
|
|
433
630
|
"metadata": {},
|
|
434
631
|
"outputs": [
|
|
@@ -438,7 +635,7 @@
|
|
|
438
635
|
"[]"
|
|
439
636
|
]
|
|
440
637
|
},
|
|
441
|
-
"execution_count":
|
|
638
|
+
"execution_count": 20,
|
|
442
639
|
"metadata": {},
|
|
443
640
|
"output_type": "execute_result"
|
|
444
641
|
}
|
|
@@ -449,7 +646,7 @@
|
|
|
449
646
|
},
|
|
450
647
|
{
|
|
451
648
|
"cell_type": "code",
|
|
452
|
-
"execution_count":
|
|
649
|
+
"execution_count": 21,
|
|
453
650
|
"id": "3c7a93a7-72b2-485b-ad62-9c95ff5098c2",
|
|
454
651
|
"metadata": {},
|
|
455
652
|
"outputs": [
|
|
@@ -470,7 +667,7 @@
|
|
|
470
667
|
},
|
|
471
668
|
{
|
|
472
669
|
"cell_type": "code",
|
|
473
|
-
"execution_count":
|
|
670
|
+
"execution_count": 22,
|
|
474
671
|
"id": "698f1676-036c-4999-91e2-360fe6e3aa2f",
|
|
475
672
|
"metadata": {},
|
|
476
673
|
"outputs": [
|
|
@@ -499,7 +696,7 @@
|
|
|
499
696
|
},
|
|
500
697
|
{
|
|
501
698
|
"cell_type": "code",
|
|
502
|
-
"execution_count":
|
|
699
|
+
"execution_count": 23,
|
|
503
700
|
"id": "44ddebd5-5cfb-4cae-8177-6d58422892c1",
|
|
504
701
|
"metadata": {},
|
|
505
702
|
"outputs": [
|
|
@@ -509,7 +706,7 @@
|
|
|
509
706
|
"[MatchingTerm(project_id='cmip6plus', collection_id='institution_id', term_id='ipsl')]"
|
|
510
707
|
]
|
|
511
708
|
},
|
|
512
|
-
"execution_count":
|
|
709
|
+
"execution_count": 23,
|
|
513
710
|
"metadata": {},
|
|
514
711
|
"output_type": "execute_result"
|
|
515
712
|
}
|
|
@@ -528,7 +725,7 @@
|
|
|
528
725
|
},
|
|
529
726
|
{
|
|
530
727
|
"cell_type": "code",
|
|
531
|
-
"execution_count":
|
|
728
|
+
"execution_count": 24,
|
|
532
729
|
"id": "5b485f84-bb45-49f8-b425-59d848079635",
|
|
533
730
|
"metadata": {},
|
|
534
731
|
"outputs": [
|
|
@@ -27,8 +27,8 @@ One term
|
|
|
27
27
|
|
|
28
28
|
import esgvoc.api as ev
|
|
29
29
|
|
|
30
|
-
ev.
|
|
31
|
-
ev.
|
|
30
|
+
ev.get_term_in_data_descriptor(data_descriptor_id="institution", term_id="ipsl")
|
|
31
|
+
ev.get_term_in_universe(term_id="ipsl") # same result but slower but still fast
|
|
32
32
|
.. image:: ../_static/Jup_one_term.png
|
|
33
33
|
|
|
34
34
|
|
|
@@ -98,9 +98,9 @@ A term from a CV
|
|
|
98
98
|
|
|
99
99
|
import esgvoc.api as ev
|
|
100
100
|
|
|
101
|
-
ev.
|
|
102
|
-
ev.
|
|
103
|
-
ev.
|
|
101
|
+
ev.get_term_in_universe("ipsl")
|
|
102
|
+
ev.get_term_in_project("cmip6", "ipsl")
|
|
103
|
+
ev.get_term_in_project("cmip6plus", "ipsl")
|
|
104
104
|
|
|
105
105
|
.. image:: ../_static/Jup_one_term_from_one_CV.png
|
|
106
106
|
|
|
@@ -9,15 +9,16 @@ The ESGVOC Python API provides a powerful and read-only interface to query contr
|
|
|
9
9
|
The API offers three main types of functions:
|
|
10
10
|
|
|
11
11
|
1. **Retrieve functions (`get_*`)**
|
|
12
|
-
- Fetch collections, terms
|
|
12
|
+
- Fetch collections, terms or data descriptors.
|
|
13
13
|
- Examples:
|
|
14
14
|
- Retrieve all data descriptors in the universe CV.
|
|
15
15
|
- Retrieve all terms within a specific collection or project.
|
|
16
|
+
- Retrieve a collection in a specific project.
|
|
16
17
|
|
|
17
18
|
2. **Search functions (`find_*`)**
|
|
18
|
-
- Search for terms based on
|
|
19
|
+
- Search for terms based on expression (keywords, wildcard * and boolean operators).
|
|
19
20
|
- Examples:
|
|
20
|
-
- Search for
|
|
21
|
+
- Search for terms in a data descriptor.
|
|
21
22
|
- Search for terms within a project or collection.
|
|
22
23
|
|
|
23
24
|
3. **Validation functions (`valid_*`)**
|
|
@@ -36,16 +37,28 @@ import esgvoc.api as ev
|
|
|
36
37
|
# Retrieve Functions
|
|
37
38
|
ev.get_all_data_descriptors_in_universe()
|
|
38
39
|
ev.get_all_terms_in_data_descriptor(data_descriptor_id="activity")
|
|
40
|
+
ev.get_term_in_universe(term_id='ipsl')
|
|
41
|
+
ev.get_term_in_data_descriptor(data_descriptor_id='institution', term_id='ipsl')
|
|
42
|
+
ev.get_data_descriptor_in_universe(data_descriptor_id='variable')
|
|
39
43
|
|
|
40
44
|
ev.get_all_projects()
|
|
41
45
|
ev.get_all_collections_in_project(project_id="cmip6plus")
|
|
42
46
|
ev.get_all_terms_in_collection(project_id="cmip6plus", collection_id="activity_id")
|
|
47
|
+
ev.get_project(project_id='cmip6')
|
|
48
|
+
ev.get_term_in_project(project_id='cmip6', term_id='ipsl')
|
|
49
|
+
ev.get_term_in_collection(project_id='cmip6', collection_id='institution_id', term_id='ipsl')
|
|
50
|
+
ev.get_collection_in_project(project_id='cmip6', collection_id='variable_id')
|
|
43
51
|
|
|
44
52
|
# Search Functions
|
|
45
|
-
ev.
|
|
46
|
-
ev.
|
|
47
|
-
ev.
|
|
48
|
-
|
|
53
|
+
ev.find_data_descriptors_in_universe(expression='var*')
|
|
54
|
+
ev.find_terms_in_data_descriptor(expression='aerchemmip', data_descriptor_id="activity")
|
|
55
|
+
ev.find_terms_in_universe(expression="aer*mip")
|
|
56
|
+
ev.find_items_in_universe(expression='ParIS NOT CNES')
|
|
57
|
+
|
|
58
|
+
ev.find_collections_in_project(expression='_id', project_id='cmip6')
|
|
59
|
+
ev.find_terms_in_collection(expression='aerchemmip', project_id='cmip6', collection_id="activity")
|
|
60
|
+
ev.find_terms_in_project(expression="aer*mip", project_id='cmip6')
|
|
61
|
+
ev.find_items_in_project(expression='ParIS AND ipsl', project_id='cmip6', limit=10)
|
|
49
62
|
# Validation Functions
|
|
50
63
|
ev.valid_term_in_collection(value="ipsl", project_id="cmip6plus", collection_id="institution_id")
|
|
51
64
|
ev.valid_term_in_project(value="some_term", project_id="cmip6plus")
|