File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -138,14 +138,14 @@ def load_definition(name):
138
138
139
139
def load_state_file (name , states_dict ):
140
140
print ("Reading file " + name + "..." )
141
- file_str = None
141
+ file_str = ""
142
142
try :
143
143
with open (name , "r" ) as f :
144
144
file_str = f .read ()
145
145
except :
146
146
with open (name , "r" , encoding = 'cp1252' ) as f :
147
147
file_str = f .read ()
148
- if not file_str :
148
+ if not file_str . strip () :
149
149
return
150
150
try :
151
151
state_id = int (re .search (r"id\s*=\s*([0-9]+)" , file_str , re .IGNORECASE ).group (1 ))
@@ -281,17 +281,15 @@ def get_colors(name):
281
281
282
282
def get_sequential_colors (space , palette = "Reds" ):
283
283
palette = sns .color_palette (palette , space )
284
- print (palette )
285
284
for idx , item in enumerate (palette ):
286
285
palette [idx ] = [int (round (255 * x )) for x in item ]
287
- print (palette )
288
286
return palette
289
287
290
288
def get_state_color (value , space , colors ):
291
289
for idx in range (0 , len (colors )- 1 ):
292
290
if space [idx ] <= value < space [idx + 1 ]:
293
291
return colors [idx ]
294
- return colors [0 ]
292
+ return colors [len ( colors ) - 1 ]
295
293
296
294
def get_manpower_list (states_dict ):
297
295
manpower_list = []
You can’t perform that action at this time.
0 commit comments