You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+186Lines changed: 186 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,193 @@ We have made changes from previous versions of the [COVID-19 Forecast Hub](https
97
97
Both Hubs will require quantile-based forecasts of epiweekly incident hospital admissions reported into NHSN, with the same -1:3 week horizon span. Both will accept these forecasts via Github pull requests of files formatted according to the standard [hubverse schema](https://hubverse.io/en/latest/user-guide/model-output.html#model-output). The Hubs also plan to share a forecast deadline of 11pm USA/Eastern time on Wednesdays.
98
98
99
99
100
+
101
+
102
+
## Accessing COVID-19 Data On The Cloud
103
+
104
+
To ensure greater access to the data created by and submitted to this hub, real-time copies of files in the following directories are hosted on the Hubverse's Amazon Web Services (AWS) infrastructure, in a public S3 bucket: `covid19-forecast-hub`.
105
+
106
+
-`auxiliary-data`
107
+
-`hub-config`
108
+
-`model-metadata`
109
+
-`model-output`
110
+
-`target-data`
111
+
112
+
GitHub remains the primary interface for operating the COVID-19 Forecast Hub and collecting forecasts from modelers. However, the mirrors of hub files on S3 are the most convenient way to access hub data without using `git`/GitHub or cloning the entire hub to your local machine.
113
+
114
+
The sections below provide examples for accessing hub data on the cloud, depending on your goals and
| hubData (R) | Hubverse R client and R code for accessing hub data. |
120
+
| hub-data (Python) | Python package for working with hubverse data |
121
+
| AWS command line interface | Download data and use hubData, Pyarrow, or another tool for fast local access. |
122
+
123
+
In general, accessing the data directly from S3 (instead of downloading it first) is more convenient. However, if performance is critical (for example, you're building an interactive visualization), or if you need to work offline, we recommend downloading the data first.
124
+
125
+
<detailsmarkdown=1>
126
+
127
+
<summary>hubData (R)</summary>
128
+
129
+
[hubData](https://hubverse-org.github.io/hubData), the Hubverse R client, can create an interactive session for accessing, filtering, and transforming hub model output data stored in S3.
130
+
131
+
hubData is a good choice if you:
132
+
133
+
- already use R for data analysis
134
+
- want to interactively explore hub data from the cloud without downloading it
135
+
- want to save a subset of the hub's data (*e.g.*, forecasts for a specific date or target) to your local machine
136
+
- want to save hub data in a different file format (*e.g.*, `.parquet` to `.csv`)
137
+
138
+
### Installing hubData
139
+
140
+
To install `hubData` and its dependencies (including the `dplyr` and `arrow` packages), follow the [instructions in the hubData documentation](https://hubverse-org.github.io/hubData/#installation).
141
+
142
+
### Using hubData
143
+
144
+
hubData's [`connect_hub()` function](https://hubverse-org.github.io/hubData/reference/connect_hub.html) returns an [Arrow multi-file dataset](https://arrow.apache.org/docs/r/reference/Dataset.html) that represents a hub's model output data. The dataset can be filtered and transformed using dplyr and then materialized into a local data frame using the [`collect_hub()` function](https://hubverse-org.github.io/hubData/reference/collect_hub.html).
145
+
146
+
#### Accessing Model Output Data
147
+
148
+
Use hubData to connect to a hub on S3 and retrieve all model-output files into a local dataframe. (note: depending on the size of the hub, this operation will take a few minutes):
The Hubverse team is developing a Python client which provides some initial tools for accessing Hubverse data. The repository is located at <https://github.com/hubverse-org/hub-data>.
185
+
186
+
187
+
### Installing hub-data
188
+
189
+
Use `pip` to install `hub-data` (the `pypi` package is <https://pypi.org/project/hubdata>):
190
+
191
+
```sh
192
+
pip install hubdata
193
+
```
194
+
195
+
### Using hub-data
196
+
197
+
Please see the [hub-data package documentation](https://hubverse-org.github.io/hub-data) for examples of how to use the CLI, and the `hubdata.connect_hub()` and `hubdata.create_hub_schema()` functions.
198
+
199
+
</details>
200
+
201
+
202
+
<detailsmarkdown=1>
203
+
204
+
<summary>AWS CLI</summary>
205
+
206
+
AWS provides a terminal-based command line interface (CLI) for exploring and downloading S3 files.
207
+
208
+
This option is ideal if you:
209
+
210
+
- plan to work with hub data offline but don't want to use git or GitHub
211
+
- want to download a subset of the data (instead of the entire hub)
212
+
- are using the data for an application that requires local storage or fast response times
213
+
214
+
### Installing AWS CLI
215
+
216
+
- Install the AWS CLI using the [instructions here](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
217
+
- You can skip the instructions for setting up security credentials, since Hubverse data is public
218
+
219
+
### Using AWS CLI
220
+
221
+
When using the AWS CLI, the `--no-sign-request` option is required, since it tells AWS to bypass a credential check
222
+
(*i.e.*, `--no-sign-request` allows anonymous access to public S3 data).
223
+
224
+
> [!NOTE]
225
+
>
226
+
> Files in the bucket's `raw` directory should not be used for analysis (they're for internal use only).
227
+
228
+
List all directories in the hub's S3 bucket:
229
+
230
+
```sh
231
+
aws s3 ls covid19-forecast-hub --no-sign-request
232
+
```
233
+
234
+
List all files in the hub's bucket:
235
+
236
+
```sh
237
+
aws s3 ls covid19-forecast-hub --recursive --no-sign-request
238
+
```
239
+
240
+
Download all of target-data contents to your current working directory:
-[Full documentation for `aws s3 ls`](https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html)
253
+
-[Full documentation for `aws s3 cp`](https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html)
254
+
255
+
</details>
256
+
257
+
## Using Hub Data In Downstream Products
258
+
259
+
If you are building a product (e.g., a dashboard, analysis pipeline, or evaluation) downstream of `covid19-forecast-hub` that uses data from this hub, please follow the guidance in this section.
260
+
261
+
### Prefer Hubverse Tooling Over Direct File Paths
262
+
263
+
We recommend accessing hub data through official [hubverse](https://hubverse.io) tooling rather than by hard-coding paths into this repository's file tree. The hubverse R and Python packages (e.g., [`hubData`](https://hubverse-org.github.io/hubData/) and [`hub-data`](https://github.com/hubverse-org/hub-data)) provide interfaces to the COVIDHub model output, target data, and model metadata, which all follow the [hubverse schema](https://hubverse.io/en/latest/user-guide/model-output.html#model-output).
264
+
265
+
### Hubverse schema version
266
+
The specific version of the Hubverse schema currently used by the Hub is specified in the Hub's [`admin.json`](hub-config/admin.json) file. We notify users in advance of planned schema version update.
267
+
268
+
### File Structure And Guarantees
269
+
270
+
> [!WARNING]
271
+
>
272
+
> The layout of this repository is **not a stable public API**. Directories, file names, and schemas outside the hubverse-managed paths may change at any time, possibly without formal notice.
273
+
274
+
Specifically:
275
+
276
+
- Hubverse-managed directories (`model-output/`, `model-metadata/`, `target-data/`, `hub-config/`) follow the [hubverse schema](https://hubverse.io/en/latest/user-guide/model-output.html#model-output). Changes here are guided by hubverse conventions; we will communicate planned changes in advance.
277
+
-`auxiliary-data/` is a catch-all for supporting files (e.g., location tables, raw NSSP snapshots, weekly submission summaries). Files within have no formal schema and no guarantee of consistency across time (e.g. they may be renamed, restructured, or removed). Please do not rely on specific filenames or columns in `auxiliary-data/`.
278
+
279
+
If you need a file only available through `auxiliary-data/` for a downstream product, please [open an issue](https://github.com/CDCgov/covid19-forecast-hub/issues) with your use case so we can consider making its presence more stable.
280
+
281
+
### Following Changes
282
+
283
+
If you maintain a downstream product and want to be notified of planned changes to hub data or structure, please email [covidhub@cdc.gov](mailto:covidhub@cdc.gov) to be added to our announcement list.
284
+
100
285
## Acknowledgments
286
+
101
287
This repository follows the guidelines and standards outlined by the [hubverse](https://hubdocs.readthedocs.io/en/latest/), which provides a set of data formats and open source tools for modeling hubs.
0 commit comments