From 0084375002e99cb07e9ceb60e93fc48f58ad960f Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sat, 24 Jan 2015 22:39:01 -0500 Subject: [PATCH] Stop using numpy for just a mean This commit stops using numpy in the 5332fe255095 migration, which is a bit heavyweight to require for running migrations. Especially when you can accomplish the same task using python built-ins. Change-Id: Icbb22f7ffcba7f8b8e5de7ea38472a30a05cc598 --- requirements.txt | 1 - .../5332fe255095_populate_run_time_for_existing_tests.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index d2adddc..e960aef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,3 @@ python-subunit>=0.0.18 six>=1.5.2 SQLAlchemy>=0.7.8 pandas -numpy diff --git a/subunit2sql/migrations/versions/5332fe255095_populate_run_time_for_existing_tests.py b/subunit2sql/migrations/versions/5332fe255095_populate_run_time_for_existing_tests.py index 8ba1578..8d455e6 100644 --- a/subunit2sql/migrations/versions/5332fe255095_populate_run_time_for_existing_tests.py +++ b/subunit2sql/migrations/versions/5332fe255095_populate_run_time_for_existing_tests.py @@ -25,7 +25,6 @@ revision = '5332fe255095' down_revision = '28ac1ba9c3db' -import numpy as np from oslo.db.sqlalchemy import utils as db_utils from subunit2sql.db import api as db_api @@ -51,7 +50,7 @@ def upgrade(): results[test_run[0]] = [delta] for test in results: - avg = np.mean(results[test]) + avg = float(sum(results[test])) / float(len(results[test])) db_api.update_test({'run_time': avg}, test)