Skip to content

Commit dfc255a

Browse files
minor changes
1 parent acd0570 commit dfc255a

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

hhs_hosp/delphi_hhs/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def run_module(params):
102102
"state_id",
103103
"state_code",
104104
from_col="state")
105-
if sensor.endswith("_PROP"):
105+
if sensor.endswith("_prop"):
106106
df=pop_proportion(df,geo_mapper)
107107
df = make_geo(df, geo, geo_mapper)
108108
df = smooth_values(df, smoother[0])
@@ -142,7 +142,7 @@ def smooth_values(df, smoother):
142142
def pop_proportion(df,geo_mapper):
143143
"""Get the population-proportionate variants as the dataframe val."""
144144
pop_val=geo_mapper.add_population_column(df, "state_code")
145-
df["val"]=round(df["val"]/pop_val["population"]*100000,2)
145+
df["val"]=round(df["val"]/pop_val["population"]*100000,7)
146146
pop_val.drop("population", axis=1, inplace=True)
147147
return df
148148

hhs_hosp/tests/test_run.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ def test_make_signal():
6666
'val': [5.],
6767
})
6868
pd.testing.assert_frame_equal(expected_confirmed, make_signal(data, CONFIRMED))
69-
70-
expected_confirmed = pd.DataFrame({
71-
'state': ['na'],
72-
'timestamp': [datetime(year=2020, month=1, day=1)],
73-
'val': [5.],
74-
})
7569
pd.testing.assert_frame_equal(expected_confirmed, make_signal(data, CONFIRMED_PROP))
7670

7771
expected_sum = pd.DataFrame({
@@ -80,12 +74,6 @@ def test_make_signal():
8074
'val': [15.],
8175
})
8276
pd.testing.assert_frame_equal(expected_sum, make_signal(data, SUM_CONF_SUSP))
83-
84-
expected_sum = pd.DataFrame({
85-
'state': ['na'],
86-
'timestamp': [datetime(year=2020, month=1, day=1)],
87-
'val': [15.],
88-
})
8977
pd.testing.assert_frame_equal(expected_sum, make_signal(data, SUM_CONF_SUSP_PROP))
9078

9179
with pytest.raises(Exception):
@@ -104,7 +92,7 @@ def test_pop_proportion():
10492
'state': ['PA'],
10593
'state_code':[42],
10694
'timestamp': [datetime(year=2020, month=1, day=1)],
107-
'val': [0.12],})
95+
'val': [0.1171693],})
10896
)
10997

11098
test_df= pd.DataFrame({
@@ -119,7 +107,7 @@ def test_pop_proportion():
119107
'state': ['WV'],
120108
'state_code':[54],
121109
'timestamp': [datetime(year=2020, month=1, day=1)],
122-
'val': [8.37],})
110+
'val': [8.3698491],})
123111
)
124112

125113
def test_make_geo():

0 commit comments

Comments
 (0)