Skip to content

Commit

Permalink
More dataset filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Mar 18, 2024
1 parent a35dbe5 commit 5f1e7e2
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/python/qualitative_analysis.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""Output a subset of the results that match a hard-coded condition."""
"""Output a subset of the results that match a hard-coded condition, to a hard-coded file."""

import pandas as pd

Expand All @@ -20,10 +20,26 @@ def is_success(val):
return val == "Tests_passed"


# Retain rows where gitmerge_ort_imports_ignorespace and gitmerge_ort_ignorespace differ.
df = df[
is_success(df.gitmerge_ort_imports_ignorespace)
!= is_success(df.gitmerge_ort_ignorespace)
]
def merge_failed(val):
"""Returns true if the given result indicates that the merge succeeded."""
return val == "Merge_failed"


def merge_succeeded(val):
"""Returns true if the given result indicates that the merge succeeded."""
return val != "Merge_failed"

df = df.to_csv("../../results/combined/imports-differs-from-ort.csv", index_label="idx")

# Retain rows where gitmerge_ort_imports_ignorespace and gitmerge_ort_ignorespace differ.
# df = df[
# merge_failed(df.gitmerge_ort_imports_ignorespace)
# != merge_failed(df.gitmerge_ort_ignorespace)
# ]
# df.to_csv("../../results/combined/imports-differs-from-ort.csv", index_label="idx")

# Select some rows.
df = df[merge_failed(df.gitmerge_ort) != merge_failed(df.spork)]
# Select some columns (is it OK to omit "idx"??)
df = df[["gitmerge_ort", "spork"]]

df.to_csv("../../results/combined/spork-differs-from-ort.csv", index_label="idx")

0 comments on commit 5f1e7e2

Please sign in to comment.