76
76
from datetime import timedelta
77
77
import matplotlib .pyplot as plt
78
78
import numpy as np
79
+ import pandas as pd
79
80
from scipy .optimize import minimize
80
81
81
82
# memory constant functions defined for @resource_allocation_plot
@@ -2360,7 +2361,6 @@ def resource_allocation_plot(df, cname, sname, col_name):
2360
2361
Returns a matplotlib object with a plot
2361
2362
"""
2362
2363
2363
- # df = df[(df.cName == cname) & (df.sName == sname)]
2364
2364
df .dropna (subset = ['samples' , 'columns' ], inplace = True )
2365
2365
df [col_name ] = df .samples * df ['columns' ]
2366
2366
df [col_name ] = df [col_name ].astype (int )
@@ -2380,7 +2380,7 @@ def resource_allocation_plot(df, cname, sname, col_name):
2380
2380
return fig , axs
2381
2381
2382
2382
2383
- def _retrieve_resource_data (cname , sname ):
2383
+ def _retrieve_resource_data (cname , sname , columns ):
2384
2384
with qdb .sql_connection .TRN :
2385
2385
sql = """
2386
2386
SELECT
@@ -2411,8 +2411,8 @@ def _retrieve_resource_data(cname, sname):
2411
2411
"""
2412
2412
qdb .sql_connection .TRN .add (sql , sql_args = [cname , sname ])
2413
2413
res = qdb .sql_connection .TRN .execute_fetchindex ()
2414
- return res
2415
- pass
2414
+ df = pd . DataFrame ( res , columns = columns )
2415
+ return df
2416
2416
2417
2417
2418
2418
def _resource_allocation_plot_helper (
0 commit comments