@@ -32,7 +32,7 @@ def to_gres_options(stdout):
3232 gres_data = {}
3333 # key=gres_opt - 'name' or 'name:type', i.e. what would be passed to --gres
3434 # value={label:str, max_count: int, partitions=[]}
35- gres_data ["none" ] = {' label' : ' None' , ' max_count' : 0 , ' partitions' :[ ' all' ]}
35+ gres_data ["none" ] = {" label" : " None" , " max_count" : 0 , " partitions" : [ " all" ]}
3636
3737 for line in stdout .splitlines ():
3838 # line examples:
@@ -41,7 +41,7 @@ def to_gres_options(stdout):
4141 # - First example shows multiple GRES per partition
4242 # - Core suffix e.g. '(S:0-1)' only exists for auto-detected gres
4343 # - stackhpc.openhpc role guarantees that name:type:count all exist
44- partition , gres_definitions = ( line .split () )
44+ partition , gres_definitions = line .split ()
4545 for gres in gres_definitions .split ("," ):
4646 if "(null)" in gres :
4747 continue
@@ -54,17 +54,21 @@ def to_gres_options(stdout):
5454 if ":" in gres_opt
5555 else f"Any { gres_opt } "
5656 )
57- gres_data [gres_opt ] = {'label' :label , 'max_count' :gres_count , 'partitions' :[partition ]}
57+ gres_data [gres_opt ] = {
58+ "label" : label ,
59+ "max_count" : gres_count ,
60+ "partitions" : [partition ],
61+ }
5862 else :
59- gres_data [gres_opt ][' partitions' ].append (partition )
60- if gres_count > gres_data [gres_name ][' max_count' ]:
61- gres_data [gres_opt ][' max_count' ] = gres_count
63+ gres_data [gres_opt ][" partitions" ].append (partition )
64+ if gres_count > gres_data [gres_name ][" max_count" ]:
65+ gres_data [gres_opt ][" max_count" ] = gres_count
6266
6367 gres_options = []
6468 for gres_opt in gres_data : # pylint: disable=consider-using-dict-items
65- max_count = gres_data [gres_opt ][' max_count' ]
66- partitions = gres_data [gres_opt ][' partitions' ]
67- label = gres_data [gres_opt ][' label' ]
69+ max_count = gres_data [gres_opt ][" max_count" ]
70+ partitions = gres_data [gres_opt ][" partitions" ]
71+ label = gres_data [gres_opt ][" label" ]
6872 if gres_opt != "none" :
6973 label += f" (max count={ max_count } , partitions={ ',' .join (partitions )} )"
7074 gres_options .append ((label , gres_opt ))
0 commit comments