qingy2024 commited on
Commit
04f9995
·
verified ·
1 Parent(s): 4d16f24

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. src/lrmc_pool_proteins.py +5 -0
src/lrmc_pool_proteins.py CHANGED
@@ -182,6 +182,11 @@ def load_lrmc_cache(cache_path: str):
182
  cache_data = pickle.load(f)
183
  return cache_data['dataset'], cache_data['lrmc_config']
184
 
 
 
 
 
 
185
  def validate_cache_config(cached_config: dict, current_config: dict) -> bool:
186
  """Check if cached config matches current LRMC config."""
187
  lrmc_keys = current_config.keys()
 
182
  cache_data = pickle.load(f)
183
  return cache_data['dataset'], cache_data['lrmc_config']
184
 
185
+ def get_cache_filename(dataset_name: str, epsilon: int, target_ratio: float, min_size: int, max_clusters: Optional[int]) -> str:
186
+ """Generate a human-readable cache filename."""
187
+ max_clusters_str = str(max_clusters) if max_clusters is not None else "inf"
188
+ return f"lrmc_{dataset_name}_eps{epsilon}_ratio{target_ratio}_min{min_size}_max{max_clusters_str}.pkl"
189
+
190
  def validate_cache_config(cached_config: dict, current_config: dict) -> bool:
191
  """Check if cached config matches current LRMC config."""
192
  lrmc_keys = current_config.keys()