Skip to content

Commit e61b4fb

Browse files
authored
Merge pull request #1744 from cmu-delphi/release/indicators_v0.3.28_utils_v0.3.7
Release covidcast-indicators 0.3.28
2 parents 61e5aae + e614028 commit e61b4fb

File tree

19 files changed

+44
-8
lines changed

19 files changed

+44
-8
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.27
2+
current_version = 0.3.28
33
commit = True
44
message = chore: bump covidcast-indicators to {new_version}
55
tag = False

.github/workflows/create-release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ jobs:
5858
id: indicators
5959
run: |
6060
echo -n "::set-output name=version::"
61-
bump2version --list ${{ github.event.inputs.versionName }} | grep ^new_version | sed -r s,"^.*=",,
61+
bump2version --list ${{ github.event.inputs.versionName }} | grep ^new_version | sed -r s,"^.*=",,
62+
- name: Copy version to indicator directory
63+
run: |
64+
indicator_list=("changehc" "claims_hosp" "doctor_visits" "dsew_community_profile" "google_symptoms" "hhs_hosp" "jhu" "nchs_mortality" "nowcast" "quidel_covidtest" "sir_complainsalot")
65+
for path in ${indicator_list[@]}; do
66+
echo "current_version = ${{ steps.indicators.outputs.version }}" > $path/version.cfg
67+
done
6268
- name: Create pull request into prod
6369
uses: peter-evans/create-pull-request@v3
6470
with:

_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.6
2+
current_version = 0.3.7
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.6"
18+
__version__ = "0.3.7"

_delphi_utils_python/delphi_utils/runner.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Indicator running utilities."""
22
import argparse as ap
33
import importlib
4+
import os
45
from typing import Any, Callable, Dict, Optional
56
from .archive import ArchiveDiffer, archiver_from_params
67
from .logger import get_structured_logger
@@ -40,6 +41,21 @@ def run_indicator_pipeline(indicator_fn: Callable[[Params], None],
4041
name=indicator_fn.__module__,
4142
filename=params["common"].get("log_filename", None),
4243
log_exceptions=params["common"].get("log_exceptions", True))
44+
45+
#Get version and indicator name for startup
46+
ind_name = indicator_fn.__module__.replace(".run", "")
47+
#Check for version.cfg in indicator directory
48+
if os.path.exists("version.cfg"):
49+
with open("version.cfg") as ver_file:
50+
current_version = "not found"
51+
for line in ver_file:
52+
if "current_version" in line:
53+
current_version = str.strip(line)
54+
current_version = current_version.replace("current_version = ", "")
55+
#Logging - Starting Indicator
56+
logger.info(f"Started {ind_name} with covidcast-indicators version {current_version}")
57+
else: logger.info(f"Started {ind_name} without version.cfg")
58+
4359
indicator_fn(params)
4460
validator = validator_fn(params)
4561
archiver = archiver_fn(params)

_delphi_utils_python/setup.py

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

2727
setup(
2828
name="delphi_utils",
29-
version="0.3.6",
29+
version="0.3.7",
3030
description="Shared Utility Functions for Indicators",
3131
long_description=long_description,
3232
long_description_content_type="text/markdown",

changehc/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

claims_hosp/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

doctor_visits/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

dsew_community_profile/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

google_symptoms/delphi_google_symptoms/constants.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@
4545
impute_method='zeros'), lambda d: d)
4646
}
4747

48-
48+
DTYPE_CONVERSIONS = {'open_covid_region_code':'string','date': 'datetime64'}
49+
for index, symptom in enumerate(METRICS):
50+
key = "symptom_" + METRICS[index].replace(" ","_")
51+
DTYPE_CONVERSIONS[key] = "float"
4952

5053
STATE_TO_ABBREV = {'Alabama': 'al',
5154
'Alaska': 'ak',

google_symptoms/delphi_google_symptoms/pull.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88
import pandas as pd
99

10-
from .constants import DC_FIPS, METRICS, COMBINED_METRIC, SYMPTOM_SETS
10+
from .constants import DC_FIPS, METRICS, COMBINED_METRIC, SYMPTOM_SETS, DTYPE_CONVERSIONS
1111

1212

1313
# Create map of BigQuery symptom column names to desired column names.
@@ -223,7 +223,7 @@ def pull_gs_data_one_geolevel(level, date_range):
223223
"""
224224
query = produce_query(level, date_range)
225225

226-
df = pandas_gbq.read_gbq(query, progress_bar_type=None)
226+
df = pandas_gbq.read_gbq(query, progress_bar_type=None, dtypes = DTYPE_CONVERSIONS)
227227

228228
if len(df) == 0:
229229
df = pd.DataFrame(

google_symptoms/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

hhs_hosp/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

jhu/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

nchs_mortality/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

nowcast/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

quidel_covidtest/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

sir_complainsalot/version.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
current_version = 0.3.28

0 commit comments

Comments
 (0)