Skip to content

Release Delphi Epidata 4.1.12 #1318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 4.1.11
current_version = 4.1.12
commit = False
tag = False

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
ips: '${{ secrets.WG_PERF_IPS }}'
allowed_ips: '${{ secrets.WG_PERF_ALLOWED_IPS }}'
private_key: '${{ secrets.WG_PERF_PRIVATE_KEY }}'
- name: Clean files from previous runs
uses: AutoModality/action-clean@v1
- name: Check out repository
uses: actions/checkout@v3
# Previous step checks out default branch, so we check out the pull request's branch
Expand All @@ -44,6 +46,7 @@ jobs:
- name: Set up repository # mimics install.sh in the README except that delphi is cloned from the PR rather than main
run: |
cd ..
rm -rf driver
mkdir -p driver/repos/delphi
cd driver/repos/delphi
git clone https://github.com/cmu-delphi/operations
Expand Down
2 changes: 1 addition & 1 deletion dev/local/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = Delphi Development
version = 4.1.11
version = 4.1.12

[options]
packages =
Expand Down
31 changes: 31 additions & 0 deletions integrations/server/test_covidcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ def _insert_placeholder_set_five(self):
self._insert_rows(rows)
return rows

def _insert_placeholder_set_with_weeks(self):
rows = [
CovidcastTestRow.make_default_row(
time_value=2021_05+i, time_type="week",
source="nchs-mortality", signal="deaths_covid_incidence_num",
geo_type="state", geo_value="il",
value=i*i)
for i in [0, 1, 2]
]
self._insert_rows(rows)
return rows

def test_round_trip(self):
"""Make a simple round-trip with some sample data."""

Expand Down Expand Up @@ -445,3 +457,22 @@ def test_date_formats(self):

# assert that the right data came back
self.assertEqual(len(response['epidata']), 2 * 3)


def test_week_formats(self):
"""Test different ways to specify week ranges are accepted."""

rows = self._insert_placeholder_set_with_weeks()
expected = {
'result': 1,
'epidata': [r.as_api_row_dict() for r in rows],
'message': 'success',
}

colond = self.request_based_on_row(rows[0], time_values="202105:202107")
dashed = self.request_based_on_row(rows[0], time_values="202105-202107")
enumed = self.request_based_on_row(rows[0], time_values="202105,202106,202107")

self.assertEqual(expected, colond)
self.assertEqual(expected, dashed)
self.assertEqual(expected, enumed)
2 changes: 1 addition & 1 deletion src/client/delphi_epidata.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Epidata <- (function() {
# API base url
BASE_URL <- getOption('epidata.url', default = 'https://api.delphi.cmu.edu/epidata/')

client_version <- '4.1.11'
client_version <- '4.1.12'

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

Expand Down
2 changes: 1 addition & 1 deletion src/client/delphi_epidata.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
})(this, function (exports, fetchImpl, jQuery) {
const BASE_URL = "https://api.delphi.cmu.edu/epidata/";
const client_version = "4.1.11";
const client_version = "4.1.12";

// Helper function to cast values and/or ranges to strings
function _listitem(value) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/packaging/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "delphi_epidata",
"description": "Delphi Epidata API Client",
"authors": "Delphi Group",
"version": "4.1.11",
"version": "4.1.12",
"license": "MIT",
"homepage": "https://github.com/cmu-delphi/delphi-epidata",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion src/client/packaging/pypi/delphi_epidata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .delphi_epidata import Epidata

name = "delphi_epidata"
__version__ = "4.1.11"
__version__ = "4.1.12"
2 changes: 1 addition & 1 deletion src/client/packaging/pypi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="delphi_epidata",
version="4.1.11",
version="4.1.12",
author="David Farrow",
author_email="[email protected]",
description="A programmatic interface to Delphi's Epidata API.",
Expand Down
2 changes: 1 addition & 1 deletion src/server/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

load_dotenv()

VERSION = "4.1.11"
VERSION = "4.1.12"

MAX_RESULTS = int(10e6)
MAX_COMPATIBILITY_RESULTS = int(3650)
Expand Down
13 changes: 12 additions & 1 deletion src/server/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,18 @@ def extract_dates(key: Union[str, Sequence[str]]) -> Optional[TimeValues]:
values.append(r)
continue
# parse other date formats
r = parse_day_value(part)
dashless_part = part.replace("-", "")
if len(dashless_part) in (6, 12):
# if there are 6 or 12 (hopefully integer) chars in this, it
# should be a week or week range (YYYYWW or YYYYWWYYYYWW)
r = parse_week_value(part)
elif len(dashless_part) in (8, 16):
# if its 8 or 16, it should be a day or
# day range (YYYYMMDD or YYYYMMDDYYYYMMDD)
r = parse_day_value(part)
else:
# other time types tbd lol
raise ValidationFailedException(f"unrecognized date format: {part}")
values.append(r)
return values

Expand Down