@@ -199,8 +199,10 @@ def remove_timeseries_with_duplicated(df: pd.DataFrame) -> pd.DataFrame:
199199 df = df .drop_duplicates ("DAY" , keep = "first" )
200200
201201 if "date" in df .columns and len (df ) > 1 :
202- df ['TIMEDIFF' ] = pd .to_datetime (df ['date' ].shift (- 1 )) - pd .to_datetime (df ['date' ])
203- df = df [~ (df ['TIMEDIFF' ] < timedelta (seconds = 60 ))]
202+ df ["TIMEDIFF" ] = pd .to_datetime (df ["date" ].shift (- 1 )) - pd .to_datetime (
203+ df ["date" ]
204+ )
205+ df = df [~ (df ["TIMEDIFF" ] < timedelta (seconds = 60 ))]
204206 df = df .drop (columns = ["TIMEDIFF" ])
205207
206208 # Remember to remove the temp column day in result_df
@@ -290,7 +292,6 @@ def save_df_as_csv(single_polygon_df, feature_id, outpath, remove_duplicated_dat
290292 single_polygon_df .drop (
291293 ["overall_veg_num" , "veg_areas" , "index" ], axis = 1 , inplace = True
292294 )
293-
294295 if not outpath .startswith ("s3://" ):
295296 os .makedirs (Path (filename ).parent , exist_ok = True )
296297 with fsspec .open (filename , "w" ) as f :
@@ -315,9 +316,9 @@ def stack_wit_tooling_to_single_file(
315316
316317 verbose : bool
317318 """
319+
318320 polygon_df_list = []
319321 logger .info ("Reading..." )
320-
321322 # Note: the stack_wit_tooling_to_single_file() input files are CSV file, which generate by save_df_as_csv()
322323 # then we assume they already had the norm_pv, norm_npv, norm_bs there.
323324 with tqdm (total = len (paths )) as bar :
@@ -391,7 +392,8 @@ def stack_wit_tooling(
391392 """
392393 wit_df_list = []
393394 logger .info ("Reading..." )
394-
395+ # Note: the stack_wit_tooling_to_single_file() input files are CSV file, which generate by save_df_as_csv()
396+ # then we assume they already had the norm_pv, norm_npv, norm_bs there.
395397 with tqdm (total = len (paths )) as bar :
396398 with concurrent .futures .ThreadPoolExecutor (max_workers = 32 ) as executor :
397399 wit_df_list = []
@@ -424,7 +426,6 @@ def stack_wit_tooling(
424426
425427 # delete the temp result to release RAM
426428 del wit_result
427-
428429 with tqdm (total = len (feature_ids )) as bar :
429430 with concurrent .futures .ThreadPoolExecutor (
430431 max_workers = multiprocessing .cpu_count ()
0 commit comments