Skip to content
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 = 0.1.3
current_version = 0.1.4
commit = False
tag = False

Expand Down
2 changes: 1 addition & 1 deletion src/acquisition/covidcast/csv_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def find_issue_specific_csv_files(scan_dir, glob=glob):
issue_date_value = int(issuedir_match.group(2))
issue_date = CsvImporter.is_sane_day(issue_date_value)
if issue_date:
logger.info('processing csv files from issue date: "' + str(issue_date) + '", directory', path)
logger.info(event='processing csv files from issue', detail=issue_date, file=path)
yield from CsvImporter.find_csv_files(path, issue=(issue_date, epi.Week.fromdate(issue_date)), glob=glob)
else:
logger.warning(event='invalid issue directory day', detail=issue_date_value, file=path)
Expand Down
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 <- 'https://delphi.cmu.edu/epidata/api.php'

client_version <- '0.1.3'
client_version <- '0.1.4'

# Helper function to cast values and/or ranges to strings
.listitem <- function(value) {
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://delphi.cmu.edu/epidata/";
const client_version = "0.1.3";
const client_version = "0.1.4";

// 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": "0.1.3",
"version": "0.1.4",
"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__ = '0.1.3'
__version__ = '0.1.4'
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="0.1.3",
version="0.1.4",
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 @@ -5,7 +5,7 @@

load_dotenv()

VERSION = "0.1.3"
VERSION = "0.1.4"

MAX_RESULTS = int(10e6)
MAX_COMPATIBILITY_RESULTS = int(3650)
Expand Down
34 changes: 33 additions & 1 deletion tests/acquisition/covidcast/test_csv_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# standard library
import unittest
from unittest.mock import MagicMock
from unittest.mock import patch
from datetime import date
import math
import numpy as np
import os

# third party
import pandas
Expand Down Expand Up @@ -42,6 +44,36 @@ def test_is_sane_week(self):
self.assertFalse(CsvImporter.is_sane_week(202054))
self.assertFalse(CsvImporter.is_sane_week(20200418))

@patch("os.path.isdir")
def test_find_issue_specific_csv_files(self,os_isdir_mock):
"""Recursively explore and find issue specific CSV files."""
# check valid path
path_prefix='prefix/to/the/data/issue_20200408'
os_isdir_mock.return_value=True
issue_path=path_prefix+'ght/20200408_state_rawsearch.csv'

mock_glob = MagicMock()
mock_glob.glob.side_effect = ([path_prefix], [issue_path])

#check if the day is a valid day.
issuedir_match= CsvImporter.PATTERN_ISSUE_DIR.match(path_prefix.lower())
issue_date_value = int(issuedir_match.group(2))
self.assertTrue(CsvImporter.is_sane_day(issue_date_value))

found = set(CsvImporter.find_issue_specific_csv_files(path_prefix, glob=mock_glob))
self.assertTrue(len(found)>0)

# check unvalid path:
path_prefix_invalid='invalid/prefix/to/the/data/issue_20200408'
os_isdir_mock.return_value=False
issue_path_invalid=path_prefix_invalid+'ght/20200408_state_rawsearch.csv'
mock_glob_invalid = MagicMock()
mock_glob_invalid.glob.side_effect = ([path_prefix_invalid], [issue_path_invalid])

found = set(CsvImporter.find_issue_specific_csv_files(path_prefix_invalid, glob=mock_glob_invalid))
self.assertFalse(len(found)>0)


def test_find_csv_files(self):
"""Recursively explore and find CSV files."""

Expand Down Expand Up @@ -306,4 +338,4 @@ def test_load_csv_with_valid_header(self):
self.assertEqual(rows[2].missing_stderr, Nans.NOT_MISSING)
self.assertEqual(rows[2].missing_sample_size, Nans.REGION_EXCEPTION)

self.assertIsNone(rows[3])
self.assertIsNone(rows[3])