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
This commit is contained in:
parent
e489159537
commit
0084375002
@ -6,4 +6,3 @@ python-subunit>=0.0.18
|
|||||||
six>=1.5.2
|
six>=1.5.2
|
||||||
SQLAlchemy>=0.7.8
|
SQLAlchemy>=0.7.8
|
||||||
pandas
|
pandas
|
||||||
numpy
|
|
||||||
|
@ -25,7 +25,6 @@ revision = '5332fe255095'
|
|||||||
down_revision = '28ac1ba9c3db'
|
down_revision = '28ac1ba9c3db'
|
||||||
|
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
from oslo.db.sqlalchemy import utils as db_utils
|
from oslo.db.sqlalchemy import utils as db_utils
|
||||||
|
|
||||||
from subunit2sql.db import api as db_api
|
from subunit2sql.db import api as db_api
|
||||||
@ -51,7 +50,7 @@ def upgrade():
|
|||||||
results[test_run[0]] = [delta]
|
results[test_run[0]] = [delta]
|
||||||
|
|
||||||
for test in results:
|
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)
|
db_api.update_test({'run_time': avg}, test)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user