CliMA / CliMA/ClimaCalibrate.jl

`OutputVar` Identifiers, and easy per-variable API for CovarEstimator

Open
#369 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
6
Forks
2
Avg merge
2d 7h
Merged PRs (30d)
10

Description

## Issue
Currently, `OutputVar`s contain identifiers (e.g. variable names) but once stacked in a `SampleCollection` this ID is lost, therefore, when we draw functions that have dependence on the `OutputVar`(OV), say `CovarEstimator`, we must pass in information that depends on ordering of OV in the sample collection, e.g.
```julia
CovarEstimator(
vec_of_modifiers = v1, # e.g. whether to use latitude weightings
vec_of_other_modifiers =v2, # e.g. a scaling per `OutputVar`
sample_modifier = 2.0, # const applied to all `OutputVar`s in the `SampleCollection`
)
```
This is ripe for confusion

## Possible Solution

1. Impose that identifiers/names must exist and be unique for rows in a sample-collection. A first convention might be `variable_(spatial statistic)_(time statistic)` (for example, `T_field_season`, `T_field_month`,`T_global_month`, `rh_global_season`)
2. Then API for per-variable scalings can be provided per-output-var id;
```julia
per_var_modifier = Dict(
T_field_season => (mod1,mod2), # define modifiers per ID
T_field_month => (mod1,mod2),
T_global_month => (mod1, mod2),
rh_global_season => (mod1,mod2),
)

CovarEstimator(
per_var_modifier = per_var_modifier,
sample_modifier = 2.0
)
```
Note this opens the door in future to more complex modifiers too

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing OutputVar identifiers through SampleCollection and the CovarEstimator entry point; the issue names no files or tests. Determine how identifiers are currently stored or discarded, then clarify the naming, uniqueness, and per-variable modifier API before implementing it, with completion defined by working identifier-based covariance configuration and corresponding tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.