Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invert Defects4J diffs #68

Open
andre15silva opened this issue Jun 29, 2023 · 1 comment
Open

invert Defects4J diffs #68

andre15silva opened this issue Jun 29, 2023 · 1 comment

Comments

@andre15silva
Copy link
Member

The diff files we are loading from Defects4J are inverted (i.e., the source file is the fixed version, and the target file is the buggy version).

This is not intuitive so we should invert them after loading.

# Read diff from file
diff_path = '../benchmarks/defects4j/framework/projects/{}/patches/{}.src.patch'.format(pid, bid)
with open(diff_path, "r", encoding = "ISO-8859-1") as diff_file:
diff = diff_file.read()

@TomasAndersonFang
Copy link
Member

The diff files we are loading from Defects4J are inverted (i.e., the source file is the fixed version, and the target file is the buggy version).

This is not intuitive so we should invert them after loading.

# Read diff from file
diff_path = '../benchmarks/defects4j/framework/projects/{}/patches/{}.src.patch'.format(pid, bid)
with open(diff_path, "r", encoding = "ISO-8859-1") as diff_file:
diff = diff_file.read()

If you implement it, please inform me. And I will modify my implementation of cloze prompt to keep consistency with you.

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

No branches or pull requests

2 participants