Skip to content

Allow a separate store root for each modality - #26

Merged
MWesselkamp merged 3 commits into
developfrom
rz/modality-store-roots
Nov 23, 2026
Merged

MWesselkamp merged 3 commits into
developfrom
rz/modality-store-roots

Conversation

@Raminyazdani

@Raminyazdani Raminyazdani commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Related to #24 and #17.

The store and preload cache paths are now in conf/paths.yaml. Set eozarr_root for the shared store directory, and use store_roots for a modality that needs a different directory.

store_roots:
  seviri: /data/deep_lst

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.

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.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 23:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@MWesselkamp MWesselkamp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@Raminyazdani

Copy link
Copy Markdown
Collaborator Author

Thanks, Marieke! I moved the data and cache paths to conf/paths.yaml and kept the option to use a different root for each modality. Is this what you had in mind? Here's the updated commit.

Comment thread deep_lst/utils/io.py
)


def _preload_cache_root(settings: dict) -> Path:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above, do we still need PATHS?

@MWesselkamp
MWesselkamp merged commit 903abfa into develop Nov 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants