Skip to content

Commit

Permalink
Merge pull request #1872 from cmu-delphi/release/indicators_v0.3.43_u…
Browse files Browse the repository at this point in the history
…tils_v0.3.18

Release covidcast-indicators 0.3.43
  • Loading branch information
krivard authored Jul 19, 2023
2 parents 2ddaa27 + 2cb16df commit 33dba2e
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.42
current_version = 0.3.43
commit = True
message = chore: bump covidcast-indicators to {new_version}
tag = False
17 changes: 17 additions & 0 deletions .github/workflows/dependabot-assignments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Dependabot auto-assign reviewer
on: pull_request

permissions:
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.CMU_DELPHI_AUTOMATION_MACHINE_DEPENDABOT_PAT }}
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Assign team to PR
run: gh pr edit "$PR_URL" --add-reviewer "cmu-delphi/code-reviewers"
env:
PR_URL: ${{github.event.pull_request.html_url}}
2 changes: 1 addition & 1 deletion _delphi_utils_python/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.17
current_version = 0.3.18
commit = True
message = chore: bump delphi_utils to {new_version}
tag = False
Expand Down
2 changes: 1 addition & 1 deletion _delphi_utils_python/delphi_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
from .nancodes import Nans
from .weekday import Weekday

__version__ = "0.3.17"
__version__ = "0.3.18"
11 changes: 7 additions & 4 deletions _delphi_utils_python/delphi_utils/validator/datafetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
import requests
import pandas as pd
import numpy as np

import covidcast
from .. import read_params
from .errors import APIDataFetchError, ValidationFailure

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


def make_date_filter(start_date, end_date):
"""
Create a function to filter dates in the specified date range (inclusive).
Expand Down Expand Up @@ -110,8 +109,12 @@ def get_geo_signal_combos(data_source):
Cross references based on combinations reported available by COVIDcast metadata.
"""
params = read_params()
assert "validation" in params
api_key = ("epidata", params["validation"]["common"]["api_credentials"])
# Maps data_source name with what's in the API, lists used in case of multiple names
meta_response = requests.get("https://api.covidcast.cmu.edu/epidata/covidcast/meta")
meta_response = requests.get("https://api.covidcast.cmu.edu/epidata/covidcast/meta",
auth=api_key)
meta_response.raise_for_status()
source_signal_mappings = {i['source']:i['db_source'] for i in
meta_response.json()}
Expand Down Expand Up @@ -139,7 +142,7 @@ def get_geo_signal_combos(data_source):
elif geo_status == "unknown":
epidata_signal = requests.get(
"https://api.covidcast.cmu.edu/epidata/covidcast/meta",
params={'signal': f"{src}:{sig}"})
params={'signal': f"{src}:{sig}"}, auth=api_key)
epidata_signal.raise_for_status()
# Not an active signal
active_status = [val['active'] for i in epidata_signal.json()
Expand Down
2 changes: 1 addition & 1 deletion _delphi_utils_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

setup(
name="delphi_utils",
version="0.3.17",
version="0.3.18",
description="Shared Utility Functions for Indicators",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
7 changes: 6 additions & 1 deletion _delphi_utils_python/tests/params.json.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"test": "yes"
"test": "yes",
"validation": {
"common": {
"api_credentials": "fake_key"
}
}
}
5 changes: 2 additions & 3 deletions _delphi_utils_python/tests/validator/test_datafetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def json(self):
def raise_for_status(self):
if self.status_code != 200:
raise HTTPError()
if len(kwargs) == 0:
if len(kwargs) == 0 or list(kwargs.keys())==["auth"]:
return MockResponse([{'source': 'chng', 'db_source': 'chng'},
{'source': 'covid-act-now', 'db_source': 'covid-act-now'}], 200)
elif kwargs["params"] == {'signal': 'chng:inactive'}:
elif "params" in kwargs and kwargs["params"] == {'signal': 'chng:inactive'}:
return MockResponse([{"signals": [{"active": False}]}], 200)
else:
return MockResponse([{"signals": [{"active": True}]}], 200)
Expand Down Expand Up @@ -78,7 +78,6 @@ def test_get_geo_signal_combos(self, mock_metadata, mock_get):
"hrr", "msa", "msa",
"state"]
})

assert set(get_geo_signal_combos("chng")) == set(
[("state", "smoothed_outpatient_cli"),
("state", "smoothed_outpatient_covid"),
Expand Down
2 changes: 1 addition & 1 deletion changehc/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion claims_hosp/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion doctor_visits/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion dsew_community_profile/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion google_symptoms/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion hhs_hosp/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion nchs_mortality/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion nowcast/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion quidel_covidtest/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43
2 changes: 1 addition & 1 deletion sir_complainsalot/version.cfg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version = 0.3.42
current_version = 0.3.43

0 comments on commit 33dba2e

Please sign in to comment.