Skip to content

Commit 2f3a4bc

Browse files
committed
Remove unsed stdev function
1 parent 50e1483 commit 2f3a4bc

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

src/acquisition/covidcast/database.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -231,36 +231,6 @@ def insert_or_update_batch(self, cc_rows, batch_size=2**20, commit_partial=False
231231
self._cursor.execute(drop_tmp_table_sql)
232232
return total
233233

234-
def get_data_stdev_across_locations(self, max_day):
235-
"""
236-
Return the standard deviation of daily data over all locations, for all
237-
(source, signal, geo_type) tuples.
238-
239-
`max_day`: base the standard deviation on data up to, and including, but
240-
not after, this day (e.g. for a stable result over time)
241-
"""
242-
243-
sql = '''
244-
SELECT
245-
`source`,
246-
`signal`,
247-
`geo_type`,
248-
COALESCE(STD(`value`), 0) AS `aggregate_stdev`
249-
FROM
250-
`covidcast`
251-
WHERE
252-
`time_type` = 'day' AND
253-
`time_value` <= %s
254-
GROUP BY
255-
`source`,
256-
`signal`,
257-
`geo_type`
258-
'''
259-
260-
args = (max_day,)
261-
self._cursor.execute(sql, args)
262-
return list(self._cursor)
263-
264234
def get_covidcast_meta(self):
265235
"""Compute and return metadata on all non-WIP COVIDcast signals."""
266236

tests/acquisition/covidcast/test_database.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -73,32 +73,6 @@ def test_count_all_rows_query(self):
7373
self.assertIn('select count(1)', sql)
7474
self.assertIn('from `covidcast`', sql)
7575

76-
def test_get_data_stdev_across_locations_query(self):
77-
"""Query to get signal-level standard deviation looks sensible.
78-
79-
NOTE: Actual behavior is tested by integration test.
80-
"""
81-
82-
args = ('max_day',)
83-
mock_connector = MagicMock()
84-
database = Database()
85-
database.connect(connector_impl=mock_connector)
86-
87-
database.get_data_stdev_across_locations(*args)
88-
89-
connection = mock_connector.connect()
90-
cursor = connection.cursor()
91-
self.assertTrue(cursor.execute.called)
92-
93-
sql, args = cursor.execute.call_args[0]
94-
expected_args = ('max_day',)
95-
self.assertEqual(args, expected_args)
96-
97-
sql = sql.lower()
98-
self.assertIn('select', sql)
99-
self.assertIn('`covidcast`', sql)
100-
self.assertIn('std(', sql)
101-
10276
def test_update_covidcast_meta_cache_query(self):
10377
"""Query to update the metadata cache looks sensible.
10478

0 commit comments

Comments
 (0)