@@ -218,7 +218,9 @@ def map(year, ssp, tech, subtech, feature, is_ccs, coolingtype, capacity_factor,
218
218
tab_id , layer_catalogue
219
219
):
220
220
221
- start = time .time ()
221
+ logger .info (f"Map callback initiated." )
222
+
223
+ # start = time.time()
222
224
year = str (year )
223
225
query_df = tech_pathways_df .query ("ui_ssp in @ssp and \
224
226
ui_year in @year and \
@@ -233,15 +235,16 @@ def map(year, ssp, tech, subtech, feature, is_ccs, coolingtype, capacity_factor,
233
235
row = query_df .iloc [0 ]
234
236
cols = ['ssp' , 'ui_year' , 'tech' , 'subtype' , 'feature' , 'is_ccs' , 'cooling_type' , 'cap_factor' ]
235
237
result_string = "_" .join (str (row [col ]) for col in cols )
236
-
237
- print (f"{ ZARRPATH } /{ result_string } " )
238
+
239
+ logger . info (f"Zarr path. { ZARRPATH } /{ result_string } " )
238
240
store = s3 .get_mapper (f"{ ZARRPATH } /{ result_string } " ) # reading from the cloud adds two seconds (hopefully this speeds up)
241
+ logger .info (f"Read in zarr data. { store } " )
239
242
ds = xr .open_zarr (store ) # had to remove consolidated=True, but otherwise works
240
243
# folder_path = f"{ZARRPATH}/{result_string}"
241
244
# ds = xr.open_zarr(folder_path)
242
245
df = ds .to_dataframe ()
243
- end = time .time ()
244
- print (end - start )
246
+ # end = time.time()
247
+ # print(end-start)
245
248
246
249
if btn_text == "button2" : # dark
247
250
styling_dict = {"land" : [48 , 105 , 59 ],
@@ -259,7 +262,7 @@ def map(year, ssp, tech, subtech, feature, is_ccs, coolingtype, capacity_factor,
259
262
if ctx .triggered :
260
263
fig_div = plot_map (df_coors_long = df , fpaths = fpaths , styling_dict = styling_dict ) # takes 2.6 seconds
261
264
mapped_time = time .time ()
262
- print ( "Plot Map: " , mapped_time - start )
265
+ logger . info ( f" Map created." )
263
266
264
267
return fig_div
265
268
0 commit comments