Commit ae6fc19
authored
Fix label_override when forcing_loader not given labels (ai2cm#977)
During ace inference data loading, if forcing_loader does not have
labels set, label_override breaks due to the lack of a label_encoding in
the forcing dataset (see [beaker
log](https://beaker.org/orgs/ai2/workspaces/ace/work/01KKN10MF6Q1NJJFE10GT099X4/logs?jobId=01KKN10MS6DX9GC4VFKHQ32J0T)).
This PR resolves the issue by using label_override to define the
label_encoding when it is used. This avoids the awkward position of
needing to set both the label at the highest level of InferenceConfig
and in the forcing dataset.
What this PR doesn't address is the potential misconfiguration of labels
in `InferenceConfig` is set to ERA5, but the forcing dataset label was
mistakenly set to a different label. We should address this in a future
PR.
Changes:
- Create a `LabelEncoding` if the dataset label isn't set but the
`label_override` is not None
- Add test to `test_data_loader.py`
- [x] Tests added1 parent e709930 commit ae6fc19
2 files changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
965 | 990 | | |
966 | 991 | | |
967 | 992 | | |
| |||
0 commit comments