Skip to content

Commit 0279a57

Browse files
authored
Merge pull request #1318 from cmu-delphi/release/delphi-epidata-4.1.12
Release Delphi Epidata 4.1.12
2 parents adefef9 + 39208ec commit 0279a57

File tree

11 files changed

+54
-9
lines changed

11 files changed

+54
-9
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 4.1.11
2+
current_version = 4.1.12
33
commit = False
44
tag = False
55

.github/workflows/performance-tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
ips: '${{ secrets.WG_PERF_IPS }}'
3434
allowed_ips: '${{ secrets.WG_PERF_ALLOWED_IPS }}'
3535
private_key: '${{ secrets.WG_PERF_PRIVATE_KEY }}'
36+
- name: Clean files from previous runs
37+
uses: AutoModality/action-clean@v1
3638
- name: Check out repository
3739
uses: actions/checkout@v3
3840
# Previous step checks out default branch, so we check out the pull request's branch
@@ -44,6 +46,7 @@ jobs:
4446
- name: Set up repository # mimics install.sh in the README except that delphi is cloned from the PR rather than main
4547
run: |
4648
cd ..
49+
rm -rf driver
4750
mkdir -p driver/repos/delphi
4851
cd driver/repos/delphi
4952
git clone https://github.com/cmu-delphi/operations

dev/local/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = Delphi Development
3-
version = 4.1.11
3+
version = 4.1.12
44

55
[options]
66
packages =

integrations/server/test_covidcast.py

+31
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ def _insert_placeholder_set_five(self):
8181
self._insert_rows(rows)
8282
return rows
8383

84+
def _insert_placeholder_set_with_weeks(self):
85+
rows = [
86+
CovidcastTestRow.make_default_row(
87+
time_value=2021_05+i, time_type="week",
88+
source="nchs-mortality", signal="deaths_covid_incidence_num",
89+
geo_type="state", geo_value="il",
90+
value=i*i)
91+
for i in [0, 1, 2]
92+
]
93+
self._insert_rows(rows)
94+
return rows
95+
8496
def test_round_trip(self):
8597
"""Make a simple round-trip with some sample data."""
8698

@@ -445,3 +457,22 @@ def test_date_formats(self):
445457

446458
# assert that the right data came back
447459
self.assertEqual(len(response['epidata']), 2 * 3)
460+
461+
462+
def test_week_formats(self):
463+
"""Test different ways to specify week ranges are accepted."""
464+
465+
rows = self._insert_placeholder_set_with_weeks()
466+
expected = {
467+
'result': 1,
468+
'epidata': [r.as_api_row_dict() for r in rows],
469+
'message': 'success',
470+
}
471+
472+
colond = self.request_based_on_row(rows[0], time_values="202105:202107")
473+
dashed = self.request_based_on_row(rows[0], time_values="202105-202107")
474+
enumed = self.request_based_on_row(rows[0], time_values="202105,202106,202107")
475+
476+
self.assertEqual(expected, colond)
477+
self.assertEqual(expected, dashed)
478+
self.assertEqual(expected, enumed)

src/client/delphi_epidata.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Epidata <- (function() {
1515
# API base url
1616
BASE_URL <- getOption('epidata.url', default = 'https://api.delphi.cmu.edu/epidata/')
1717

18-
client_version <- '4.1.11'
18+
client_version <- '4.1.12'
1919

2020
auth <- getOption("epidata.auth", default = NA)
2121

src/client/delphi_epidata.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
})(this, function (exports, fetchImpl, jQuery) {
2424
const BASE_URL = "https://api.delphi.cmu.edu/epidata/";
25-
const client_version = "4.1.11";
25+
const client_version = "4.1.12";
2626

2727
// Helper function to cast values and/or ranges to strings
2828
function _listitem(value) {

src/client/packaging/npm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "delphi_epidata",
33
"description": "Delphi Epidata API Client",
44
"authors": "Delphi Group",
5-
"version": "4.1.11",
5+
"version": "4.1.12",
66
"license": "MIT",
77
"homepage": "https://github.com/cmu-delphi/delphi-epidata",
88
"bugs": {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .delphi_epidata import Epidata
22

33
name = "delphi_epidata"
4-
__version__ = "4.1.11"
4+
__version__ = "4.1.12"

src/client/packaging/pypi/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="delphi_epidata",
8-
version="4.1.11",
8+
version="4.1.12",
99
author="David Farrow",
1010
author_email="[email protected]",
1111
description="A programmatic interface to Delphi's Epidata API.",

src/server/_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
load_dotenv()
99

10-
VERSION = "4.1.11"
10+
VERSION = "4.1.12"
1111

1212
MAX_RESULTS = int(10e6)
1313
MAX_COMPATIBILITY_RESULTS = int(3650)

src/server/_params.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,18 @@ def extract_dates(key: Union[str, Sequence[str]]) -> Optional[TimeValues]:
439439
values.append(r)
440440
continue
441441
# parse other date formats
442-
r = parse_day_value(part)
442+
dashless_part = part.replace("-", "")
443+
if len(dashless_part) in (6, 12):
444+
# if there are 6 or 12 (hopefully integer) chars in this, it
445+
# should be a week or week range (YYYYWW or YYYYWWYYYYWW)
446+
r = parse_week_value(part)
447+
elif len(dashless_part) in (8, 16):
448+
# if its 8 or 16, it should be a day or
449+
# day range (YYYYMMDD or YYYYMMDDYYYYMMDD)
450+
r = parse_day_value(part)
451+
else:
452+
# other time types tbd lol
453+
raise ValidationFailedException(f"unrecognized date format: {part}")
443454
values.append(r)
444455
return values
445456

0 commit comments

Comments
 (0)