@@ -23,7 +23,17 @@ def test_pvt_cdc() -> None:
23
23
)
24
24
data = apicall .df ()
25
25
assert len (data ) > 0
26
+ assert str (data ['location' ].dtype ) == 'string'
26
27
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
28
+ assert str (data ['num1' ].dtype ) == 'int64'
29
+ assert str (data ['num2' ].dtype ) == 'int64'
30
+ assert str (data ['num3' ].dtype ) == 'int64'
31
+ assert str (data ['num4' ].dtype ) == 'int64'
32
+ assert str (data ['num5' ].dtype ) == 'int64'
33
+ assert str (data ['num6' ].dtype ) == 'int64'
34
+ assert str (data ['num7' ].dtype ) == 'int64'
35
+ assert str (data ['num8' ].dtype ) == 'int64'
36
+ assert str (data ['total' ].dtype ) == 'int64'
27
37
28
38
def test_pub_covid_hosp_facility_lookup () -> None :
29
39
apicall = Epidata .pub_covid_hosp_facility_lookup (state = "fl" )
@@ -33,13 +43,35 @@ def test_pub_covid_hosp_facility_lookup() -> None:
33
43
apicall = Epidata .pub_covid_hosp_facility_lookup (city = "southlake" )
34
44
data = apicall .df ()
35
45
assert len (data ) > 0
46
+ assert str (data ['hospital_pk' ].dtype ) == 'string'
47
+ assert str (data ['state' ].dtype ) == 'string'
48
+ assert str (data ['ccn' ].dtype ) == 'string'
49
+ assert str (data ['hospital_name' ].dtype ) == 'string'
50
+ assert str (data ['address' ].dtype ) == 'string'
51
+ assert str (data ['city' ].dtype ) == 'string'
52
+ assert str (data ['zip' ].dtype ) == 'string'
53
+ assert str (data ['hospital_subtype' ].dtype ) == 'string'
54
+ assert str (data ['fip_code' ].dtype ) == 'float64'
55
+ assert str (data ['is_metro_micro' ].dtype ) == 'int64'
36
56
37
57
def test_pub_covid_hosp_facility () -> None :
38
58
apicall = Epidata .pub_covid_hosp_facility (
39
59
hospital_pks = "100075" ,
40
60
collection_weeks = EpiRange (20200101 , 20200501 ))
41
61
data = apicall .df ()
42
62
assert len (data ) > 0
63
+ assert str (data ['hospital_pk' ].dtype ) == 'string'
64
+ assert str (data ['state' ].dtype ) == 'string'
65
+ assert str (data ['ccn' ].dtype ) == 'string'
66
+ assert str (data ['hospital_name' ].dtype ) == 'string'
67
+ assert str (data ['address' ].dtype ) == 'string'
68
+ assert str (data ['city' ].dtype ) == 'string'
69
+ assert str (data ['zip' ].dtype ) == 'string'
70
+ assert str (data ['hospital_subtype' ].dtype ) == 'string'
71
+ assert str (data ['fips_code' ].dtype ) == 'string'
72
+ assert str (data ['publication_date' ].dtype ) == 'datetime64[ns]'
73
+ assert str (data ['collection_week' ].dtype ) == 'datetime64[ns]'
74
+ assert str (data ['is_metro_micro' ].dtype ) == 'bool'
43
75
44
76
apicall = Epidata .pub_covid_hosp_facility (
45
77
hospital_pks = "100075" ,
@@ -53,13 +85,28 @@ def test_pub_covid_hosp_state_timeseries() -> None:
53
85
dates = EpiRange (20200101 , 20200501 ))
54
86
data = apicall .df ()
55
87
assert len (data ) > 0
88
+ assert str (data ['state' ].dtype ) == 'string'
56
89
assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
57
90
assert str (data ['date' ].dtype ) == 'datetime64[ns]'
58
91
59
92
def test_pub_covidcast_meta () -> None :
60
93
apicall = Epidata .pub_covidcast_meta ()
61
94
data = apicall .df ()
62
95
assert len (data ) > 0
96
+ assert str (data ['data_source' ].dtype ) == 'string'
97
+ assert str (data ['signal' ].dtype ) == 'string'
98
+ assert str (data ['time_type' ].dtype ) == 'category'
99
+ assert str (data ['min_time' ].dtype ) == 'datetime64[ns]'
100
+ assert str (data ['max_time' ].dtype ) == 'datetime64[ns]'
101
+ assert str (data ['num_locations' ].dtype ) == 'int64'
102
+ assert str (data ['min_value' ].dtype ) == 'float64'
103
+ assert str (data ['max_value' ].dtype ) == 'float64'
104
+ assert str (data ['mean_value' ].dtype ) == 'float64'
105
+ assert str (data ['stdev_value' ].dtype ) == 'float64'
106
+ assert str (data ['last_update' ].dtype ) == 'int64'
107
+ assert str (data ['max_issue' ].dtype ) == 'datetime64[ns]'
108
+ assert str (data ['min_lag' ].dtype ) == 'int64'
109
+ assert str (data ['max_lag' ].dtype ) == 'int64'
63
110
64
111
def test_pub_covidcast () -> None :
65
112
apicall = Epidata .pub_covidcast (
@@ -80,9 +127,20 @@ def test_pub_covidcast() -> None:
80
127
geo_values = "*" ,
81
128
time_values = EpiRange (20200601 , 20200801 ))
82
129
data = apicall .df ()
130
+ print (data .dtypes )
131
+
132
+ assert str (data ['source' ].dtype ) == 'string'
133
+ assert str (data ['signal' ].dtype ) == 'string'
134
+ assert str (data ['geo_type' ].dtype ) == 'category'
135
+ assert str (data ['geo_value' ].dtype ) == 'string'
136
+ assert str (data ['time_type' ].dtype ) == 'category'
83
137
assert str (data ['time_value' ].dtype ) == 'datetime64[ns]'
84
138
assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
85
- assert len (data ) > 0
139
+ assert str (data ['lag' ].dtype ) == 'int64'
140
+ assert str (data ['value' ].dtype ) == 'float64'
141
+ assert str (data ['missing_value' ].dtype ) == 'int64'
142
+ assert str (data ['missing_stderr' ].dtype ) == 'int64'
143
+ assert str (data ['missing_sample_size' ].dtype ) == 'int64'
86
144
87
145
def test_pub_delphi () -> None :
88
146
apicall = Epidata .pub_delphi (
@@ -99,7 +157,10 @@ def test_pub_dengue_nowcast() -> None:
99
157
)
100
158
data = apicall .df ()
101
159
assert len (data ) > 0
160
+ assert str (data ['location' ].dtype ) == 'string'
102
161
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
162
+ assert str (data ['value' ].dtype ) == 'float64'
163
+ assert str (data ['std' ].dtype ) == 'float64'
103
164
104
165
def test_pvt_dengue_sensors () -> None :
105
166
apicall = Epidata .pvt_dengue_sensors (
@@ -110,7 +171,9 @@ def test_pvt_dengue_sensors() -> None:
110
171
)
111
172
data = apicall .df ()
112
173
assert len (data ) > 0
174
+ assert str (data ['location' ].dtype ) == 'string'
113
175
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
176
+ assert str (data ['value' ].dtype ) == 'float64'
114
177
115
178
def test_pub_ecdc_ili () -> None :
116
179
apicall = Epidata .pub_ecdc_ili (
@@ -130,8 +193,17 @@ def test_pub_flusurv() -> None:
130
193
)
131
194
data = apicall .df ()
132
195
assert len (data ) > 0
196
+ assert str (data ['release_date' ].dtype ) == 'string'
197
+ assert str (data ['location' ].dtype ) == 'string'
133
198
assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
134
199
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
200
+ assert str (data ['lag' ].dtype ) == 'int64'
201
+ assert str (data ['rage_age_0' ].dtype ) == 'float64'
202
+ assert str (data ['rage_age_1' ].dtype ) == 'float64'
203
+ assert str (data ['rage_age_2' ].dtype ) == 'float64'
204
+ assert str (data ['rage_age_3' ].dtype ) == 'float64'
205
+ assert str (data ['rage_age_4' ].dtype ) == 'float64'
206
+ assert str (data ['rage_overall' ].dtype ) == 'float64'
135
207
136
208
def test_pub_fluview_clinical () -> None :
137
209
apicall = Epidata .pub_fluview_clinical (
@@ -141,15 +213,24 @@ def test_pub_fluview_clinical() -> None:
141
213
data = apicall .df ()
142
214
assert len (data ) > 0
143
215
assert str (data ['release_date' ].dtype ) == 'datetime64[ns]'
216
+ assert str (data ['region' ].dtype ) == 'string'
144
217
assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
145
218
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
219
+ assert str (data ['lag' ].dtype ) == 'int64'
220
+ assert str (data ['total_specimens' ].dtype ) == 'int64'
221
+ assert str (data ['total_a' ].dtype ) == 'int64'
222
+ assert str (data ['total_b' ].dtype ) == 'int64'
223
+ assert str (data ['percent_positive' ].dtype ) == 'float64'
224
+ assert str (data ['percent_a' ].dtype ) == 'float64'
225
+ assert str (data ['percent_b' ].dtype ) == 'float64'
146
226
147
227
def test_pub_fluview_meta () -> None :
148
228
apicall = Epidata .pub_fluview_meta ()
149
229
data = apicall .df ()
150
230
assert len (data ) > 0
151
231
assert str (data ['latest_update' ].dtype ) == 'datetime64[ns]'
152
232
assert str (data ['latest_issue' ].dtype ) == 'datetime64[ns]'
233
+ assert str (data ['table_rows' ].dtype ) == 'int64'
153
234
154
235
def test_pub_fluview () -> None :
155
236
apicall = Epidata .pub_fluview (
@@ -159,8 +240,14 @@ def test_pub_fluview() -> None:
159
240
data = apicall .df ()
160
241
assert len (data ) > 0
161
242
assert str (data ['release_date' ].dtype ) == 'datetime64[ns]'
243
+ assert str (data ['region' ].dtype ) == 'string'
162
244
assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
163
245
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
246
+ assert str (data ['lag' ].dtype ) == 'int64'
247
+ assert str (data ['num_ili' ].dtype ) == 'int64'
248
+ assert str (data ['num_patients' ].dtype ) == 'int64'
249
+ assert str (data ['wili' ].dtype ) == 'float64'
250
+ assert str (data ['ili' ].dtype ) == 'float64'
164
251
165
252
def test_pub_gft () -> None :
166
253
apicall = Epidata .pub_gft (
@@ -169,7 +256,9 @@ def test_pub_gft() -> None:
169
256
)
170
257
data = apicall .df ()
171
258
assert len (data ) > 0
259
+ assert str (data ['location' ].dtype ) == 'string'
172
260
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
261
+ assert str (data ['num' ].dtype ) == 'int64'
173
262
174
263
def test_pvt_ght () -> None :
175
264
apicall = Epidata .pvt_ght (
@@ -180,7 +269,9 @@ def test_pvt_ght() -> None:
180
269
)
181
270
data = apicall .df ()
182
271
assert len (data ) > 0
272
+ assert str (data ['location' ].dtype ) == 'string'
183
273
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
274
+ assert str (data ['value' ].dtype ) == 'float64'
184
275
185
276
def test_pub_kcdc_ili () -> None :
186
277
apicall = Epidata .pub_kcdc_ili (
@@ -190,8 +281,11 @@ def test_pub_kcdc_ili() -> None:
190
281
data = apicall .df ()
191
282
assert len (data ) > 0
192
283
assert str (data ['release_date' ].dtype ) == 'datetime64[ns]'
284
+ assert str (data ['region' ].dtype ) == 'string'
193
285
assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
194
286
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
287
+ assert str (data ['lag' ].dtype ) == 'int64'
288
+ assert str (data ['ili' ].dtype ) == 'float64'
195
289
196
290
def test_pvt_meta_norostat () -> None :
197
291
apicall = Epidata .pvt_meta_norostat (
@@ -212,7 +306,9 @@ def test_pub_nidss_dengue() -> None:
212
306
)
213
307
data = apicall .df ()
214
308
assert len (data ) > 0
309
+ assert str (data ['location' ].dtype ) == 'string'
215
310
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
311
+ assert str (data ['count' ].dtype ) == 'int64'
216
312
217
313
def test_pub_nidss_flu () -> None :
218
314
apicall = Epidata .pub_nidss_flu (
@@ -222,8 +318,12 @@ def test_pub_nidss_flu() -> None:
222
318
data = apicall .df ()
223
319
assert len (data ) > 0
224
320
assert str (data ['release_date' ].dtype ) == 'datetime64[ns]'
321
+ assert str (data ['region' ].dtype ) == 'string'
225
322
assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
226
323
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
324
+ assert str (data ['lag' ].dtype ) == 'int64'
325
+ assert str (data ['visits' ].dtype ) == 'int64'
326
+ assert str (data ['ili' ].dtype ) == 'float64'
227
327
228
328
def test_pvt_norostat () -> None :
229
329
apicall = Epidata .pvt_norostat (
@@ -244,7 +344,10 @@ def test_pub_nowcast() -> None:
244
344
)
245
345
data = apicall .df ()
246
346
assert len (data ) > 0
347
+ assert str (data ['location' ].dtype ) == 'string'
247
348
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
349
+ assert str (data ['value' ].dtype ) == 'float64'
350
+ assert str (data ['std' ].dtype ) == 'float64'
248
351
249
352
def test_pub_paho_dengue () -> None :
250
353
apicall = Epidata .pub_paho_dengue (
@@ -254,8 +357,16 @@ def test_pub_paho_dengue() -> None:
254
357
data = apicall .df ()
255
358
assert len (data ) > 0
256
359
assert str (data ['release_date' ].dtype ) == 'datetime64[ns]'
257
- assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
360
+ assert str (data ['region' ].dtype ) == 'string'
361
+ assert str (data ['serotype' ].dtype ) == 'string'
258
362
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
363
+ assert str (data ['issue' ].dtype ) == 'datetime64[ns]'
364
+ assert str (data ['lag' ].dtype ) == 'int64'
365
+ assert str (data ['total_pop' ].dtype ) == 'int64'
366
+ assert str (data ['num_dengue' ].dtype ) == 'int64'
367
+ assert str (data ['num_severe' ].dtype ) == 'int64'
368
+ assert str (data ['num_deaths' ].dtype ) == 'int64'
369
+ assert str (data ['incidence_rate' ].dtype ) == 'float64'
259
370
260
371
def test_pvt_quidel () -> None :
261
372
apicall = Epidata .pvt_quidel (
@@ -265,7 +376,9 @@ def test_pvt_quidel() -> None:
265
376
)
266
377
data = apicall .df ()
267
378
assert len (data ) > 0
379
+ assert str (data ['location' ].dtype ) == 'string'
268
380
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
381
+ assert str (data ['value' ].dtype ) == 'float64'
269
382
270
383
def test_pvt_sensors () -> None :
271
384
apicall = Epidata .pvt_sensors (
@@ -276,7 +389,10 @@ def test_pvt_sensors() -> None:
276
389
)
277
390
data = apicall .df ()
278
391
assert len (data ) > 0
392
+ assert str (data ['name' ].dtype ) == 'string'
393
+ assert str (data ['location' ].dtype ) == 'string'
279
394
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
395
+ assert str (data ['value' ].dtype ) == 'float64'
280
396
281
397
def test_pvt_twitter () -> None :
282
398
apicall = Epidata .pvt_twitter (
@@ -287,7 +403,11 @@ def test_pvt_twitter() -> None:
287
403
)
288
404
data = apicall .df ()
289
405
assert len (data ) > 0
406
+ assert str (data ['location' ].dtype ) == 'string'
290
407
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
408
+ assert str (data ['num' ].dtype ) == 'int64'
409
+ assert str (data ['total' ].dtype ) == 'int64'
410
+ assert str (data ['percent' ].dtype ) == 'float64'
291
411
292
412
def test_pub_wiki () -> None :
293
413
apicall = Epidata .pub_wiki (
@@ -297,4 +417,9 @@ def test_pub_wiki() -> None:
297
417
)
298
418
data = apicall .df ()
299
419
assert len (data ) > 0
420
+ assert str (data ['article' ].dtype ) == 'string'
300
421
assert str (data ['epiweek' ].dtype ) == 'datetime64[ns]'
422
+ assert str (data ['count' ].dtype ) == 'int64'
423
+ assert str (data ['total' ].dtype ) == 'int64'
424
+ assert str (data ['hour' ].dtype ) == 'int64'
425
+ assert str (data ['value' ].dtype ) == 'float64'
0 commit comments