Commit ed5cb151 authored by Cecilia Nievas's avatar Cecilia Nievas
Browse files

Print DONE at the end of each script

parent d4336898
......@@ -392,7 +392,7 @@ def run_this_file(config_dict):
print('ERROR WHEN CHECKING check_obm_leftover_visual_vs_OQ.csv!!!')
out_csv.close()
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -226,7 +226,8 @@ def run_this_file(config_dict):
plt.savefig(filename, format="png", dpi=300)
plt.close()
plt.clf()
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -84,7 +84,9 @@ def run_this_file(config_dict):
if assign_admin_IDs:
gdet_psql.assign_admin_IDs_to_OBM_footprints(DB_name_bdgs, DB_username_bdgs, DB_schema_name_bdgs, DB_table_name_bdgs, DB_schema_name_admin, DB_table_name_admin, occupancy_case, adm_level, method=method_to_use, obm_ids_to_process= obm_ids_to_process_list)
print('\n')
print('\n')
print('Done!')
if __name__=='__main__':
# This code needs to be run from the command line as python3 namefile.py configfile.ini
......
......@@ -97,7 +97,8 @@ def run_this_file(config_dict):
out_str= gdet_gral.write_bdgs_to_cell_hdf(bdgs_df_i_case, grid_cell_id, case, os.path.join(out_path, 'OBM_bdgs_in_cells'), sera_disaggregation_to_consider, out_path)
if out_str!='':
log.append('Cell ID '+str(grid_cell_id)+', '+case+': '+out_str)
print('\n')
print('\n')
print('Done!')
# Dump the log list to a file:
now= datetime.datetime.now()
now_str= str(now.year)+'_'+str(now.month)+'_'+str(now.day)+'_'+str(now.hour)+'_'+str(now.minute)+'_'+str(now.second)
......
......@@ -60,6 +60,7 @@ def run_this_file(config_dict):
print('Working on '+country_name+', country '+str(k+1)+' of '+str(len(countries))+'\n')
admin_levels, level_groups, level_groups_levels, _= gdet_sera.get_admin_level_definition(country_name, sera_models_path, output_dfs=False, full_files=True, complete_missing_cols=False)
gdet_gral.write_SERA_metadata_HDF5(country_name, admin_levels, level_groups, level_groups_levels, os.path.join(out_path, 'Europe_SERA_metadata_v_'+version_of_SERA_metadata+'.hdf5'))
print('\n')
print('Done!')
......
......@@ -179,7 +179,8 @@ def run_this_file(config_dict):
now= datetime.datetime.now()
now_str= str(now.year)+'_'+str(now.month)+'_'+str(now.day)+'_'+str(now.hour)+'_'+str(now.minute)+'_'+str(now.second)
gdet_gral.write_log_file(log, os.path.join(out_path, 'input_files_for_OQ', 'log_file_'+now_str+'.txt'))
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -205,6 +205,7 @@ def run_this_file(config_dict):
print(string)
out_csv.write(string+'\n')
out_csv.close()
print('\n')
print('Done!')
......
......@@ -109,7 +109,9 @@ def run_this_file(config_dict):
now= datetime.datetime.now()
now_str= str(now.year)+'_'+str(now.month)+'_'+str(now.day)+'_'+str(now.hour)+'_'+str(now.minute)+'_'+str(now.second)
gdet_gral.write_log_file(log, os.path.join(out_path, 'log_file_'+now_str+'.txt'))
print('\n')
print('Done!')
if __name__=='__main__':
# This code needs to be run from the command line as python3 namefile.py configfile.ini
......
......@@ -63,7 +63,9 @@ def run_this_file(config_dict):
now= datetime.datetime.now()
now_str= str(now.year)+'_'+str(now.month)+'_'+str(now.day)+'_'+str(now.hour)+'_'+str(now.minute)+'_'+str(now.second)
gdet_gral.write_log_file(log, os.path.join(out_path, 'SERA_check_IDs_unequivocally_defined_results_'+now_str+'.txt'))
print('\n')
print('Done!')
if __name__=='__main__':
# This code needs to be run from the command line as python3 namefile.py configfile.ini
......
......@@ -61,7 +61,8 @@ def run_this_file(config_dict):
print(' '+case+': Only one point per admin unit (at which the model is defined): '+str(have_one_point_per_ID[k]))
# Dump the log list to a file:
gdet_gral.write_log_file(log, os.path.join(out_path, 'SERA_check_one_point_per_ID_results.txt'))
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -81,7 +81,8 @@ def run_this_file(config_dict):
outcsv= open(os.path.join(out_path, 'list_SERA_countries.csv'), 'w')
outcsv.write(','.join(out_res))
outcsv.close()
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -134,7 +134,8 @@ def run_this_file(config_dict):
check_05= do_check_tolerance(ratio_05, diff_05, tolerance_ratio, tolerance_diff)
f_out.write(country_name+','+case+','+check_01+','+check_02+','+check_03+','+check_04+','+check_05+','+'{:.2f}'.format(diff_01.max())+','+'{:.2f}'.format(diff_02.max())+','+'{:.2f}'.format(diff_03.max())+','+'{:.2f}'.format(diff_04.max())+','+'{:.2f}'.format(diff_05.max())+','+'{:.6f}'.format(ratio_01.max())+','+'{:.6f}'.format(ratio_02.max())+','+'{:.6f}'.format(ratio_03.max())+','+'{:.6f}'.format(ratio_04.max())+','+'{:.6f}'.format(ratio_05.max())+'\n')
f_out.close()
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -70,7 +70,7 @@ def run_this_file(config_dict):
max_tot= len_sum
print('\n')
print('Largest combination of all has '+str(max_tot)+' characters.') # answer on 10 March 2020: 45 characters
print('Done!')
if __name__=='__main__':
# This code needs to be run from the command line as python3 namefile.py configfile.ini
......
......@@ -94,7 +94,8 @@ def run_this_file(config_dict):
which_dont_str= ''
f.write(col+','+str(countries_have_it)+','+str(len(countries)-countries_have_it)+','+which_do_str+','+which_dont_str+'\n')
f.close()
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -108,7 +108,8 @@ def run_this_file(config_dict):
now= datetime.datetime.now()
now_str= str(now.year)+'_'+str(now.month)+'_'+str(now.day)+'_'+str(now.hour)+'_'+str(now.minute)+'_'+str(now.second)
gdet_gral.write_log_file(log, os.path.join(out_path, 'log_file_'+now_str+'.txt'))
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -123,6 +123,7 @@ def run_this_file(config_dict):
now_str= str(now.year)+'_'+str(now.month)+'_'+str(now.day)+'_'+str(now.hour)+'_'+str(now.minute)+'_'+str(now.second)
gdet_gral.write_log_file(log, os.path.join(out_path, 'log_file_adding_GHS_'+now_str+'.txt'))
print('\n')
print('Done!')
......
......@@ -109,6 +109,7 @@ def run_this_file(config_dict):
now_str= str(now.year)+'_'+str(now.month)+'_'+str(now.day)+'_'+str(now.hour)+'_'+str(now.minute)+'_'+str(now.second)
gdet_gral.write_log_file(log, os.path.join(out_path, 'log_file_adding_GPW_'+now_str+'.txt'))
print('\n')
print('Done!')
......
......@@ -108,6 +108,7 @@ def run_this_file(config_dict):
now_str= str(now.year)+'_'+str(now.month)+'_'+str(now.day)+'_'+str(now.hour)+'_'+str(now.minute)+'_'+str(now.second)
gdet_gral.write_log_file(log, os.path.join(out_path, 'log_file_adding_Sat_'+now_str+'.txt'))
print('\n')
print('Done!')
if __name__=='__main__':
......
......@@ -94,11 +94,10 @@ def run_this_file(config_dict):
print(' ERROR!! CELL ID '+str(cell_id)+' FOUND MORE THAN ONCE IN VISUAL OUTPUT CSV!!!')
row_read[which]= True
print('\n')
print('Done!')
print('\n')
print('Total cost OQ: '+'{:.2f}'.format(full_cost_oq))
print('Total cost visual: '+'{:.2f}'.format(full_cost_visual))
print('\n')
print('Done!')
if __name__=='__main__':
# This code needs to be run from the command line as python3 namefile.py configfile.ini
......
......@@ -134,7 +134,8 @@ def run_this_file(config_dict):
for i, cell_id_i in enumerate(test_list_of_cells):
out.write(str(cell_id_i)+','+'{:.6f}'.format(out_lon[i])+','+'{:.6f}'.format(out_lat[i])+","+out_check_diff_occups[i]+','+out_check_full_vs_pieces[i]+','+out_area_full[i]+','+out_area_pieces[i]+','+out_area_diff[i]+'\n')
out.close()
print('\n')
print('Done!')
if __name__=='__main__':
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment