Skip to content

Commit ce8afea

Browse files
committed
Update docs
1 parent 7123331 commit ce8afea

5 files changed

Lines changed: 160 additions & 310 deletions

File tree

README.md

Lines changed: 2 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -39,85 +39,14 @@ Read the [Dataset User Guide](docs/dataset_user.md) for more information about a
3939

4040
Read the [Dataset Developer Guide](docs/dataset_developer.md) for information about how to run ETL to add new versions of an existing datasets and about how to create new datasets.
4141

42-
2. Install dependencies (**requires: `poetry >= 2.0`**):
43-
```
44-
poetry install
45-
```
46-
3. Example: run the COVID-19 vaccination trends ETL pipeline, with extraction, raw data schema validation (-v) and transformed data validation (-t).
47-
```
48-
python -m cfa.dataops.etl.covid19vax_trends --extract -v -t
49-
```
50-
4. [Optional] installing developer dependencies:
51-
```
52-
poetry install --with dev
53-
```
54-
55-
To add a new dataset:
56-
57-
1. Create a new TOML configuration file in `cfa/dataops/datasets/{team_dir}/`
58-
2. Create a new ETL script in `cfa/dataops/etl/{team_dir}/`
59-
3. Add SQL transformation templates in `cfa/dataops/etl/transform_templates/{team_dir}/` (is using SQL for transforms). These are [Mako templates](https://www.makotemplates.org/)
60-
61-
## Deep Dive Documentation
62-
63-
- [Dataset Developer Guide](docs/dataset_developer.md)
64-
- [Dataset User Guide](docs/dataset_user.md)
65-
66-
## Accessing Datasets
67-
68-
When the ETL pipelines are run, the data sources (raw and/or transformed) are stored into Azure Blob Storage. There will be times when we want to access these datasets directly. The function `get_data()` found in `cfa.dataops.datasets.catalog` helps retrieve that data, compile into a single dataframe, and return that dataframe. The parameters for `get_data()` are as follows:
69-
70-
- name: the name of the data source
71-
- version: either 'latest' or string containing the datetime of required version. Default is 'latest'.
72-
- type: either 'raw' or 'transformed'. Default is 'transformed'.
73-
- output: the type of dataframe to output, either 'pandas' or 'polars'. Default is 'pandas'.
74-
75-
The available datasets can be found by running `list_datasets()`, which can be found in the `cfa.dataops.catalog` submodule.
76-
77-
An example for getting the polars dataframes for the latest raw versions of the covid19vax_trends and seroprevalence datasets is below:
78-
79-
```python
80-
from cfa.dataops import get_data
81-
vax_df = get_data("scenarios.covid19vax_trends", type = "transformed", output = "polars")
82-
sero_df = get_data("scenarios.seroprevalence", type = "transformed", output = "polars")
83-
```
84-
85-
## Running Workflows
86-
87-
This `cfa.dataops` repository contains a `workflows` module. The following workflows are currently available:
88-
89-
- covid
90-
91-
Workflows can be run in a python virtual environment terminal where `cfa.dataops` is installed with the following format:
92-
93-
```bash
94-
python3 -m cfa.dataops.workflows.<name>.<module> --<args>
95-
```
96-
97-
### Covid Workflow
98-
99-
There are two modules to the covid workflow with the following optional command line arguments:
100-
101-
- generate_data (this must be run before the next module)
102-
- -p, --path: path to store generated data; default is covid/data. Not needed if -b flag is used.
103-
- -b, --blob: whether to store generated data to Blob Storage (flag)
104-
- run:
105-
- -c, --config: path to intialization config
106-
- -b, --blob: whether to pull from and push prepped data to Blob Storage (flag)
107-
108-
Ex:
109-
110-
```bash
111-
python3 -m cfa.dataops.workflows.covid.generate_data -b
112-
python3 -m cfa.dataops.workflows.covid.run -b
113-
```
114-
11542
## Project admins
11643

11744
- Thomas Hladish <utx5@cdc.gov> (CDC/OD/ORR/CFA)
11845
- Phillip Rogers <ap66@cdc.gov> (CDC/OD/ORR/CFA)(CTR)
11946
- Ryan Raasch <xng3@cdc.gov> (CDC/OD/ORR/CFA)(CTR)
12047

48+
---
49+
12150
## Disclaimers
12251

12352
### General Disclaimer

0 commit comments

Comments
 (0)