mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-27 17:42:04 +08:00
LogReader: add tqdm back to run_across_segments (#31216)
tqdm old-commit-hash: 7835f9cce05b2f8743bbd632dd6a3093741e6bd2
This commit is contained in:
@@ -9,6 +9,7 @@ import os
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
import tqdm
|
||||
import urllib.parse
|
||||
import warnings
|
||||
|
||||
@@ -259,7 +260,8 @@ class LogReader:
|
||||
def run_across_segments(self, num_processes, func):
|
||||
with multiprocessing.Pool(num_processes) as pool:
|
||||
ret = []
|
||||
for p in pool.map(partial(self._run_on_segment, func), range(len(self.logreader_identifiers))):
|
||||
num_segs = len(self.logreader_identifiers)
|
||||
for p in tqdm.tqdm(pool.imap(partial(self._run_on_segment, func), range(num_segs)), total=num_segs):
|
||||
ret.extend(p)
|
||||
return ret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user