@@ -76,15 +76,16 @@ def _run_graph_generation(self) -> None:
7676 final_fmt = out .final_file_format
7777
7878 if gt .user_user :
79- if getattr (p , "is_community" , False ) and getattr (p , "community_file" , "" ):
80- df = pd .read_csv (p .community_file )
79+ comm_cfg = getattr (p , "community" , None )
80+ if comm_cfg and getattr (comm_cfg , "is_community" , False ) and getattr (comm_cfg , "community_file" , "" ):
81+ df = pd .read_csv (comm_cfg .community_file )
8182 user_community_map = dict (
8283 zip (df ["user_id" ].astype (int ), df ["community" ].astype (int ))
8384 )
8485
8586 # ── automatical selection of strategy ──────────────────────────
86- strategy_name = getattr (p , "community_strategy" )
87- batch_size = getattr (p , "community_batch_size" )
87+ strategy_name = getattr (comm_cfg , "community_strategy" )
88+ batch_size = getattr (comm_cfg , "community_batch_size" )
8889
8990 if strategy_name == "batch" :
9091 strategy = CommunityUserBatchStrategy (user_community_map )
@@ -113,7 +114,7 @@ def _run_graph_generation(self) -> None:
113114 fast_rt_threshold = p .fast_rt_threshold ,
114115 strategy = strategy ,
115116 is_community_run = is_comm ,
116- community_file_path = getattr (p , "community_file" , None ) if is_comm else None ,
117+ community_file_path = getattr (comm_cfg , "community_file" , None ) if is_comm else None ,
117118 load_snapshot_status = p .load_snapshot .status if p .load_snapshot else False ,
118119 load_snapshot_tmp_path = p .load_snapshot .tmp_path if p .load_snapshot else ""
119120 )
0 commit comments