Skip to content

Commit b461c00

Browse files
committed
refactor: merge smoke test file
1 parent a6a1c98 commit b461c00

File tree

2 files changed

+33
-39
lines changed

2 files changed

+33
-39
lines changed

smoke_covid_test.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

smoke_test.py

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from datetime import date
2+
23
from epidatpy import CovidcastEpidata, Epidata, EpiRange
34

4-
apicall = Epidata.covidcast("fb-survey", "smoothed_cli", "day", "nation", EpiRange(20210405, 20210410), "us")
5+
print("Epidata Test")
6+
apicall = Epidata.pub_covidcast("fb-survey", "smoothed_cli", "nation", "day", "us", EpiRange(20210405, 20210410))
57

68
# Call info
79
print(apicall)
@@ -11,9 +13,6 @@
1113
classic = apicall.classic()
1214
print(classic)
1315

14-
r = apicall.csv()
15-
print(r[0:100])
16-
1716
data = apicall.json()
1817
print(data[0])
1918

@@ -30,12 +29,38 @@
3029
print(df.dtypes)
3130
print(df.iloc[0])
3231

33-
for row in apicall.iter():
34-
print(row)
3532

3633
StagingEpidata = Epidata.with_base_url("https://staging.delphi.cmu.edu/epidata/")
3734

38-
epicall = StagingEpidata.covidcast(
39-
"fb-survey", "smoothed_cli", "day", "nation", EpiRange(date(2021, 4, 5), date(2021, 4, 10)), "*"
35+
epicall = StagingEpidata.pub_covidcast(
36+
"fb-survey", "smoothed_cli", "nation", "day", "*", EpiRange(date(2021, 4, 5), date(2021, 4, 10))
4037
)
4138
print(epicall._base_url)
39+
40+
41+
# Covidcast test
42+
print("Covidcast Test")
43+
epidata = CovidcastEpidata()
44+
print(epidata.source_names)
45+
epidata["fb-survey"].signal_df
46+
apicall = epidata[("fb-survey", "smoothed_cli")].call(
47+
"nation",
48+
"us",
49+
EpiRange(20210405, 20210410),
50+
)
51+
print(apicall)
52+
53+
classic = apicall.classic()
54+
print(classic)
55+
56+
data = apicall.json()
57+
print(data[0])
58+
59+
df = apicall.df()
60+
print(df.columns)
61+
print(df.dtypes)
62+
print(df.iloc[0])
63+
df = apicall.df(disable_date_parsing=True)
64+
print(df.columns)
65+
print(df.dtypes)
66+
print(df.iloc[0])

0 commit comments

Comments
 (0)