Feature/repacking config#61
Conversation
jesusff
left a comment
There was a problem hiding this comment.
Thank you, Martin. I was planning to give it a try, but in a much simpler way, just skipping the FILE004d check in CORDEX. E.g. by having a separate check_cordex_packing mimicking the check_cmip7_packing but without the FILE004d section.
Anyway, this is much more flexible and currently fits the defaults in ncrepack-cordex. I tested it and it works flawlessly, warning on non-repacked data and providing details if the chunk size does not reach 4MB and the time is not packed with at least the defaults in ncrepack.
I also tested the -t wcrp_cmip7 plugin and it still works as expected (complaining only about data variable chunk size after ncrepack-cordex and silent after cmip7repack)
|
Hi @sol1105 The changes you describe seem relevant to me. I just have one question regarding the
each with its own severity argument. |
|
@jesusff @glevava Thanks for your feedback 😃
I think each sub-check could get different priorities in other projects. In the CORDEX discussion about it, it was my impression that there was basically agreement that the repacked metadata as well as time+bounds make a lot of sense. And alone this already increases the performance quite a bit. There was more discussion on the repacking of the data variable, since different use cases would require different packing. For example we have a usecase for our CORDEX-CMIP6 3hr-point data that requires that the data-chunks along the time dimension are only of size 1, so we can easily sub sample the 3hr-point data as 6hr-point data (in a virtual zarr dataset) without providing the data at both frequencies. This would however mostly conflict with the 4MiB rule.
Currently FILE004a-d are all run by the same check function and this PR does not change it. But each could be registered as separate check as well (only the time and time bounds check should probably stay combined). Should I do that? Would they still be labeled FILE004a-d, or eg. FILE004/5/6? |
|
Hi @sol1105 Thanks for the scientific explanation; since I am not an expert, my question was rather naive. You can keep the FILE004a, FILE004b, etc. labels. And if time and time_bounds need to remain in the same check, then you can simply keep: |
|
@glevava One issue why this checks were running as a single check in the first place was probably to not require opening the file with |
|
Great, thanks! I will check with @Ayoubnac1 regarding the merge. As for opening the file with I will also discuss this with @Ayoubnac1 . |
I set it up like this, but the tricky part is to find out when one can close the file, this is why each of the checks runs a cc-plugin-wcrp/checks/format_checks/check_internal_packing.py Lines 82 to 122 in 6e7572c cc-plugin-wcrp/plugins/cmip7/cmip7.py Lines 437 to 454 in 6e7572c |
This PR aims to generalize the (re)packing checks, as they are not only a requirement for CMIP7 but also a recommendation for CORDEX-CMIP6, and potentially will be a requirement for CORDEX-CMIP7.
For CORDEX-CMIP6,
cmip7repackhas been forked and modified: https://github.com/WCRP-CORDEX/ncrepack-cordexIt allows to define fix chunk-length along the time dimension to allow
kerchunkingof the data files (i.e. creating virtual zarr datasets out of them), which is not possible when the chunk-length varies across the files of a dataset or within a file (which it does eg. due to leap years etc.) - there is ongoing work to allow such varying chunk lengths but that is too late for CORDEX-CMIP6.The default behaviour is still the one originally implemented, but optional settings in the toml configuration make it possible to define allowed deviations for different frequencies and also different severities for the different kind of critieria.
Additionally, the functions were made more robust for exceptions of
pyfivewhen reading and interpreting the datasets. Due to issues with parsing some AWI output, the minimum requiredpyfiveversion was increased to1.1.2, which then allowed reading all test files.@Ayoubnac1 @jesusff It would be great to get your feedback on this 😃