Commit 25eab08 1 parent 9fe54d8 commit 25eab08 Copy full SHA for 25eab08
File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1212,17 +1212,20 @@ def cpt_merge_x_files(file_paths):
1212
1212
items_lgth = {k : sum ([len (x ["areas" ]) for x in val ]) for k ,val in init_params .items ()}
1213
1213
empty_dpt = [k for k ,v in items_lgth .items () if v == 0 ]
1214
1214
lgth_list = [v for k ,v in items_lgth .items ()]
1215
+ bool_lgth = [x == 0 for x in lgth_list ]
1216
+
1215
1217
if len (empty_dpt ) > 0 :
1218
+ Warning ("Empty areas.json file found" )
1216
1219
for idx in range (len (items_lgth )):
1217
1220
if lgth_list [idx ] == 0 :
1218
1221
dir_names .pop (idx )
1219
1222
path_json .pop (idx )
1220
1223
path_stations .pop (idx )
1221
1224
for nm in empty_dpt :
1222
1225
init_params .pop (nm )
1223
-
1224
-
1225
1226
1227
+ if all (bool_lgth ):
1228
+ raise ValueError ("departments has ares.json file empty" )
1226
1229
1227
1230
month = int (date .today ().strftime ("%m" ))
1228
1231
year = int (date .today ().strftime ("%Y" ))
You can’t perform that action at this time.
0 commit comments