@@ -110,7 +110,7 @@ def _seedChangedFromHf(codes: list[str], *, token: str | None) -> tuple[int, set
110110 tok = _resolveHfToken (token )
111111 remote = _hfFileSet (repo , token = tok ) # spurious 404 vs 진짜 신규 구분 oracle
112112
113- def seedOne (code : str ) -> tuple [str , bool , bool ]:
113+ def _seedOne (code : str ) -> tuple [str , bool , bool ]:
114114 """종목 하나의 tar 를 받아 풀고 (code, 추출 성공, safe) 를 돌려준다. 분기는 전부 안에서 처리한다."""
115115 try :
116116 local = retryHfCall (
@@ -153,7 +153,7 @@ def seedOne(code: str) -> tuple[str, bool, bool]:
153153 n = 0
154154 safe : set [str ] = set ()
155155 with ThreadPoolExecutor (max_workers = _SEED_WORKERS , thread_name_prefix = "tar-seed" ) as executor :
156- for seededCode , extractedOk , isSafe in executor .map (seedOne , codes ):
156+ for seededCode , extractedOk , isSafe in executor .map (_seedOne , codes ):
157157 n += int (extractedOk )
158158 if isSafe :
159159 safe .add (seededCode )
@@ -198,7 +198,7 @@ def _seedPanelFromHf(codes: list[str], *, token: str | None) -> tuple[int, set[s
198198 tok = _resolveHfToken (token )
199199 remote = _hfFileSet (repo , token = tok ) # spurious 404 vs 진짜 신규 구분 oracle
200200
201- def seedOne (code : str ) -> tuple [str , bool , bool ]:
201+ def _seedOne (code : str ) -> tuple [str , bool , bool ]:
202202 """종목 하나의 panel parquet 를 merge base 로 받아 (code, 받음, safe) 를 돌려준다."""
203203 try :
204204 retryHfCall ( # HF read SSOT(core.hfRetry). 429/503/504 단일 백오프
@@ -221,7 +221,7 @@ def seedOne(code: str) -> tuple[str, bool, bool]:
221221 n = 0
222222 safe : set [str ] = set ()
223223 with ThreadPoolExecutor (max_workers = _SEED_WORKERS , thread_name_prefix = "panel-seed" ) as executor :
224- for seededCode , fetchedOk , isSafe in executor .map (seedOne , codes ):
224+ for seededCode , fetchedOk , isSafe in executor .map (_seedOne , codes ):
225225 n += int (fetchedOk )
226226 if isSafe :
227227 safe .add (seededCode )
@@ -415,7 +415,7 @@ def _buildPanelIncremental(
415415 pending : list [str ] = [] # merge 완료 · HF 미업로드(checkpoint 대기)
416416 failed = 0
417417
418- def flushUpload (* , final : bool ) -> None :
418+ def _flushUpload (* , final : bool ) -> None :
419419 """merge 가 끝나 대기 중인 종목이 uploadEvery 에 찼거나(final 이면 남은 전부) panel 을 HF 에 올린다."""
420420 nonlocal pending
421421 if uploadEvery is None or not pending or (not final and len (pending ) < uploadEvery ):
@@ -441,7 +441,7 @@ def buildOne(code: str) -> tuple[str, dict[str, int] | None, Exception | None]:
441441 with ThreadPoolExecutor (max_workers = workers , thread_name_prefix = "panel-incremental" ) as executor :
442442 running : set [Future [tuple [str , dict [str , int ] | None , Exception | None ]]] = set ()
443443
444- def submitNext () -> None :
444+ def _submitNext () -> None :
445445 """다음 종목 하나만 executor 에 넣는다(입력 소진이나 마감이면 아무것도 안 한다)."""
446446 if deadline is not None and time .monotonic () >= deadline :
447447 return
@@ -450,7 +450,7 @@ def submitNext() -> None:
450450 running .add (executor .submit (buildOne , code ))
451451
452452 for _ in range (workers ):
453- submitNext ()
453+ _submitNext ()
454454 while running :
455455 future = next (as_completed (running ))
456456 running .remove (future )
@@ -462,9 +462,9 @@ def submitNext() -> None:
462462 elif out :
463463 built .append (code )
464464 pending .append (code )
465- flushUpload (final = False )
466- submitNext ()
467- flushUpload (final = True )
465+ _flushUpload (final = False )
466+ _submitNext ()
467+ _flushUpload (final = True )
468468 left = sum (1 for _ in queue )
469469 if left :
470470 # 실패가 아니다. 남은 종목의 신규 rcept 는 HF panel 에 없으므로 reconcile 이 누락으로 잡아 이어 받는다.
0 commit comments