Skip to content

Commit 33dba2e

Browse files
authored
Merge pull request #1872 from cmu-delphi/release/indicators_v0.3.43_utils_v0.3.18
Release covidcast-indicators 0.3.43
2 parents 2ddaa27 + 2cb16df commit 33dba2e

File tree

18 files changed

+46
-22
lines changed

18 files changed

+46
-22
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.3.42
2+
current_version = 0.3.43
33
commit = True
44
message = chore: bump covidcast-indicators to {new_version}
55
tag = False
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Dependabot auto-assign reviewer
2+
on: pull_request
3+
4+
permissions:
5+
pull-requests: write
6+
7+
jobs:
8+
dependabot:
9+
runs-on: ubuntu-latest
10+
env:
11+
GH_TOKEN: ${{ secrets.CMU_DELPHI_AUTOMATION_MACHINE_DEPENDABOT_PAT }}
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
- name: Assign team to PR
15+
run: gh pr edit "$PR_URL" --add-reviewer "cmu-delphi/code-reviewers"
16+
env:
17+
PR_URL: ${{github.event.pull_request.html_url}}

_delphi_utils_python/.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.3.17
2+
current_version = 0.3.18
33
commit = True
44
message = chore: bump delphi_utils to {new_version}
55
tag = False

_delphi_utils_python/delphi_utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
from .nancodes import Nans
1616
from .weekday import Weekday
1717

18-
__version__ = "0.3.17"
18+
__version__ = "0.3.18"

_delphi_utils_python/delphi_utils/validator/datafetcher.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
import requests
1010
import pandas as pd
1111
import numpy as np
12-
1312
import covidcast
13+
from .. import read_params
1414
from .errors import APIDataFetchError, ValidationFailure
1515

1616
FILENAME_REGEX = re.compile(
1717
r'^(?P<date>\d{8})_(?P<geo_type>\w+?)_(?P<signal>\w+)\.csv$')
1818

19-
2019
def make_date_filter(start_date, end_date):
2120
"""
2221
Create a function to filter dates in the specified date range (inclusive).
@@ -110,8 +109,12 @@ def get_geo_signal_combos(data_source):
110109
111110
Cross references based on combinations reported available by COVIDcast metadata.
112111
"""
112+
params = read_params()
113+
assert "validation" in params
114+
api_key = ("epidata", params["validation"]["common"]["api_credentials"])
113115
# Maps data_source name with what's in the API, lists used in case of multiple names
114-
meta_response = requests.get("https://api.covidcast.cmu.edu/epidata/covidcast/meta")
116+
meta_response = requests.get("https://api.covidcast.cmu.edu/epidata/covidcast/meta",
117+
auth=api_key)
115118
meta_response.raise_for_status()
116119
source_signal_mappings = {i['source']:i['db_source'] for i in
117120
meta_response.json()}
@@ -139,7 +142,7 @@ def get_geo_signal_combos(data_source):
139142
elif geo_status == "unknown":
140143
epidata_signal = requests.get(
141144
"https://api.covidcast.cmu.edu/epidata/covidcast/meta",
142-
params={'signal': f"{src}:{sig}"})
145+
params={'signal': f"{src}:{sig}"}, auth=api_key)
143146
epidata_signal.raise_for_status()
144147
# Not an active signal
145148
active_status = [val['active'] for i in epidata_signal.json()

_delphi_utils_python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
setup(
2929
name="delphi_utils",
30-
version="0.3.17",
30+
version="0.3.18",
3131
description="Shared Utility Functions for Indicators",
3232
long_description=long_description,
3333
long_description_content_type="text/markdown",
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"test": "yes"
2+
"test": "yes",
3+
"validation": {
4+
"common": {
5+
"api_credentials": "fake_key"
6+
}
7+
}
38
}

_delphi_utils_python/tests/validator/test_datafetcher.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def json(self):
4040
def raise_for_status(self):
4141
if self.status_code != 200:
4242
raise HTTPError()
43-
if len(kwargs) == 0:
43+
if len(kwargs) == 0 or list(kwargs.keys())==["auth"]:
4444
return MockResponse([{'source': 'chng', 'db_source': 'chng'},
4545
{'source': 'covid-act-now', 'db_source': 'covid-act-now'}], 200)
46-
elif kwargs["params"] == {'signal': 'chng:inactive'}:
46+
elif "params" in kwargs and kwargs["params"] == {'signal': 'chng:inactive'}:
4747
return MockResponse([{"signals": [{"active": False}]}], 200)
4848
else:
4949
return MockResponse([{"signals": [{"active": True}]}], 200)
@@ -78,7 +78,6 @@ def test_get_geo_signal_combos(self, mock_metadata, mock_get):
7878
"hrr", "msa", "msa",
7979
"state"]
8080
})
81-
8281
assert set(get_geo_signal_combos("chng")) == set(
8382
[("state", "smoothed_outpatient_cli"),
8483
("state", "smoothed_outpatient_covid"),

changehc/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

claims_hosp/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

doctor_visits/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

dsew_community_profile/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

google_symptoms/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

hhs_hosp/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

nchs_mortality/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

nowcast/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

quidel_covidtest/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

sir_complainsalot/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.42
1+
current_version = 0.3.43

0 commit comments

Comments
 (0)