Skip to content

Commit 5009ce2

Browse files
committed
Fixing module build errors
1 parent b3c1dd3 commit 5009ce2

File tree

6 files changed

+18
-27
lines changed

6 files changed

+18
-27
lines changed

validator/delphi_validator/datafetcher.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44
import covidcast
55
import pandas as pd
66
from datetime import date, datetime, timedelta
7-
from errors import *
7+
from .errors import *
88
import re
99
from typing import List
1010
import json
1111

12-
def read_params(params_filepath):
13-
with open(params_filepath) as f:
14-
config = json.load(f)
15-
return config
1612

1713
def get_filenames_with_geo_signal(path, date_slist: List[str]):
1814

@@ -121,12 +117,6 @@ def fetch_daily_data(data_source, survey_date, geo_type, signal):
121117

122118

123119
def new_stuff():
124-
survey_sdate = "2020-06-13"
125-
survey_edate = "2020-06-20"
126-
dtobj_sdate = datetime.strptime(survey_sdate, '%Y-%m-%d')
127-
dtobj_edate = datetime.strptime(survey_edate, '%Y-%m-%d')
128-
print(dtobj_sdate.date())
129-
print(dtobj_edate.date())
130120

131121
number_of_dates = dtobj_edate - dtobj_sdate + timedelta(days=1)
132122
print(number_of_dates)

validator/delphi_validator/driver.py

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

validator/delphi_validator/fbsurveyvalidation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pathlib import Path
66
from itertools import product
77
from datetime import date, datetime, timedelta
8-
from datafetcher import *
8+
from .datafetcher import *
99
import math
1010

1111
DATA_SOURCE = "fb-survey"

validator/delphi_validator/run.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22
"""Functions to call when running the function.
33
44
This module should contain a function called `run_module`, that is executed
5-
when the module is run with `python -m MODULE_NAME`.
5+
when the module is run with `python -m delphi_validator`.
66
"""
77
import numpy as np
88
import pandas as pd
99
from delphi_utils import read_params
10+
from .fbsurveyvalidation import fbsurvey_validation
11+
from .datafetcher import *
1012

1113

1214
def run_module():
1315

1416
params = read_params()
17+
18+
19+
dtobj_sdate = datetime.strptime(params['start_date'], '%Y-%m-%d')
20+
dtobj_edate = datetime.strptime(params['end_date'], '%Y-%m-%d')
21+
max_check_lookbehind = int(params["ref_window_size"])
22+
23+
# Collecting all filenames
24+
daily_filnames = read_filenames(params["data_folder"])
25+
26+
fbsurvey_validation(daily_filnames, dtobj_sdate, dtobj_edate)

validator/params.json.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"start_date": "2020-06-13",
55
"end_date": "2020-06-19",
66
"ref_window_size": 7,
7-
"data_folder": "/data/"
7+
"data_folder": "C:/Covidcast/covidcast-indicators/validator/data"
88
}

validator/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"pytest",
88
"pytest-cov",
99
"pylint",
10-
"delphi-utils"
10+
"delphi-utils",
11+
"covidcast"
1112
]
1213

1314
setup(

0 commit comments

Comments
 (0)