@@ -193,17 +193,21 @@ def _safe_file_stem(name: str, default: str) -> str:
193193 return stem
194194
195195
196- def _stand_cache_path (output_folder : str , input_name : str , stand_kind : str ) -> str :
196+ def _stand_cache_path (
197+ output_folder : str , input_name : str , stand_kind : str , blocker_mode : str
198+ ) -> str :
197199 """
198200 input_name: original input file name (or a descriptive label like 'API').
199201 stand_kind: 'stand_min' or 'stand_full'.
200- Produces <output_folder>/<input_stem>_<stand_kind>.parquet
202+ blocker_mode: 'postcode' or 'street' (cache isolation by match mode).
203+ Produces <output_folder>/<input_stem>_<stand_kind>_<blocker_mode>.parquet
201204 """
202205 stem = _safe_file_stem (input_name , default = "data" )
203206 out_dir = output_folder or ""
204207 if out_dir and not out_dir .endswith ((os .sep , "/" )):
205208 out_dir = out_dir + os .sep
206- return os .path .join (out_dir , f"{ stem } _{ stand_kind } .parquet" )
209+ mode = _safe_file_stem (blocker_mode , default = "postcode" )
210+ return os .path .join (out_dir , f"{ stem } _{ stand_kind } _{ mode } .parquet" )
207211
208212
209213def _standardise_search_df (
@@ -1913,8 +1917,13 @@ def _notify_ui(level: str, message: str) -> None:
19131917 progress (0.1 , desc = "Performing minimal standardisation" )
19141918
19151919 _stand_out = getattr (InitMatch , "output_folder" , None ) or output_folder
1916- _path_min_s = _stand_cache_path (_stand_out , InitMatch .file_name , "stand_min" )
1917- _path_min_r = _stand_cache_path (_stand_out , InitMatch .ref_name , "stand_min" )
1920+ _cache_mode = "postcode" if use_postcode_blocker else "street"
1921+ _path_min_s = _stand_cache_path (
1922+ _stand_out , InitMatch .file_name , "stand_min" , _cache_mode
1923+ )
1924+ _path_min_r = _stand_cache_path (
1925+ _stand_out , InitMatch .ref_name , "stand_min" , _cache_mode
1926+ )
19181927
19191928 def _cache_is_compatible (
19201929 cached_df : pd .DataFrame ,
@@ -2063,8 +2072,12 @@ def _cache_is_compatible(
20632072
20642073 # Standardise - full
20652074 tic = time .perf_counter ()
2066- _path_full_s = _stand_cache_path (_stand_out , InitMatch .file_name , "stand_full" )
2067- _path_full_r = _stand_cache_path (_stand_out , InitMatch .ref_name , "stand_full" )
2075+ _path_full_s = _stand_cache_path (
2076+ _stand_out , InitMatch .file_name , "stand_full" , _cache_mode
2077+ )
2078+ _path_full_r = _stand_cache_path (
2079+ _stand_out , InitMatch .ref_name , "stand_full" , _cache_mode
2080+ )
20682081
20692082 _loaded_full_s = False
20702083 if USE_EXISTING_STANDARDISED_FILES and os .path .isfile (_path_full_s ):
0 commit comments