Here we're adding a new function that inspects a hub's tasks.json and returns a dictionary of task_ids and their possible values. This is information we'll need to determine the schema of the model_output file.
Next step:
Do the same thing, except for output_type_ids, which are configured a bit differently
Here's what it looks like in action:
In [1]: from cloudpathlib import AnyPath
In [2]: from hubverse_transform.hub_config import HubConfig
In [3]: hub_path = AnyPath('s3://bsweger-flusight-forecast')
In [4]: hc = HubConfig(hub_path)
In [5]: task_id_values = hc.get_task_id_values()
In [6]: task_id_values.keys()
Out[6]: dict_keys(['reference_date', 'target', 'horizon', 'location', 'target_end_date'])
In [7]: task_id_values['horizon']
Out[7]: {-1, 0, 1, 2, 3}
In [8]: task_id_values['target']
Out[8]: {'wk flu hosp rate change', 'wk inc flu hosp'}
Next piece of the work for #14
Here we're adding a new function that inspects a hub's
tasks.json
and returns a dictionary oftask_id
s and their possible values. This is information we'll need to determine the schema of the model_output file.Next step: Do the same thing, except for
output_type_id
s, which are configured a bit differentlyHere's what it looks like in action: