esgvoc 0.2.1__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.

Files changed (201) hide show
  1. esgvoc-0.4.0/.flake8 +3 -0
  2. {esgvoc-0.2.1 → esgvoc-0.4.0}/.github/workflows/docs.yml +2 -2
  3. {esgvoc-0.2.1 → esgvoc-0.4.0}/.gitignore +1 -0
  4. esgvoc-0.4.0/.pre-commit-config.yaml +36 -0
  5. {esgvoc-0.2.1 → esgvoc-0.4.0}/PKG-INFO +34 -3
  6. {esgvoc-0.2.1 → esgvoc-0.4.0}/README.md +32 -0
  7. esgvoc-0.4.0/docs/source/_static/API_Valid_Term.png +0 -0
  8. esgvoc-0.4.0/docs/source/_static/API_Valid_all_project.png +0 -0
  9. esgvoc-0.4.0/docs/source/_static/API_Valid_collection.png +0 -0
  10. esgvoc-0.4.0/docs/source/_static/API_Valid_project.png +0 -0
  11. esgvoc-0.4.0/docs/source/_static/API_drsgen_frombag.png +0 -0
  12. esgvoc-0.4.0/docs/source/_static/API_drsgen_map.png +0 -0
  13. esgvoc-0.4.0/docs/source/_static/API_drsvalid_one.png +0 -0
  14. esgvoc-0.4.0/docs/source/_static/CLI_Valid_all_project.png +0 -0
  15. esgvoc-0.4.0/docs/source/_static/CLI_Valid_collection.png +0 -0
  16. esgvoc-0.4.0/docs/source/_static/CLI_Valid_project.png +0 -0
  17. esgvoc-0.4.0/docs/source/_static/CLI_Valid_term.png +0 -0
  18. esgvoc-0.4.0/docs/source/_static/CLI_drsgen_frombag.png +0 -0
  19. esgvoc-0.4.0/docs/source/_static/CLI_drsvalid_one.png +0 -0
  20. esgvoc-0.4.0/docs/source/_static/Jup_one_term.png +0 -0
  21. esgvoc-0.4.0/docs/source/_static/Jup_one_term_from_one_CV.png +0 -0
  22. esgvoc-0.4.0/docs/source/_static/Jup_terms_from_one_collection.png +0 -0
  23. esgvoc-0.4.0/docs/source/_static/Jup_terms_from_one_dd.png +0 -0
  24. esgvoc-0.4.0/docs/source/_static/all_collection.png +0 -0
  25. esgvoc-0.4.0/docs/source/_static/all_term_from_one_collection.png +0 -0
  26. esgvoc-0.4.0/docs/source/_static/install.png +0 -0
  27. esgvoc-0.4.0/docs/source/_static/one_term.png +0 -0
  28. esgvoc-0.4.0/docs/source/_static/one_term_from_one_cv.png +0 -0
  29. esgvoc-0.4.0/docs/source/_static/status_after_install.png +0 -0
  30. esgvoc-0.4.0/docs/source/_static/status_before_install.png +0 -0
  31. esgvoc-0.4.0/docs/source/api_documentation/data_descriptors.md +21 -0
  32. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/api_documentation/drs.md +2 -2
  33. esgvoc-0.4.0/docs/source/api_documentation/miscellaneous.md +18 -0
  34. esgvoc-0.4.0/docs/source/api_documentation/projects.md +23 -0
  35. esgvoc-0.4.0/docs/source/api_documentation/universe.md +9 -0
  36. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/guides/basics_drs.ipynb +32 -32
  37. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/guides/basics_esgvoc.ipynb +274 -69
  38. esgvoc-0.4.0/docs/source/how_to/generate_drs.rst +88 -0
  39. esgvoc-0.4.0/docs/source/how_to/get.rst +110 -0
  40. esgvoc-0.4.0/docs/source/how_to/valid.rst +127 -0
  41. esgvoc-0.4.0/docs/source/how_to/validate_drs.rst +45 -0
  42. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/index.md +11 -7
  43. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/user/api.md +21 -9
  44. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/user/introduction.md +19 -16
  45. esgvoc-0.4.0/docs/source/user/terms.md +35 -0
  46. {esgvoc-0.2.1 → esgvoc-0.4.0}/pyproject.toml +43 -14
  47. esgvoc-0.4.0/src/esgvoc/__init__.py +3 -0
  48. esgvoc-0.4.0/src/esgvoc/api/__init__.py +97 -0
  49. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/api/data_descriptors/__init__.py +18 -12
  50. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/activity.py +14 -0
  51. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/area_label.py +6 -0
  52. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/branded_suffix.py +5 -0
  53. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/branded_variable.py +5 -0
  54. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/consortium.py +26 -0
  55. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/data_descriptor.py +106 -0
  56. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/date.py +5 -0
  57. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/directory_date.py +5 -0
  58. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/experiment.py +25 -0
  59. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/forcing_index.py +5 -0
  60. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/frequency.py +8 -0
  61. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/grid_label.py +8 -0
  62. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/horizontal_label.py +6 -0
  63. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/initialisation_index.py +5 -0
  64. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/institution.py +15 -0
  65. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/license.py +7 -0
  66. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/mip_era.py +8 -0
  67. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/model_component.py +9 -0
  68. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/organisation.py +5 -0
  69. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/physic_index.py +5 -0
  70. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/product.py +6 -0
  71. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/realisation_index.py +5 -0
  72. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/realm.py +6 -0
  73. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/resolution.py +8 -0
  74. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/source.py +22 -0
  75. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/source_type.py +5 -0
  76. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/sub_experiment.py +5 -0
  77. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/table.py +8 -0
  78. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/temporal_label.py +6 -0
  79. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/time_range.py +4 -0
  80. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/variable.py +19 -0
  81. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/variant_label.py +5 -0
  82. esgvoc-0.4.0/src/esgvoc/api/data_descriptors/vertical_label.py +5 -0
  83. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/api/project_specs.py +3 -2
  84. esgvoc-0.4.0/src/esgvoc/api/projects.py +1165 -0
  85. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/api/report.py +29 -16
  86. esgvoc-0.4.0/src/esgvoc/api/search.py +155 -0
  87. esgvoc-0.4.0/src/esgvoc/api/universe.py +423 -0
  88. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/apps/__init__.py +3 -4
  89. esgvoc-0.4.0/src/esgvoc/apps/drs/constants.py +2 -0
  90. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/apps/drs/generator.py +185 -198
  91. esgvoc-0.4.0/src/esgvoc/apps/drs/report.py +537 -0
  92. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/apps/drs/validator.py +132 -145
  93. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/cli/drs.py +32 -21
  94. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/cli/get.py +35 -31
  95. esgvoc-0.4.0/src/esgvoc/cli/install.py +17 -0
  96. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/cli/main.py +0 -2
  97. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/cli/status.py +5 -5
  98. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/cli/valid.py +40 -40
  99. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/constants.py +1 -1
  100. esgvoc-0.4.0/src/esgvoc/core/convert.py +0 -0
  101. esgvoc-0.4.0/src/esgvoc/core/db/__init__.py +3 -0
  102. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/db/connection.py +5 -3
  103. esgvoc-0.4.0/src/esgvoc/core/db/models/project.py +102 -0
  104. esgvoc-0.4.0/src/esgvoc/core/db/models/universe.py +98 -0
  105. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/db/project_ingestion.py +60 -46
  106. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/db/universe_ingestion.py +58 -29
  107. esgvoc-0.4.0/src/esgvoc/core/exceptions.py +33 -0
  108. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/logging_handler.py +1 -1
  109. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/repo_fetcher.py +4 -3
  110. esgvoc-0.4.0/src/esgvoc/core/service/__init__.py +40 -0
  111. esgvoc-0.4.0/src/esgvoc/core/service/configuration/config_manager.py +188 -0
  112. esgvoc-0.4.0/src/esgvoc/core/service/configuration/setting.py +88 -0
  113. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/service/state.py +49 -32
  114. esgvoc-0.4.0/tests/Dockerfile +13 -0
  115. esgvoc-0.4.0/tests/__init__.py +0 -0
  116. esgvoc-0.4.0/tests/api_inputs.py +829 -0
  117. esgvoc-0.4.0/tests/integration/test_scenario_basic.py +34 -0
  118. esgvoc-0.4.0/tests/test_api_project.py +192 -0
  119. esgvoc-0.4.0/tests/test_api_universe.py +76 -0
  120. esgvoc-0.4.0/tests/test_cli_config.py +108 -0
  121. {esgvoc-0.2.1 → esgvoc-0.4.0}/tests/test_cli_drs.py +2 -2
  122. esgvoc-0.4.0/tests/test_config.py +54 -0
  123. {esgvoc-0.2.1 → esgvoc-0.4.0}/tests/test_data_handler.py +6 -4
  124. {esgvoc-0.2.1 → esgvoc-0.4.0}/tests/test_data_merger.py +8 -4
  125. esgvoc-0.4.0/tests/test_drs_generator.py +224 -0
  126. esgvoc-0.4.0/tests/test_drs_validator.py +111 -0
  127. esgvoc-0.2.1/docs/source/api_documentation/projects.md +0 -62
  128. esgvoc-0.2.1/docs/source/api_documentation/universe.md +0 -28
  129. esgvoc-0.2.1/docs/source/guides/basic_cli.md +0 -47
  130. esgvoc-0.2.1/docs/source/guides/get_started.md +0 -22
  131. esgvoc-0.2.1/docs/source/how_to/get.md +0 -29
  132. esgvoc-0.2.1/docs/source/how_to/validate_drs.md +0 -2
  133. esgvoc-0.2.1/docs/source/user/terms.md +0 -33
  134. esgvoc-0.2.1/src/esgvoc/__init__.py +0 -1
  135. esgvoc-0.2.1/src/esgvoc/api/__init__.py +0 -73
  136. esgvoc-0.2.1/src/esgvoc/api/_utils.py +0 -39
  137. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/activity.py +0 -51
  138. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/consortium.py +0 -66
  139. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/date.py +0 -48
  140. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/directory_date.py +0 -48
  141. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/experiment.py +0 -60
  142. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/forcing_index.py +0 -47
  143. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/frequency.py +0 -45
  144. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/grid_label.py +0 -46
  145. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/initialisation_index.py +0 -46
  146. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/institution.py +0 -58
  147. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/license.py +0 -47
  148. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/mip_era.py +0 -46
  149. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/model_component.py +0 -47
  150. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/organisation.py +0 -42
  151. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/physic_index.py +0 -47
  152. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/product.py +0 -45
  153. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/realisation_index.py +0 -46
  154. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/realm.py +0 -44
  155. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/resolution.py +0 -46
  156. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/source.py +0 -57
  157. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/source_type.py +0 -43
  158. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/sub_experiment.py +0 -43
  159. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/table.py +0 -50
  160. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/time_range.py +0 -28
  161. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/variable.py +0 -77
  162. esgvoc-0.2.1/src/esgvoc/api/data_descriptors/variant_label.py +0 -49
  163. esgvoc-0.2.1/src/esgvoc/api/projects.py +0 -884
  164. esgvoc-0.2.1/src/esgvoc/api/search.py +0 -110
  165. esgvoc-0.2.1/src/esgvoc/api/universe.py +0 -217
  166. esgvoc-0.2.1/src/esgvoc/apps/drs/constants.py +0 -2
  167. esgvoc-0.2.1/src/esgvoc/apps/drs/report.py +0 -401
  168. esgvoc-0.2.1/src/esgvoc/cli/config.py +0 -82
  169. esgvoc-0.2.1/src/esgvoc/cli/install.py +0 -14
  170. esgvoc-0.2.1/src/esgvoc/core/db/__init__.py +0 -5
  171. esgvoc-0.2.1/src/esgvoc/core/db/models/project.py +0 -60
  172. esgvoc-0.2.1/src/esgvoc/core/db/models/universe.py +0 -59
  173. esgvoc-0.2.1/src/esgvoc/core/service/__init__.py +0 -8
  174. esgvoc-0.2.1/src/esgvoc/core/service/settings.py +0 -73
  175. esgvoc-0.2.1/src/esgvoc/core/service/settings.toml +0 -17
  176. esgvoc-0.2.1/src/esgvoc/core/service/settings_default.toml +0 -17
  177. esgvoc-0.2.1/tests/test_api_project.py +0 -183
  178. esgvoc-0.2.1/tests/test_api_universe.py +0 -68
  179. esgvoc-0.2.1/tests/test_drs_generator.py +0 -290
  180. esgvoc-0.2.1/tests/test_drs_validator.py +0 -631
  181. esgvoc-0.2.1/tests/test_state.py +0 -105
  182. {esgvoc-0.2.1 → esgvoc-0.4.0}/.github/workflows/pypi-publish.yml +0 -0
  183. {esgvoc-0.2.1 → esgvoc-0.4.0}/LICENSE.txt +0 -0
  184. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/Makefile +0 -0
  185. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/build.sh +0 -0
  186. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/api_documentation/project_specs.md +0 -0
  187. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/conf.py +0 -0
  188. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/guides/status_install.png +0 -0
  189. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/user/cached_database.md +0 -0
  190. {esgvoc-0.2.1 → esgvoc-0.4.0}/docs/source/user/cli.md +0 -0
  191. /esgvoc-0.2.1/docs/source/how_to/validate_drs_name.md → /esgvoc-0.4.0/src/esgvoc/api/py.typed +0 -0
  192. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/apps/drs/__init__.py +0 -0
  193. /esgvoc-0.2.1/src/esgvoc/core/convert.py → /esgvoc-0.4.0/src/esgvoc/apps/py.typed +0 -0
  194. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/data_handler.py +0 -0
  195. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/db/models/mixins.py +0 -0
  196. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/logging.conf +0 -0
  197. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/service/data_merger.py +0 -0
  198. {esgvoc-0.2.1 → esgvoc-0.4.0}/src/esgvoc/core/service/esg_voc.py +0 -0
  199. {esgvoc-0.2.1 → esgvoc-0.4.0}/tests/cli_input_drsgen.txt +0 -0
  200. {esgvoc-0.2.1 → esgvoc-0.4.0}/tests/cli_input_drsvalid.txt +0 -0
  201. {esgvoc-0.2.1 → esgvoc-0.4.0}/tests/test_repo_fetcher.py +0 -0
