@@ -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()
9494raw_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
100106from 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
0 commit comments