esgf-qa 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.
@@ -0,0 +1,13 @@
1
+ *.pyc
2
+ .*.swp
3
+ build
4
+ dist
5
+ *.egg-info
6
+
7
+ # dotenv
8
+ .env
9
+ env
10
+
11
+ .DS_Store
12
+ .pytest_cache
13
+ esgf_qa/_version.py
@@ -0,0 +1,52 @@
1
+ 0.3.0 (2025-10-17)
2
+ ------------------
3
+
4
+ This is the first release of this package under the name `esgf-qa` and versioned/maintained under the ESGF organization
5
+ (https://github.com/ESGF/esgf-qa) on GitHub. This project was originally labeled `cc-qa` and versioned via the DKRZ GitLab (https://gitlab.dkrz.de/udag/cc-qa).
6
+
7
+ New Features
8
+ ^^^^^^^^^^^^
9
+
10
+ * Changed app executable from ccqa to esgqa
11
+ * Added esgqaviewer app
12
+ * Added reference datasets for inter-dataset consistency checks
13
+ * Added reference dataset in web result viewer (display_qc_results.html)
14
+ * Updated creation of dataset ids from file paths
15
+ * Basic support of cc-plugin-wcrp
16
+
17
+ 0.2.0 (2025-08-20)
18
+ ------------------
19
+
20
+ New Features
21
+ ^^^^^^^^^^^^
22
+
23
+ * Now supporting ESGF-QC and EERIE checkers.
24
+ * Added `-C` command line argument to additionally run consistency and time checks when not running the 'mip' or 'cc6' checkers.
25
+
26
+ Bug Fixes
27
+ ^^^^^^^^^
28
+ * Fixed check for consistent time-span of datasets failing when filename timestamp is not a time range.
29
+
30
+ 0.1.2 (2025-06-16)
31
+ ------------------
32
+
33
+ New Features
34
+ ^^^^^^^^^^^^
35
+ * Now printing the respective references for consistency checks (commits d7ebfbd17e1926aa7e3e61acd55b5319cd9ce184 & 4ec6ed82fbecf44aca1680f27b48a1351ec481fd).
36
+
37
+ Bug Fixes
38
+ ^^^^^^^^^
39
+ * Fixed inter-dataset checks not being reset for each dataset (commits d7ebfbd17e1926aa7e3e61acd55b5319cd9ce184 & 4ec6ed82fbecf44aca1680f27b48a1351ec481fd).
40
+ * CLI overhaul (commit 7362826ca8c60efc0a4e0f4a81723ec1f49c006e).
41
+
42
+ 0.1.1 (2025-06-13)
43
+ ------------------
44
+
45
+ Bug Fixes
46
+ ^^^^^^^^^
47
+ * Fixed cluster example message ending up scrambled at times (commit babb141203a00325a077da158cfd4e16e13b2af1).
48
+
49
+ 0.1.0 (2025-06-12)
50
+ -------------------
51
+
52
+ * First release.
esgf_qa-0.3.0/LICENSE ADDED
@@ -0,0 +1,228 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
203
+
204
+ -----------------------------------------------------------
205
+
206
+ SIL Open Font License 1.1
207
+
208
+ The Inter font is licensed under the SIL Open Font License, Version 1.1.
209
+
210
+ -----------------------------------------------------------
211
+
212
+ SIL OPEN FONT LICENSE (OFL) Version 1.1 - 26 February 2007
213
+
214
+ PREAMBLE
215
+
216
+ The goals of the Open Font License (OFL) are to promote and encourage the fonts' free use, modification, and redistribution in all its forms (modified and unmodified) under the terms of this license. By using, modifying, or distributing this font, you agree to be bound by the terms of this license.
217
+
218
+ DEFINITIONS AND CONDITIONS
219
+
220
+ 1. You can freely use, modify, and distribute the font in any project, including commercial projects, provided that you adhere to the license terms.
221
+ 2. You can create derivative fonts, but these must be named differently from the original font.
222
+ 3. When distributing the font, or any derivative work, you must include the same license file (OFL.txt) and font name.
223
+ 4. You cannot use the font's name in a modified version without permission from the original authors.
224
+
225
+ -----------------------------------------------------------
226
+
227
+ The full text of the SIL Open Font License can be found here:
228
+ https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
@@ -0,0 +1,7 @@
1
+ include LICENSE
2
+ include README.md
3
+
4
+ recursive-include tests *.py
5
+ recursive-include fonts *
6
+
7
+ global-exclude __pycache__ *.py[co]
esgf_qa-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: esgf-qa
3
+ Version: 0.3.0
4
+ Summary: QA based on compliance-checker
5
+ Author-email: Martin Schupfner <schupfner@dkrz.de>
6
+ Maintainer-email: Martin Schupfner <schupfner@dkrz.de>
7
+ License-Expression: Apache-2.0
8
+ Project-URL: homepage, https://github.com/ESGF/esgf-qa
9
+ Project-URL: repository, https://github.com/ESGF/esgf-qa
10
+ Keywords: compliance checker,plugin,wcrp,cmip,cmip6,cmip7,cordex,cordex-cmip6,qc,qa,quality control,quality assurance,esgf
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: cftime
20
+ Requires-Dist: cf_xarray
21
+ Requires-Dist: compliance-checker>=5.3.0
22
+ Requires-Dist: dask
23
+ Requires-Dist: netCDF4
24
+ Requires-Dist: pandas
25
+ Requires-Dist: textual
26
+ Requires-Dist: xarray
27
+ Requires-Dist: cc-plugin-cc6>=0.4.0
28
+ Requires-Dist: cc-plugin-wcrp
29
+ Provides-Extra: dev
30
+ Requires-Dist: black; extra == "dev"
31
+ Requires-Dist: build; extra == "dev"
32
+ Requires-Dist: isort; extra == "dev"
33
+ Requires-Dist: flake8; extra == "dev"
34
+ Requires-Dist: flake8-builtins; extra == "dev"
35
+ Requires-Dist: flake8-comprehensions; extra == "dev"
36
+ Requires-Dist: flake8-mutable; extra == "dev"
37
+ Requires-Dist: flake8-print; extra == "dev"
38
+ Requires-Dist: pre-commit; extra == "dev"
39
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
40
+ Requires-Dist: pytest-flake8; extra == "dev"
41
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
42
+ Requires-Dist: twine; extra == "dev"
43
+ Requires-Dist: wheel; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ [![PyPI version](https://img.shields.io/pypi/v/esgf-qa.svg)](https://pypi.org/project/esgf-qa/)
47
+
48
+ # esgf-qa: Quality Assurance Workflow Based on `compliance-checker` and `cc-plugin-wcrp`
49
+ <img src="docs/esgf-qa_Logo.png" align="left" width="120">
50
+
51
+ `esgf-qa` makes use of the frameworks and [CF](https://cfconventions.org/)-compliance checks of the
52
+ [ioos/compliance-checker](https://github.com/ioos/compliance-checker) and extensions coming with
53
+ [ESGF/cc-plugin-wcrp](https://github.com/ESGF/cc-plugin-wcrp) and
54
+ [euro-cordex/cc-plugin-cc6](https://github.com/euro-cordex/cc-plugin-cc6).
55
+
56
+ This tool is designed to run the desired file-based QC tests with
57
+ [ioos/compliance-checker](https://github.com/ioos/compliance-checker) and
58
+ [euro-cordex/cc-plugin-wcrp](https://github.com/euro-cordex/cc-plugin-wcrp),
59
+ to conduct additional dataset-based checks (such as time axis continuity and
60
+ consistency checks) as well as to summarize the test results.
61
+
62
+ `esgf-qa` is mainly aimed at a QA workflow testing compliance with various WCRP Project Specifications (see below).
63
+ However, it is generally applicable to test for compliance with the CF conventions through application of the IOOS Compliance Checker,
64
+ and it is easily extendable for any `cc-plugin` and for projects defining CORDEX or CMIP style CMOR-tables.
65
+
66
+ | Standard | Checker Name |
67
+ | ---------------------------------------------------------------------------------------------------- | ------------ |
68
+ | [cordex-cmip6-cv](https://github.com/WCRP-CORDEX/cordex-cmip6-cv) | wcrp_cordex_cmip6, cc6 |
69
+ | [cordex-cmip6-cmor-tables](https://github.com/WCRP-CORDEX/cordex-cmip6-cmor-tables) | wcrp_cordex_cmip6, cc6 |
70
+ | [CORDEX-CMIP6 Archive Specifications](https://doi.org/10.5281/zenodo.10961069) | wcrp_cordex_cmip6, cc6 |
71
+ | [CMIP6 DRS](https://wcrp-cmip.github.io/WGCM_Infrastructure_Panel/Papers/CMIP6_global_attributes_filenames_CVs_v6.2.7.pdf) | wcrp_cmip6 / plugin_cmip6 |
72
+ | [cmip6-cmor-tables](https://github.com/PCMDI/cmip6-cmor-tables) (esgvoc) | wcrp_cmip6 / plugin_cmip6 |
73
+ | [CMIP6 CVs](https://github.com/WCRP-CMIP/CMIP6_CVs) (esgvoc) | wcrp_cmip6 / plugin_cmip6 |
74
+ | [EERIE CMOR Tables & CV](https://github.com/eerie-project/dreq_tools) | eerie |
75
+ | Custom MIP | mip |
76
+
77
+ ## Installation
78
+
79
+ ### Pip installation
80
+
81
+ ```shell
82
+ $ pip install esgf-qa
83
+ ```
84
+
85
+ ### Pip installation from source
86
+
87
+ Clone the repository and `cd` into the repository folder, then:
88
+ ```shell
89
+ $ pip install -e .
90
+ ```
91
+
92
+ Optionally install the dependencies for development:
93
+ ```shell
94
+ $ pip install -e .[dev]
95
+ ```
96
+
97
+ See the [ioos/compliance-checker](https://github.com/ioos/compliance-checker#installation) for
98
+ additional Installation notes if problems arise with the dependencies.
99
+
100
+ ### Installation and setup of `esgvoc`
101
+
102
+ The `cc-plugin-wcrp` checker plugins require the `esgvoc` software to be installed and setup:
103
+ ```
104
+ pip install esgvoc
105
+ esgvoc config set universe:branch=esgvoc_dev
106
+ esgvoc config add cordex-cmip6
107
+ esgvoc install
108
+ ```
109
+
110
+ - Test your installation
111
+
112
+ The following command should now also list the `esgf-qc` checks next to all `cc_plugin_cc6` and `compliance_checker` checks:
113
+ ```
114
+ cchecker.py -l
115
+ ```
116
+
117
+ ## Usage
118
+
119
+ ```shell
120
+ $ esgqa [-h] [-o <OUTPUT_DIR>] [-t <TEST>] [-O OPTION] [-i <INFO>] [-r] [-C] <parent_dir>
121
+ ```
122
+
123
+ - positional arguments:
124
+ - `parent_dir`: Parent directory to scan for netCDF-files to check
125
+ - options:
126
+ - `-h, --help`: show this help message and exit
127
+ - `-o, --output_dir OUTPUT_DIR`: Directory to store QA results. Needs to be non-existing or empty or from previous QA run. If not specified, will store results in `./cc-qa-check-results/YYYYMMDD-HHmm_<hash>`.
128
+ - `-t, --test TEST`: The test to run ('wcrp_cmip6:latest', 'wcrp_cordex_cmip6':latest' or 'cf:<version>', can be specified multiple times, eg.: '-t wcrp_cmip6:latest -t cf:1.7') - default: running latest CF checks 'cf:latest'.
129
+ - `-O, --option OPTION`: Additional options to be passed to the checkers. Format: '<checker>:<option_name>[:<option_value>]'. Multiple invocations possible.
130
+ - `-i, --info INFO`: Information used to tag the QA results, eg. the simulation id to identify the checked run. Suggested is the original experiment-id you gave the run.
131
+ - `-r, --resume`: Specify to continue a previous QC run. Requires the <output_dir> argument to be set.
132
+ - `-C, --include_consistency_checks`: Include basic consistency and continuity checks. When using the `wcrp-*`, `cc6`, `mip` or `eerie` checkers, they are included by default.
133
+
134
+ ### Example Usage
135
+
136
+ ```shell
137
+ $ esgqa -t wcrp_cordex_cmip6:latest -t cf:1.11 -o QA_results/IAEVALL02_2025-10-20 -i "IAEVALL02" ESGF_Buff/IAEVALL02/CORDEX-CMIP6
138
+ ```
139
+
140
+ To resume at a later date, eg. if the QA run did not finish in time or more files have been added to the <parent_dir>
141
+ (note, that the last modification date of files is NOT taken into account - once a certain file path has been checked
142
+ it will be marked as checked and checks will only be repeated if runtime errors occured):
143
+
144
+ ```shell
145
+ $ esgqa -o QA_results/IAEVALL02_2025-10-20 -r
146
+ ```
147
+
148
+ For a custom MIP with defined CMOR tables (`"mip"` is not a placeholder but an actual basic checker of the `cc_plugin_cc6`):
149
+
150
+ ```shell
151
+ $ esgqa -o /path/to/test/results -t "mip:latest" -O "mip:tables:/path/to/mip_cmor_tables/Tables" /path/to/MIP/datasets/`
152
+ ```
153
+
154
+ For CF checks and basic time and consistency / continuity checks:
155
+ ```shell
156
+ $ esgqa -o /path/to/test/results -t "cf:1.11" -C /path/to/datasets/to/check
157
+ ```
158
+
159
+ ## Displaying the check results
160
+
161
+ The results will be stored in two `json` files:
162
+ - `qa_result_*.json`: All failed checks incl. all affected datasets and files are listed. Depending on the number of failed checks and files affected, this file can be quite large in volume (up to GigaBytes).
163
+ - `qa_result_*.cluster.json`: The failed checks are clustered and for affected datasets only a single file is referenced as example. This reduces the file size significantly (to usually below 1 MegaByte).
164
+
165
+ ### Web view
166
+ The clustered results can be viewed using the following website:
167
+ [https://cmiphub.dkrz.de/info/display_qc_results.html](https://cmiphub.dkrz.de/info/display_qc_results.html).
168
+ This website runs entirely in the user's browser using JavaScript, without requiring interaction with a web server.
169
+ Alternatively, you can open the included `display_qc_results.html` file directly in your browser.
170
+ While the web view also supports the full (unclustered) results, it is recommended to not use the web view for files greater than a few MegaBytes.
171
+
172
+ ### `esgqaviewer`
173
+ The `esgqaviewer` app can be used to view the result files inside a terminal:
174
+ ```
175
+ esgqaviewer path/to/result.json
176
+ ```
177
+ At the bottom of the viewer, all possible tools are listed. The results can be searched using a full text search for instance.
178
+ A double click with the right mouse button on a node will expand / collapse it and below nodes fully, while a left click will collapse the current node only.
179
+
180
+ ### Add results to QA results repository
181
+
182
+ - DKRZ: [https://cmiphub.dkrz.de/info/display_qc_results.html](https://cmiphub.dkrz.de/info/display_qc_results.html) allows viewing QA results hosted
183
+ in the GitLab Repository [qa-results](https://gitlab.dkrz.de/udag/qa-results). You can create a Merge Request in that repository to add your own results.
184
+ - IPSL: coming soon
185
+ - Feel free to set up repository for QA results for your institute as well. As example implementation can serve: [qa-results](https://gitlab.dkrz.de/udag/qa-results)
186
+
187
+ # License
188
+
189
+ This project is licensed under the Apache License 2.0, and includes the Inter font, which is licensed under the SIL Open Font License 1.1. See the [LICENSE](./LICENSE) file for more details.
190
+
191
+ > [!NOTE]
192
+ > **This project was originally developed by [DKRZ](https://www.dkrz.de)** under the name **cc-qa** (see [DKRZ GitLab](https://gitlab.dkrz.de/udag/cc-qa)), with funding from the German Ministry of Research, Technology and Space ([BMFTR](https://www.bmftr.bund.de/en), reference `01LP2326E`).
193
+ > It has since been renamed to **esgf-qa** and is now maintained under the **Earth System Grid Federation (ESGF)** organization on GitHub.
194
+ >
195
+ > If you previously used `cc-qa`, please update your installations as described above.
@@ -0,0 +1,150 @@
1
+ [![PyPI version](https://img.shields.io/pypi/v/esgf-qa.svg)](https://pypi.org/project/esgf-qa/)
2
+
3
+ # esgf-qa: Quality Assurance Workflow Based on `compliance-checker` and `cc-plugin-wcrp`
4
+ <img src="docs/esgf-qa_Logo.png" align="left" width="120">
5
+
6
+ `esgf-qa` makes use of the frameworks and [CF](https://cfconventions.org/)-compliance checks of the
7
+ [ioos/compliance-checker](https://github.com/ioos/compliance-checker) and extensions coming with
8
+ [ESGF/cc-plugin-wcrp](https://github.com/ESGF/cc-plugin-wcrp) and
9
+ [euro-cordex/cc-plugin-cc6](https://github.com/euro-cordex/cc-plugin-cc6).
10
+
11
+ This tool is designed to run the desired file-based QC tests with
12
+ [ioos/compliance-checker](https://github.com/ioos/compliance-checker) and
13
+ [euro-cordex/cc-plugin-wcrp](https://github.com/euro-cordex/cc-plugin-wcrp),
14
+ to conduct additional dataset-based checks (such as time axis continuity and
15
+ consistency checks) as well as to summarize the test results.
16
+
17
+ `esgf-qa` is mainly aimed at a QA workflow testing compliance with various WCRP Project Specifications (see below).
18
+ However, it is generally applicable to test for compliance with the CF conventions through application of the IOOS Compliance Checker,
19
+ and it is easily extendable for any `cc-plugin` and for projects defining CORDEX or CMIP style CMOR-tables.
20
+
21
+ | Standard | Checker Name |
22
+ | ---------------------------------------------------------------------------------------------------- | ------------ |
23
+ | [cordex-cmip6-cv](https://github.com/WCRP-CORDEX/cordex-cmip6-cv) | wcrp_cordex_cmip6, cc6 |
24
+ | [cordex-cmip6-cmor-tables](https://github.com/WCRP-CORDEX/cordex-cmip6-cmor-tables) | wcrp_cordex_cmip6, cc6 |
25
+ | [CORDEX-CMIP6 Archive Specifications](https://doi.org/10.5281/zenodo.10961069) | wcrp_cordex_cmip6, cc6 |
26
+ | [CMIP6 DRS](https://wcrp-cmip.github.io/WGCM_Infrastructure_Panel/Papers/CMIP6_global_attributes_filenames_CVs_v6.2.7.pdf) | wcrp_cmip6 / plugin_cmip6 |
27
+ | [cmip6-cmor-tables](https://github.com/PCMDI/cmip6-cmor-tables) (esgvoc) | wcrp_cmip6 / plugin_cmip6 |
28
+ | [CMIP6 CVs](https://github.com/WCRP-CMIP/CMIP6_CVs) (esgvoc) | wcrp_cmip6 / plugin_cmip6 |
29
+ | [EERIE CMOR Tables & CV](https://github.com/eerie-project/dreq_tools) | eerie |
30
+ | Custom MIP | mip |
31
+
32
+ ## Installation
33
+
34
+ ### Pip installation
35
+
36
+ ```shell
37
+ $ pip install esgf-qa
38
+ ```
39
+
40
+ ### Pip installation from source
41
+
42
+ Clone the repository and `cd` into the repository folder, then:
43
+ ```shell
44
+ $ pip install -e .
45
+ ```
46
+
47
+ Optionally install the dependencies for development:
48
+ ```shell
49
+ $ pip install -e .[dev]
50
+ ```
51
+
52
+ See the [ioos/compliance-checker](https://github.com/ioos/compliance-checker#installation) for
53
+ additional Installation notes if problems arise with the dependencies.
54
+
55
+ ### Installation and setup of `esgvoc`
56
+
57
+ The `cc-plugin-wcrp` checker plugins require the `esgvoc` software to be installed and setup:
58
+ ```
59
+ pip install esgvoc
60
+ esgvoc config set universe:branch=esgvoc_dev
61
+ esgvoc config add cordex-cmip6
62
+ esgvoc install
63
+ ```
64
+
65
+ - Test your installation
66
+
67
+ The following command should now also list the `esgf-qc` checks next to all `cc_plugin_cc6` and `compliance_checker` checks:
68
+ ```
69
+ cchecker.py -l
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ```shell
75
+ $ esgqa [-h] [-o <OUTPUT_DIR>] [-t <TEST>] [-O OPTION] [-i <INFO>] [-r] [-C] <parent_dir>
76
+ ```
77
+
78
+ - positional arguments:
79
+ - `parent_dir`: Parent directory to scan for netCDF-files to check
80
+ - options:
81
+ - `-h, --help`: show this help message and exit
82
+ - `-o, --output_dir OUTPUT_DIR`: Directory to store QA results. Needs to be non-existing or empty or from previous QA run. If not specified, will store results in `./cc-qa-check-results/YYYYMMDD-HHmm_<hash>`.
83
+ - `-t, --test TEST`: The test to run ('wcrp_cmip6:latest', 'wcrp_cordex_cmip6':latest' or 'cf:<version>', can be specified multiple times, eg.: '-t wcrp_cmip6:latest -t cf:1.7') - default: running latest CF checks 'cf:latest'.
84
+ - `-O, --option OPTION`: Additional options to be passed to the checkers. Format: '<checker>:<option_name>[:<option_value>]'. Multiple invocations possible.
85
+ - `-i, --info INFO`: Information used to tag the QA results, eg. the simulation id to identify the checked run. Suggested is the original experiment-id you gave the run.
86
+ - `-r, --resume`: Specify to continue a previous QC run. Requires the <output_dir> argument to be set.
87
+ - `-C, --include_consistency_checks`: Include basic consistency and continuity checks. When using the `wcrp-*`, `cc6`, `mip` or `eerie` checkers, they are included by default.
88
+
89
+ ### Example Usage
90
+
91
+ ```shell
92
+ $ esgqa -t wcrp_cordex_cmip6:latest -t cf:1.11 -o QA_results/IAEVALL02_2025-10-20 -i "IAEVALL02" ESGF_Buff/IAEVALL02/CORDEX-CMIP6
93
+ ```
94
+
95
+ To resume at a later date, eg. if the QA run did not finish in time or more files have been added to the <parent_dir>
96
+ (note, that the last modification date of files is NOT taken into account - once a certain file path has been checked
97
+ it will be marked as checked and checks will only be repeated if runtime errors occured):
98
+
99
+ ```shell
100
+ $ esgqa -o QA_results/IAEVALL02_2025-10-20 -r
101
+ ```
102
+
103
+ For a custom MIP with defined CMOR tables (`"mip"` is not a placeholder but an actual basic checker of the `cc_plugin_cc6`):
104
+
105
+ ```shell
106
+ $ esgqa -o /path/to/test/results -t "mip:latest" -O "mip:tables:/path/to/mip_cmor_tables/Tables" /path/to/MIP/datasets/`
107
+ ```
108
+
109
+ For CF checks and basic time and consistency / continuity checks:
110
+ ```shell
111
+ $ esgqa -o /path/to/test/results -t "cf:1.11" -C /path/to/datasets/to/check
112
+ ```
113
+
114
+ ## Displaying the check results
115
+
116
+ The results will be stored in two `json` files:
117
+ - `qa_result_*.json`: All failed checks incl. all affected datasets and files are listed. Depending on the number of failed checks and files affected, this file can be quite large in volume (up to GigaBytes).
118
+ - `qa_result_*.cluster.json`: The failed checks are clustered and for affected datasets only a single file is referenced as example. This reduces the file size significantly (to usually below 1 MegaByte).
119
+
120
+ ### Web view
121
+ The clustered results can be viewed using the following website:
122
+ [https://cmiphub.dkrz.de/info/display_qc_results.html](https://cmiphub.dkrz.de/info/display_qc_results.html).
123
+ This website runs entirely in the user's browser using JavaScript, without requiring interaction with a web server.
124
+ Alternatively, you can open the included `display_qc_results.html` file directly in your browser.
125
+ While the web view also supports the full (unclustered) results, it is recommended to not use the web view for files greater than a few MegaBytes.
126
+
127
+ ### `esgqaviewer`
128
+ The `esgqaviewer` app can be used to view the result files inside a terminal:
129
+ ```
130
+ esgqaviewer path/to/result.json
131
+ ```
132
+ At the bottom of the viewer, all possible tools are listed. The results can be searched using a full text search for instance.
133
+ A double click with the right mouse button on a node will expand / collapse it and below nodes fully, while a left click will collapse the current node only.
134
+
135
+ ### Add results to QA results repository
136
+
137
+ - DKRZ: [https://cmiphub.dkrz.de/info/display_qc_results.html](https://cmiphub.dkrz.de/info/display_qc_results.html) allows viewing QA results hosted
138
+ in the GitLab Repository [qa-results](https://gitlab.dkrz.de/udag/qa-results). You can create a Merge Request in that repository to add your own results.
139
+ - IPSL: coming soon
140
+ - Feel free to set up repository for QA results for your institute as well. As example implementation can serve: [qa-results](https://gitlab.dkrz.de/udag/qa-results)
141
+
142
+ # License
143
+
144
+ This project is licensed under the Apache License 2.0, and includes the Inter font, which is licensed under the SIL Open Font License 1.1. See the [LICENSE](./LICENSE) file for more details.
145
+
146
+ > [!NOTE]
147
+ > **This project was originally developed by [DKRZ](https://www.dkrz.de)** under the name **cc-qa** (see [DKRZ GitLab](https://gitlab.dkrz.de/udag/cc-qa)), with funding from the German Ministry of Research, Technology and Space ([BMFTR](https://www.bmftr.bund.de/en), reference `01LP2326E`).
148
+ > It has since been renamed to **esgf-qa** and is now maintained under the **Earth System Grid Federation (ESGF)** organization on GitHub.
149
+ >
150
+ > If you previously used `cc-qa`, please update your installations as described above.