Context
rslearn internally names layer groups using the convention:
- First group:
{layer_name} (no suffix)
- Subsequent groups:
{layer_name}.{index} (e.g. sentinel2_l2a.1, sentinel2_l2a.2)
This naming logic lives inside rslearn's storage layer but isn't exposed as a public utility. Downstream consumers (like olmoearth_run) that need to reference layer names by index currently have to duplicate this naming pattern, creating a fragile coupling.
The layer names are needed in the model data module config to tell the DataModule which dataset layers to load as inputs. The dataset transpiler creates layers with these names (via DataSourceConfig with min/max matches), and rslearn names the resulting layer directories using the .{index} convention internally. The model config side needs to enumerate those same names without having a materialized dataset to inspect.
Proposal
Add a small public helper function, something like:
# rslearn/utils/naming.py (or similar)
def layer_group_name(prefix: str, group_index: int) -> str:
"""Canonical layer name for a given group index within a multi-match layer."""
return prefix if group_index == 0 else f"{prefix}.{group_index}"
This would let both rslearn internals and consumers use the same source of truth for this naming convention.
Current workaround
# olmoearth_run/runner/tools/olmoearth_config/transpilers/model/data.py
layer_name = layer_prefix if group_idx == 0 else f"{layer_prefix}.{group_idx}"
Context
rslearn internally names layer groups using the convention:
{layer_name}(no suffix){layer_name}.{index}(e.g.sentinel2_l2a.1,sentinel2_l2a.2)This naming logic lives inside rslearn's storage layer but isn't exposed as a public utility. Downstream consumers (like olmoearth_run) that need to reference layer names by index currently have to duplicate this naming pattern, creating a fragile coupling.
The layer names are needed in the model data module config to tell the DataModule which dataset layers to load as inputs. The dataset transpiler creates layers with these names (via DataSourceConfig with min/max matches), and rslearn names the resulting layer directories using the
.{index}convention internally. The model config side needs to enumerate those same names without having a materialized dataset to inspect.Proposal
Add a small public helper function, something like:
This would let both rslearn internals and consumers use the same source of truth for this naming convention.
Current workaround