mirror of
https://github.com/karma-riuk/crab.git
synced 2025-07-05 13:38:12 +02:00
added cute little units for the progress bars
This commit is contained in:
@ -428,7 +428,11 @@ def process_repo(
|
|||||||
|
|
||||||
n_good_prs = 0
|
n_good_prs = 0
|
||||||
with tqdm(
|
with tqdm(
|
||||||
total=prs.totalCount, desc=f"Processing prs of {repo_name}", leave=False, position=position
|
total=prs.totalCount,
|
||||||
|
desc=f"Processing prs of {repo_name}",
|
||||||
|
leave=False,
|
||||||
|
position=position,
|
||||||
|
unit="PR",
|
||||||
) as pbar:
|
) as pbar:
|
||||||
for pr in prs:
|
for pr in prs:
|
||||||
pbar.set_postfix({"pr": pr.number, "# new good found": n_good_prs})
|
pbar.set_postfix({"pr": pr.number, "# new good found": n_good_prs})
|
||||||
@ -500,6 +504,7 @@ def process_repos_parallel(
|
|||||||
with tqdm(
|
with tqdm(
|
||||||
total=len(repo_names),
|
total=len(repo_names),
|
||||||
desc="Processing repos",
|
desc="Processing repos",
|
||||||
|
unit="repo",
|
||||||
) as outer_pb, ProcessPoolExecutor(max_workers=n_workers) as executor:
|
) as outer_pb, ProcessPoolExecutor(max_workers=n_workers) as executor:
|
||||||
# Map each repo to a future
|
# Map each repo to a future
|
||||||
|
|
||||||
@ -579,7 +584,7 @@ def process_repos(
|
|||||||
dataset.entries.extend(pr2entry.values())
|
dataset.entries.extend(pr2entry.values())
|
||||||
dataset.to_json(args.output)
|
dataset.to_json(args.output)
|
||||||
|
|
||||||
with tqdm(total=len(df), desc="Processing repos") as pbar:
|
with tqdm(total=len(df), desc="Processing repos", unit="repo") as pbar:
|
||||||
for _, row in df.iterrows():
|
for _, row in df.iterrows():
|
||||||
repo_name = row["name"]
|
repo_name = row["name"]
|
||||||
assert isinstance(repo_name, str)
|
assert isinstance(repo_name, str)
|
||||||
|
Reference in New Issue
Block a user