-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test that confirms config files with 1 target_keys key value pair…
… do not pass validation. Resolves #89
- Loading branch information
1 parent
ac8f7bc
commit fec895a
Showing
2 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
tests/testthat/testdata/v4.0.1-tasks-2-target_keys.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
{ | ||
"schema_version": "https://raw.githubusercontent.com/hubverse-org/schemas/main/v4.0.1/tasks-schema.json", | ||
"rounds": [{ | ||
"round_id_from_variable": true, | ||
"round_id": "forecast_date", | ||
"model_tasks": [{ | ||
"task_ids": { | ||
"forecast_date": { | ||
"required": null, | ||
"optional": [ | ||
"2022-12-12", "2022-12-19", "2022-12-26", "2023-01-02", "2023-01-09", | ||
"2023-01-16", "2023-01-23", "2023-01-30", "2023-02-06", "2023-02-13", | ||
"2023-02-20", "2023-02-27", "2023-03-06", "2023-03-13", "2023-03-20", | ||
"2023-03-27", "2023-04-03", "2023-04-10", "2023-04-17", "2023-04-24", | ||
"2023-05-01" | ||
] | ||
}, | ||
"target": { | ||
"required": null, | ||
"optional": ["wk ahead inc"] | ||
}, | ||
"target_metric": { | ||
"required": null, | ||
"optional": ["flu hosp"] | ||
}, | ||
"horizon": { | ||
"required": [2], | ||
"optional": [1] | ||
}, | ||
"location": { | ||
"required": ["US"], | ||
"optional": [ | ||
"01", | ||
"02" | ||
] | ||
}, | ||
"target_date": { | ||
"required": null, | ||
"optional": [ | ||
"2022-12-19", "2022-12-26", "2023-01-02", "2023-01-09", | ||
"2023-01-16", "2023-01-23", "2023-01-30", "2023-02-06", "2023-02-13", | ||
"2023-02-20", "2023-02-27", "2023-03-06", "2023-03-13", "2023-03-20", | ||
"2023-03-27", "2023-04-03", "2023-04-10", "2023-04-17", "2023-04-24", | ||
"2023-05-01", "2023-05-08", "2023-05-15" | ||
] | ||
} | ||
}, | ||
"output_type": { | ||
"sample": { | ||
"output_type_id_params": { | ||
"type": "character", | ||
"min_samples_per_task": 50, | ||
"max_samples_per_task": 100, | ||
"max_length": 10 | ||
}, | ||
"is_required": true, | ||
"value": { | ||
"type": "integer", | ||
"minimum": 0 | ||
} | ||
}, | ||
"mean": { | ||
"output_type_id": { | ||
"required": null | ||
}, | ||
"is_required": true, | ||
"value": { | ||
"type": "double", | ||
"minimum": 0 | ||
} | ||
} | ||
}, | ||
"target_metadata": [{ | ||
"target_id": "wk ahead inc flu hosp", | ||
"target_name": "weekly influenza hospitalization incidence", | ||
"target_units": "rate per 100,000 population", | ||
"target_keys": { | ||
"target": "wk ahead inc", | ||
"target_metric": "flu hosp" | ||
}, | ||
"target_type": "discrete", | ||
"description": "This target represents the counts of new hospitalizations per horizon week.", | ||
"is_step_ahead": true, | ||
"time_unit": "week" | ||
}] | ||
}, { | ||
"task_ids": { | ||
"forecast_date": { | ||
"required": null, | ||
"optional": [ | ||
"2022-12-12", "2022-12-19", "2022-12-26", "2023-01-02", "2023-01-09", | ||
"2023-01-16", "2023-01-23", "2023-01-30", "2023-02-06", "2023-02-13", | ||
"2023-02-20", "2023-02-27", "2023-03-06", "2023-03-13", "2023-03-20", | ||
"2023-03-27", "2023-04-03", "2023-04-10", "2023-04-17", "2023-04-24", | ||
"2023-05-01" | ||
] | ||
}, | ||
"target": { | ||
"required": null, | ||
"optional": ["wk flu hosp"] | ||
}, | ||
"target_metric": { | ||
"required": null, | ||
"optional": ["rate change"] | ||
}, | ||
"horizon": { | ||
"required": [2], | ||
"optional": [1] | ||
}, | ||
"location": { | ||
"required": ["US"], | ||
"optional": [ | ||
"01", | ||
"02" | ||
] | ||
}, | ||
"target_date": { | ||
"required": null, | ||
"optional": [ | ||
"2022-12-19", "2022-12-26", "2023-01-02", "2023-01-09", | ||
"2023-01-16", "2023-01-23", "2023-01-30", "2023-02-06", "2023-02-13", | ||
"2023-02-20", "2023-02-27", "2023-03-06", "2023-03-13", "2023-03-20", | ||
"2023-03-27", "2023-04-03", "2023-04-10", "2023-04-17", "2023-04-24", | ||
"2023-05-01", "2023-05-08", "2023-05-15" | ||
] | ||
} | ||
}, | ||
"output_type": { | ||
"pmf": { | ||
"output_type_id": { | ||
"required": ["large_decrease", "decrease", "stable", "increase", "large_increase"] | ||
}, | ||
"is_required": false, | ||
"value": { | ||
"type": "double", | ||
"minimum": 0, | ||
"maximum": 1 | ||
} | ||
} | ||
}, | ||
"target_metadata": [{ | ||
"target_id": "wk flu hosp rate change", | ||
"target_name": "weekly influenza hospitalization rate change", | ||
"target_units": "rate per 100,000 population", | ||
"target_keys": { | ||
"target": "wk flu hosp", | ||
"target_metric": "rate change" | ||
}, | ||
"target_type": "nominal", | ||
"description": "This target represents the change in the rate of new hospitalizations per week comparing the week ending two days prior to the forecast_date to the week ending h weeks after the forecast_date.", | ||
"is_step_ahead": true, | ||
"time_unit": "week" | ||
}] | ||
}], | ||
"submissions_due": { | ||
"relative_to": "forecast_date", | ||
"start": -6, | ||
"end": 2 | ||
}, | ||
"derived_task_ids": ["target_date"] | ||
} | ||
|
||
] | ||
} |