File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 11
11
12
12
SIGNALS = [
13
13
"pcr_specimen_positivity_rate" ,
14
+ "pcr_specimen_total_tests" ,
14
15
]
Original file line number Diff line number Diff line change 5
5
when the module is run with `python -m delphi_covid_act_now`.
6
6
"""
7
7
8
+ import numpy as np
9
+
8
10
from delphi_utils import (
9
11
read_params ,
10
12
create_export_csv ,
@@ -43,14 +45,22 @@ def run_module():
43
45
print (f"Processing { geo_res } " )
44
46
df = geo_map (df_county_testing , geo_res )
45
47
46
- # Only 1 signal for now
47
- signal = SIGNALS [0 ]
48
+ # Export 'pcr_specimen_positivity_rate'
49
+ exported_csv_dates = create_export_csv (
50
+ df ,
51
+ export_dir = export_dir ,
52
+ geo_res = geo_res ,
53
+ sensor = SIGNALS [0 ])
48
54
55
+ # Export 'pcr_specimen_total_tests'
56
+ df ["val" ] = df ["sample_size" ]
57
+ df ["sample_size" ] = np .nan
58
+ df ["se" ] = np .nan
49
59
exported_csv_dates = create_export_csv (
50
60
df ,
51
61
export_dir = export_dir ,
52
62
geo_res = geo_res ,
53
- sensor = signal )
63
+ sensor = SIGNALS [ 1 ] )
54
64
55
65
earliest , latest = min (exported_csv_dates ), max (exported_csv_dates )
56
66
print (f"Exported dates: { earliest } to { latest } " )
Original file line number Diff line number Diff line change 4
4
import pandas as pd
5
5
import pytest
6
6
7
- from delphi_covid_act_now .constants import GEO_RESOLUTIONS
7
+ from delphi_covid_act_now .constants import GEO_RESOLUTIONS , SIGNALS
8
8
9
9
class TestRun :
10
10
def test_output_files (self , run_as_module ):
11
11
csv_files = set (listdir ("receiving" ))
12
12
csv_files .discard (".gitignore" )
13
13
14
- expected_files = {
15
- f"20210101_{ geo } _pcr_specimen_positivity_rate.csv"
16
- for geo in GEO_RESOLUTIONS }
14
+ expected_files = set ()
15
+ for signal in SIGNALS :
16
+ for geo in GEO_RESOLUTIONS :
17
+ expected_files .add (f"20210101_{ geo } _{ signal } .csv" )
17
18
18
19
# All output files exist
19
20
assert csv_files == expected_files
You can’t perform that action at this time.
0 commit comments