Skip to content

Commit e314bee

Browse files
authored
AP66 - docs update (#43)
* doc updates * version bump
1 parent 13d7de7 commit e314bee

4 files changed

Lines changed: 69 additions & 7 deletions

File tree

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ The versioning pattern is `YYYY.MM.DD.micro(a/b/{none if release})
88

99
---
1010

11+
## [2025.11.18.0a]
12+
13+
### Updated
14+
15+
- `docs/data_user_guide.md` and added cli documentation to mkdocs nav.
16+
1117
## [2025.11.13.0a]
1218

1319
### Added

docs/data_user_guide.md

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ df = datacat.private.scenarios.covid19vax_trends.load.get_dataframe(
5757
)
5858
```
5959

60-
In order to see what versions are available, use the data catalog's convenient namespace methods:
60+
To see what versions are available, use the data catalog's convenient namespace methods:
6161

6262
```python
6363
>>> from cfa.dataops import datacat
64-
>>> # these follow hierarchical naming created using the dataset
65-
>>> # config TOML, so extract or load are the makes assigned to
64+
>>> # These follow hierarchical naming created using the dataset
65+
>>> # config TOML, so extract or load are the names assigned to
6666
>>> # raw or transformed datasets per the get_data function
6767
>>> datacat.private.scenarios.covid19vax_trends.load.get_versions()
6868
['2025-06-03T17-59-16',
@@ -94,13 +94,68 @@ vax_df = datacat.private.scenarios.covid19vax_trends.load.get_dataframe()
9494
raw_vax = datacat.private.scenarios.covid19vax_trends.extract.get_dataframe()
9595
```
9696

97-
### Seroprevalence Data
97+
### Fetching Versions within a Range
98+
99+
When `get_dataframe(...)` completes successfully, it prints a short confirmation line like:
100+
101+
Used version(s): [...]
102+
103+
Examples:
98104

99105
```python
100106
from cfa.dataops import datacat
101107

102-
# Get as polars DataFrame
103-
sero_df = datacat.private.scenarios.seroprevalence.load.get_dataframe(output="polars")
108+
# newest match in the range (single version)
109+
df = datacat.private.scenarios.covid19vax_trends.load.get_dataframe(
110+
version=">=2025-05-01,<2025-06-01"
111+
)
112+
```
113+
114+
*Console output (example):*
115+
```
116+
Used version(s): '2025-05-30T19-55-51'
117+
```
118+
119+
```python
120+
# oldest match in the same range (newest=False)
121+
df_old = datacat.private.scenarios.covid19vax_trends.load.get_dataframe(
122+
version=">=2025-05-01,<2025-06-01", newest=False
123+
)
124+
```
125+
126+
*Console output (example):*
127+
```
128+
Used version(s): '2025-05-30T14-50-36'
129+
```
130+
131+
```python
132+
# Fetch all matches and concatenate all tables
133+
df_v = datacat.private.scenarios.covid19vax_trends.load.get_dataframe(
134+
version=">=2025-05-01,<2025-06-01",
135+
newest=None
136+
)
137+
```
138+
139+
*Console output (example):*
140+
```
141+
Used version(s): ['2025-05-30T19-55-51', '2025-05-30T14-50-36']
142+
```
143+
144+
Use the helper `version_matcher` (from `cfa.dataops.utils`) to experiment with version boundary logic to see what matches occur prior to loading large datasets into memory.
145+
146+
```python
147+
>>> from cfa.dataops.utils import version_matcher
148+
>>> available_versions = ['1.0', '1.1', '1.2', '2.0']
149+
>>> version_matcher('>=1.1,<2.0', available_versions)
150+
'1.2'
151+
>>> version_matcher('>=1.1,<2.0', available_versions, newest=False)
152+
'1.1'
153+
>>> version_matcher('latest', available_versions)
154+
'2.0'
155+
>>> version_matcher('~=1', available_versions)
156+
'1.2'
157+
>>> version_matcher('>=1.1,<2.0', available_versions, newest=None)
158+
['1.2', '1.1']
104159
```
105160

106161
## Common Issues

mkdocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ nav:
77
- data_user_guide.md
88
- data_developer_guide.md
99
- report_generation.md
10+
- cli_tools.md
1011

1112
repo_url: https://github.com/cdcgov/cfa-dataops
1213
repo_name: cfa-dataops

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cfa.dataops"
3-
version = "2025.11.13.0a"
3+
version = "2025.11.18.0a"
44
description = "Data cataloging, ETL, modeling, verification, and validation for CFA"
55
authors = [
66
{ name = "Phil Rogers", email = "ap66@cdc.gov" },

0 commit comments

Comments
 (0)