Skip to content

Commit 5ed605c

Browse files
authored
Merge pull request #1449 from cmu-delphi/release/indicators_v0.2.19_utils_v0.2.8
Release covidcast-indicators 0.2.19
2 parents d37056d + c219d89 commit 5ed605c

File tree

36 files changed

+162
-111
lines changed

36 files changed

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

.github/workflows/python-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
pip install pylint pytest pydocstyle wheel
3333
- name: Install
3434
run: |
35-
make install
35+
make install-ci
3636
- name: Lint
3737
run: |
3838
make lint

_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.2.7
2+
current_version = 0.2.8
33
commit = True
44
message = chore: bump delphi_utils to {new_version}
55
tag = False

_delphi_utils_python/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ install: venv
88
pip install wheel ; \
99
pip install -e .
1010

11+
install-ci: venv
12+
. env/bin/activate; \
13+
pip install wheel ; \
14+
pip install .
15+
1116
lint:
1217
. env/bin/activate; pylint delphi_utils
1318
. env/bin/activate; pydocstyle delphi_utils

_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.2.7"
18+
__version__ = "0.2.8"

_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.2.7",
29+
version="0.2.8",
3030
description="Shared Utility Functions for Indicators",
3131
long_description=long_description,
3232
long_description_content_type="text/markdown",

_template_python/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

cdc_covidnet/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

changehc/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

changehc/delphi_changehc/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
NA = "NA"
1010
HRR = "hrr"
1111
FIPS = "fips"
12+
13+
EXPECTED_FILES_PER_DROP = 7

changehc/delphi_changehc/download_ftp_files.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# third party
99
import paramiko
1010

11+
from .constants import EXPECTED_FILES_PER_DROP
1112

1213
def print_callback(filename, bytes_so_far, bytes_total):
1314
"""Log file transfer progress."""
@@ -32,8 +33,8 @@ def get_files_from_dir(sftp, filedate, out_path):
3233
not path.exists(path.join(out_path, filename)):
3334
filepaths_to_download[filename] = path.join(out_path, filename)
3435

35-
# make sure we don't download more than 6 files per day
36-
assert len(filepaths_to_download) <= 6, "more files dropped than expected"
36+
# make sure we don't download too many files per day
37+
assert len(filepaths_to_download) <= EXPECTED_FILES_PER_DROP, "more files dropped than expected"
3738

3839
# download!
3940
for infile, outfile in filepaths_to_download.items():

changehc/tests/test_download_ftp_files.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
# first party
88
from delphi_changehc.download_ftp_files import *
9+
from delphi_changehc.constants import EXPECTED_FILES_PER_DROP
910

1011
class TestDownloadFTPFiles:
1112

@@ -51,22 +52,18 @@ def test_get_files(self, mock_path):
5152
get_files_from_dir(one_new_one_old, "00005566", "")
5253
assert one_new_one_old.num_gets == 1
5354

54-
# When seven new files are present, AssertionError
55-
new_file1 = self.FileAttr(dt.timestamp(dt.now()), "00001122_foo1")
56-
new_file2 = self.FileAttr(dt.timestamp(dt.now()), "00001122_foo2")
57-
new_file3 = self.FileAttr(dt.timestamp(dt.now()), "00001122_foo3")
58-
new_file4 = self.FileAttr(dt.timestamp(dt.now()), "00001122_foo4")
59-
new_file5 = self.FileAttr(dt.timestamp(dt.now()), "00001122_foo5")
60-
new_file6 = self.FileAttr(dt.timestamp(dt.now()), "00001122_foo6")
61-
new_file7 = self.FileAttr(dt.timestamp(dt.now()), "00001122_foo7")
62-
seven_new = self.MockSFTP([new_file1, new_file2, new_file3, new_file4,
63-
new_file5, new_file6, new_file7])
55+
# When too many new files are present, AssertionError
56+
file_batch = [
57+
self.FileAttr(dt.timestamp(dt.now()), f"00001122_foo{i}")
58+
for i in range(EXPECTED_FILES_PER_DROP + 1)
59+
]
60+
too_many_new = self.MockSFTP(file_batch)
6461
with pytest.raises(AssertionError):
65-
get_files_from_dir(seven_new, "00001122", "")
62+
get_files_from_dir(too_many_new, "00001122", "")
6663

6764
# When the file already exists, no files are downloaded
6865
mock_path.exists.return_value = True
69-
one_exists = self.MockSFTP([new_file1])
66+
one_exists = self.MockSFTP([file_batch[0]])
7067
get_files_from_dir(one_new, "00001122", "")
7168
assert one_exists.num_gets == 0
7269

claims_hosp/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

combo_cases_and_deaths/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

covid_act_now/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

doctor_visits/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

google_symptoms/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

hhs_facilities/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

hhs_hosp/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

jhu/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

nchs_mortality/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY = venv, lint, test, clean
22

3-
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*')
4-
3+
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
54
venv:
65
python3.8 -m venv env
76

@@ -11,6 +10,12 @@ install: venv
1110
pip install -e ../_delphi_utils_python ;\
1211
pip install -e .
1312

13+
install-ci: venv
14+
. env/bin/activate; \
15+
pip install wheel ; \
16+
pip install ../_delphi_utils_python ;\
17+
pip install .
18+
1419
lint:
1520
. env/bin/activate; pylint $(dir)
1621
. env/bin/activate; pydocstyle $(dir)

nowcast/.pylintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ disable=logging-format-interpolation,
1616
[BASIC]
1717

1818
# Allow arbitrarily short-named variables.
19-
variable-rgx=[a-z_][a-z0-9_]*
20-
argument-rgx=[a-z_][a-z0-9_]*
21-
attr-rgx=[a-z_][a-z0-9_]*
19+
variable-rgx=[A-Za-z_][a-z0-9_]*
20+
argument-rgx=[A-Za-z_][a-z0-9_]*
21+
attr-rgx=[A-Za-z_][a-z0-9_]*
2222

2323
[DESIGN]
2424

0 commit comments

Comments
 (0)