Skip to content

feat: improve batch processing#19

Merged
LeiGuo622 merged 1 commit into
mainfrom
feat/improve-batch-processing
May 13, 2026
Merged

feat: improve batch processing#19
LeiGuo622 merged 1 commit into
mainfrom
feat/improve-batch-processing

Conversation

@LeiGuo622
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 13, 2026 08:26
@LeiGuo622 LeiGuo622 merged commit abe4fd2 into main May 13, 2026
4 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the test_prejudge.py batch script to write prejudge results to the output CSV incrementally (row-by-row) instead of accumulating all rows in memory and writing once at the end.

Changes:

  • Writes the output CSV header immediately, then appends each processed row as soon as it’s available.
  • Removes the in-memory results list in favor of streaming output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/test_prejudge.py

# First, read the input to get fieldnames
with open(input_path, 'r', encoding='utf-8') as f:
reader = csv.DictReader(f)
Comment thread test/test_prejudge.py
Comment on lines +103 to +107
# Append to output file immediately
with open(output_path, 'a', encoding='utf-8', newline='') as out_f:
writer = csv.DictWriter(out_f, fieldnames=fieldnames)
writer.writerow(row)
out_f.flush()
Comment thread test/test_prejudge.py
Comment on lines +109 to 110
print(f" Saved to {output_csv_path}")

Comment thread test/test_prejudge.py
output_path = Path(output_csv_path)

# First, read the input to get fieldnames
with open(input_path, 'r', encoding='utf-8') as f:
@LeiGuo622 LeiGuo622 deleted the feat/improve-batch-processing branch May 13, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants