Repository navigation
Allow a separate store root for each modality - #26
Conversation
Read optional sources.<modality>.store_root through the existing path resolver. Forward it to dataset, statistics and baseline metadata readers. Keep the shared-root fallback and directory/ZIP selection unchanged. Include explicit modality roots in preload cache keys so changing roots cannot return data cached from another location. Keep existing default cache keys and scientific settings unchanged. Add focused path, config, cache and reader-forwarding regressions.
Document the optional source setting, its shared-root fallback and Hydra syntax. Explain when explicit modality roots separate preload caches.
MWesselkamp
left a comment
There was a problem hiding this comment.
The approach is working for this isolated task, but it overlooks the long-term change: The explicit paths should be moved out of io.py, and also out of the modality yaml files into a dedicated conf/paths.yaml. This will allow to just modify hide the path.yaml, and remove any other specification of the local file systems.
Please confirm that either, this isolated feature is necessary to move toward the above feature as a next step, or revise accordingly.
Load the same paths for the existing reading commands, with an optional root per modality. Keep the previous BGC defaults and existing preload keys when the default stores are used. Keep reading older saved store_root overrides and ship paths.yaml in the wheel for callers outside the checkout.
|
Thanks, Marieke! I moved the data and cache paths to |
| ) | ||
|
|
||
|
|
||
| def _preload_cache_root(settings: dict) -> Path: |
There was a problem hiding this comment.
I would like to change this such that we also set this path manually in the paths.yaml
| def from_config(cls, modality, store, spatial, anchor, temporal, workers=1, store_root=None, paths=None): | ||
| """Stream the MTG pixel selection (spatial) over the statistics timestep subset (temporal).""" | ||
| anchor_ids = _load_anchor_ids(spatial) | ||
| paths = paths or PATHS |
There was a problem hiding this comment.
do we still need PATHS?
| accepted = inspect.signature(get_data_reader_class(modality)).parameters | ||
| reader_kwargs = {key: value for key, value in reader_kwargs.items() if key in accepted} | ||
| return eodata.get_data_reader(modality, store=str(PATHS.eozarr_store_path(store)), **reader_kwargs) | ||
| store_path = PATHS.eozarr_store_path(store, PATHS.store_roots.get(modality)) |
There was a problem hiding this comment.
see above, do we still need PATHS?
Related to #24 and #17.
The store and preload cache paths are now in
conf/paths.yaml. Seteozarr_rootfor the shared store directory, and usestore_rootsfor a modality that needs a different directory.Here SEVIRI uses the separate directory and the other modalities use the shared root. Training, fine-tuning, inference, sensitivity, statistics and baseline generation all read the shared config. The existing defaults and default cache keys are kept. When changing the shared store root, use a separate preload cache.
Local checks: 248 tests passed and 2 were skipped. I also checked that a small cache made with the earlier version was still read with the same values, and that the wheel includes the paths file. These checks used local fixtures.