@@ -564,7 +564,7 @@ def update_resource_allocation_redis(active=True, verbose=False):
564
564
Defaults to True. Should only be False when testing.
565
565
566
566
verbose: boolean, optional
567
- Defaults to False. Prints status on what functin
567
+ Defaults to False. Prints status on what function
568
568
569
569
"""
570
570
time = datetime .now ().strftime ('%m-%d-%y' )
@@ -573,7 +573,7 @@ def update_resource_allocation_redis(active=True, verbose=False):
573
573
with qdb .sql_connection .TRN :
574
574
sql = 'SELECT col_name FROM qiita.resource_allocation_column_names;'
575
575
qdb .sql_connection .TRN .add (sql )
576
- col_names_list = qdb .sql_connection .TRN .execute_fetchflatten ()
576
+ col_names = qdb .sql_connection .TRN .execute_fetchflatten ()
577
577
578
578
# Retreave available software
579
579
software_list = list (qdb .software .Software .iter (active = active ))
@@ -590,14 +590,14 @@ def update_resource_allocation_redis(active=True, verbose=False):
590
590
591
591
for command in software .commands :
592
592
cmd_name = command .name
593
- scommands [sname ][sversion ][cmd_name ] = col_names_list
593
+ scommands [sname ][sversion ][cmd_name ] = col_names
594
594
595
595
redis_key = 'resources:commands'
596
596
r_client .set (redis_key , str (scommands ))
597
597
598
598
for sname , versions in scommands .items ():
599
599
for version , commands in versions .items ():
600
- for cname , col_name_list in commands .items ():
600
+ for cname , col_names in commands .items ():
601
601
df = retrieve_resource_data (cname , sname , version , COLUMNS )
602
602
if verbose :
603
603
print (("Retrieving allocation resources for " +
@@ -612,9 +612,9 @@ def update_resource_allocation_redis(active=True, verbose=False):
612
612
f" command: { cname } " ))
613
613
continue
614
614
# column_name_str looks like col1*col2*col3, etc
615
- for col_name_str in col_name_list :
615
+ for col_name in col_names :
616
616
new_column = None
617
- col_name_split = col_name_str .split ('*' )
617
+ col_name_split = col_name .split ('*' )
618
618
df_copy = df .dropna (subset = col_name_split )
619
619
620
620
# Create a column with the desired columns
@@ -628,10 +628,10 @@ def update_resource_allocation_redis(active=True, verbose=False):
628
628
f" software: { sname } " +
629
629
f" version: { version } " +
630
630
f" command: { cname } " +
631
- f" column name: { col_name_str } " ))
631
+ f" column name: { col_name } " ))
632
632
633
633
fig , axs = resource_allocation_plot (df_copy ,
634
- col_name_str ,
634
+ col_name ,
635
635
new_column ,
636
636
verbose = verbose )
637
637
titles = [0 , 0 ]
@@ -689,10 +689,10 @@ def update_resource_allocation_redis(active=True, verbose=False):
689
689
f" software: { sname } " +
690
690
f" version: { version } " +
691
691
f" command: { cname } " +
692
- f" column name: { col_name_str } " ))
692
+ f" column name: { col_name } " ))
693
693
694
694
for k , v , f in values :
695
695
redis_key = 'resources$#%s$#%s$#%s$#%s:%s' % (
696
- cname , sname , version , col_name_str , k )
696
+ cname , sname , version , col_name , k )
697
697
r_client .delete (redis_key )
698
698
f (redis_key , v )
0 commit comments