[ZFDB] Feature/zfdb/fdb 678 2nd step - refactor tests and zarr interface alignment#302
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature/zfdb/refactor #302 +/- ##
=========================================================
- Coverage 72.08% 71.99% -0.10%
=========================================================
Files 378 378
Lines 23901 23946 +45
Branches 2504 2513 +9
=========================================================
+ Hits 17230 17240 +10
- Misses 6671 6706 +35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR continues the Zarr v3 alignment for z3fdb by updating the internal Zarr store implementation (notably metadata/consolidation behavior and key handling) and substantially reorganizing/expanding the Python test suite into clearer categories.
Changes:
- Updated
FdbZarrStore/FdbZarrGroup/FdbZarrArrayto use string keys and added rootzarr.jsongeneration with inline consolidated metadata for group roots. - Restructured tests into
unit/,permutation_tests/, andzarr_interface_conformity/, adding deeper store-path and consolidated-metadata conformity coverage. - Updated CMake test registration to reflect the new test layout and added a minimal Ruff configuration.
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/z3fdb/zarr_interface_conformity/test_z3fdb_store_path_correctness.py | New deep-hierarchy path/listing/get/getitem correctness coverage. |
| tests/z3fdb/zarr_interface_conformity/test_z3fdb_store_interface.py | Adds Zarr StoreTests-based interface checks for FdbZarrStore. |
| tests/z3fdb/zarr_interface_conformity/test_z3fdb_consolidated_metadata.py | Verifies inline consolidated metadata structure and Zarr API navigation. |
| tests/z3fdb/zarr_interface_conformity/conftest.py | Provides shared fixtures for deep store/group and configures asyncio behavior. |
| tests/z3fdb/zarr_interface_conformity/_mocks.py | Adds mock chunked data view + deep store factory helpers. |
| tests/z3fdb/unit/test_store_v3.py | Moves/extends basic v3 access tests into unit/. |
| tests/z3fdb/unit/test_store_v3_errors.py | Adds request-format and axis-extension error tests. |
| tests/z3fdb/test_store_v3.py | Removed (tests relocated into tests/z3fdb/unit/). |
| tests/z3fdb/test_store_v3_random_axis.py | Removed (coverage moved to new permutation tests). |
| tests/z3fdb/test_store_v3_pattern.py | Removed (coverage moved to new permutation tests). |
| tests/z3fdb/permutation_tests/test_store_multiple_parts.py | Refactors request strings into constants and reuses them across scenarios. |
| tests/z3fdb/permutation_tests/test_store_missing_values.py | Adds online test coverage for bitmap-missing handling and fill_value propagation. |
| tests/z3fdb/permutation_tests/test_store_individual_chunking.py | Formatting refactor; keeps chunking behavior checks. |
| tests/z3fdb/permutation_tests/test_scrambled_request_ordering.py | New tests for scrambled request value ordering correctness. |
| tests/z3fdb/permutation_tests/test_axis_definition_permutations.py | New exhaustive permutation sweep tests for axis definition ordering/chunking. |
| tests/z3fdb/permutation_tests/test_axis_definition_ordering.py | New targeted axis-ordering/chunking scenario tests. |
| tests/z3fdb/CMakeLists.txt | Re-registers tests by category and adjusts online test invocation. |
| src/z3fdb/simple_store_builder.py | Narrows build() return type to FdbZarrStore. |
| src/z3fdb/_internal/zarr.py | Implements string-key access, consolidated root zarr.json, and updated Store methods. |
| ruff.toml | Adds Ruff target-version/line-length configuration. |
Comments suppressed due to low confidence (1)
tests/z3fdb/CMakeLists.txt:66
- The standalone online test uses
ENVIRONMENT "${_env}", but_envis defined inside theadd_py_test()function (function scope), so it will be empty here. That likely breaks imports (PYTHONPATH/FDB5_DIR/ECCODES_DIR) when runningctest -L z3fdb_online. Define_envin this scope (or move it to a global variable shared by both paths).
set_tests_properties(pychunked_data_view_${online_stem}
PROPERTIES
RESOURCE_LOCK pytest
ENVIRONMENT "${_env}"
LABELS "z3fdb;z3fdb_online"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
25cecc0 to
84defd6
Compare
cbbb4e3 to
38b3005
Compare
569322c to
117dffa
Compare
38b3005 to
4c75f61
Compare
Zarr provides a test harness for checking the store API. This is now leveraged for tests. Slight adjustedments to the return types of functions to align them with the definition.
The prefix function now uses the consolidated paths, created at constructor call of the store. Added a test to check for the correct output of list.
test_z3fdb_consolidated_metadata.py: - Imports MockChunkedDataView and make_array from _mocks (no inline stub class) - Uses the deep_store fixture from conftest for the hierarchy tests - Splits the monolithic test into focused functions with no abbreviations: test_z3fdb_store_path_correctness.py: - Remove inline mock class, array configs, fixture definitions (all in _mocks.py / conftest.py) - Import MockChunkedDataView, ARR_ROOT, ARR_A1, ARR_AI1, ARR_AI2, ARR_BBD from _mocks - Merge 3 zarr.json tests to test_zarr_json_accessible_via_all_apis (11 cases, 3 assertions each) - Merge 3 chunk tests to test_chunk_accessible_via_all_apis (10 cases, 3 assertions each) test_z3fdb_store_interface.py fixed issue introduced through zarr API alignment of the FdbZarrGroup.
Renamed the test files and split test_store_v3_random_axis.py in semanical subtests with their own files.
FDB derives parameters for certain types, e.g. u and v. This may surprise users and I implemented a feature checking whether the returned data (in a subset of the very first requested data chunk), is matching what the user expects by iterating all parameters and check them against the parameters in the view definition.
117dffa to
5c2b8f1
Compare
Shortened FDB name in docs for consistency. Also moved indices page away from the main page to its own header section entry
The builder was moving content and this caused a nullptr issue to arise on the second call of build. This addresses the fix for the issue.
a2095ef to
b4e1e36
Compare
92fa553 to
41278f8
Compare
Description
Further refactoring and Zarr API conformity alignment. Also restructured tests, as they became a bit disordered.
Contributor Declaration
By opening this pull request, I affirm the following:
🌈🌦️📖🚧 Documentation FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/fdb/pull-requests/PR-302