esgvoc-0.4.0/.flake8 ADDED
@@ -0,0 +1,3 @@
1
+ [flake8]
2
+ exclude = tests/*.py
3
+ max-line-length = 120
@@ -3,7 +3,7 @@ name: documentation
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - integration
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/integration' }}
31
+ if: ${{ github.ref == 'refs/heads/documentation' }}
32
32
  with:
33
33
  github_token: ${{ secrets.GITHUB_TOKEN }}
34
34
  publish_dir: ./docs/build/html
@@ -27,3 +27,4 @@ tmp*
27
27
  *.py[oc]
28
28
  sb.py
29
29
  CHANGELOG.md
30
+ .coverage
@@ -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,17 +1,16 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: esgvoc
3
- Version: 0.2.1
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>
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
+ ```
@@ -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
+ ```
@@ -23,6 +23,6 @@
23
23
  ```{eval-rst}
24
24
  .. automodule:: esgvoc.apps.drs.report
25
25
  :members:
26
- :inherited-members: BaseModel
26
+ :inherited-members: BaseModel, str, Enum
27
27
  :member-order: groupwise
28
- ```
28
+ ```
@@ -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
+ ```
@@ -0,0 +1,23 @@
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
+ ```
@@ -0,0 +1,9 @@
1
+ # Universe
2
+
3
+ ## Get and find functions
4
+
5
+ ```{eval-rst}
6
+ .. automodule:: esgvoc.api.universe
7
+ :members:
8
+ :member-order: groupwise
9
+ ```
@@ -254,7 +254,7 @@
254
254
  {
255
255
  "data": {
256
256
  "text/plain": [
257
- "[missing token for time_range at position 7]"
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 token:"
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 token at column 16]\n"
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 tokens at the end of the expression or separator stuttering:"
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 token some_thing at position 9]\n"
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=[token 'CMIP_ERROR_HERE' not compliant with activity_id at position 2]\n"
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 [parser issue visitor](https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.ParserIssueVisitor) and a [validation issue visitor](https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.ValidationIssueVisitor):"
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 token issue, rather then printing it\n"
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 visit_invalid_token_issue(self, issue):\n",
392
- " print('Doing something automatically with a invalid token issue, ' +\n",
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 ParserIssueVisitor and \n",
395
- " # ValidatorIssueVisitor too!\n",
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 tokens or a bag of unordered tokens."
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 tokens with their collections:"
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 (generator report [class](https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.DrsGeneratorReport), generator visitor [specifications](https://esgf.github.io/esgf-vocab/api_documentation/drs.html#esgvoc.apps.drs.report.GeneratorIssueVisitor)):"
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 token for time_range at position 7]\n"
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 token issue, rather then printing it\n"
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 visit_missing_token_issue(self, issue):\n",
632
- " print('Doing something automatically with a missing token issue, ' +\n",
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=[token 'MiRoC6' not compliant with source_id at position 3, missing token for member_id at position 5]\n",
694
- "report.warnings=[missing token for time_range at position 7]\n"
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 tokens\n",
715
- "The bag of tokens methods consist of generating a DRS expression from a set of unordered tokens. The generator try to build a mapping between the collections of the DRS specification target and the given tokens, then it generates an expression."
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
- "bag_of_tokens=['r2i2p1f2', 'CMIP', 'MIROC6', 'CMIP6Plus', 'amip', 'od550aer', 'ACmon', 'gn', 'v20190923', 'IPSL', 'some_value']\n"
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
- "bag_of_tokens = list(mapping.values())\n",
748
- "print(f'{bag_of_tokens=}')\n",
749
- "generator.generate_from_bag_of_tokens(tokens=bag_of_tokens, drs_type='dataset_id')"
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 term patterns, some tokens can fit to more than one collection or fit the same collection. The generator supports these cases and try to untangle tokens 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**."
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 token (IPSL, UA), missing token for institution_id at position 3]\n"
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 token error.\n",
781
- "bag_of_tokens.append('UA')\n",
782
- "report = generator.generate_from_bag_of_tokens(tokens=bag_of_tokens,\n",
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=}')"