Skip to content

Commit

Permalink
Create two separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-schesch committed Sep 23, 2024
1 parent 88f0467 commit 94785ab
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-reproducibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: jlumbroso/free-disk-space@main
- name: make check-merges-reproducibility
run: |
head -n 151 results/combined/result.csv > temp.csv && mv temp.csv results/combined/result.csv
head -n 151 results/combined/result_raw.csv > temp.csv && mv temp.csv results/combined/result_raw.csv
make check-merges-reproducibility
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ SH_SCRIPTS = $(shell grep --exclude-dir=build --exclude-dir=repos --exclude-di
BASH_SCRIPTS = $(shell grep --exclude-dir=build --exclude-dir=repos --exclude-dir=cache -r -l '^\#! \?\(/bin/\|/usr/bin/env \)bash' * | grep -v /.git/ | grep -v '~$$' | grep -v '\.tar$$' | grep -v gradlew)
PYTHON_FILES = $(shell find . -name '*.py' ! -path './repos/*' -not -path "./.workdir/*" -not -path "./cache*/*" | grep -v '/__pycache__/' | grep -v '/.git/' | grep -v gradlew | grep -v git-hires-merge)

CSV_RESULTS_COMBINED = results/combined/result.csv
CSV_RESULTS_GREATEST_HITS = results/greatest_hits/result.csv
CSV_RESULTS_REAPER = results/reaper/result.csv
CSV_RESULTS_COMBINED = results/combined/result_raw.csv
CSV_RESULTS_GREATEST_HITS = results/greatest_hits/result_raw.csv
CSV_RESULTS_REAPER = results/reaper/result_raw.csv
CSV_RESULTS = $(CSV_RESULTS_COMBINED)

NUM_PROCESSES = 0
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ make small-test
This runs the entire code on two small repos.
The output data appears in `results/small/`.

* `results/small/result.csv`: the final result
* `results/small/result_adjusted.csv`: the final result

* `results/small/merges/` contains all the merges.

* `results/small/merges_compared/` contains all merges and indicates whether the merge results are different and thus need to be analyzed.

* `results/small/merges_tested/` contains all merges that have been tested.

* `results/small/result.csv` contains the final result.
* `results/small/result_adjusted.csv` contains the final result.

### Perform full analysis

Expand All @@ -97,7 +97,7 @@ To run the stack on all repos and also diff the merges' outputs:

This will run the entire code on all the repos and automatically decompress the cache if `cache/` does not exist.
All the output data can be found in `results/`.
The final result is found in `results/result.csv`.
The final result is found in `results/result_adjusted.csv`.
Directory `results/merges` contains all the merges for each repo.
Directory `results/merges_tested` contains all the merges that have been tested.

Expand Down Expand Up @@ -248,7 +248,7 @@ To investigate differences between two mergers:
* Run `src/python/utils/select_from_results.py` to create a .csv database containing only the differences.
* Set `DELETE_WORKDIRS` to `false` in `src/python/variables.py`.
* Run `src/python/replay_merge.py --idx INDEX` (maybe add `-test`) for the index of the merge you are interested in.
If the merge is in the small test, you may need to add `--merges_csv ./test/small-goal-files/result.csv`.
If the merge is in the small test, you may need to add `--merges_csv ./test/small-goal-files/result_adjusted.csv`.

## Overwriting results manually

Expand Down
2 changes: 1 addition & 1 deletion src/python/delete_cache_entry_of_merge_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def delete_row(row):
parser.add_argument(
"--result",
type=str,
default="results/combined/result.csv",
default="results/combined/result_adjusted.csv",
help="The result csv file.",
)
parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion src/python/delete_tests_with_different_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main():
parser.add_argument(
"--result",
type=str,
default="results/combined/result.csv",
default="results/combined/result_adjusted.csv",
help="The result csv file.",
)
rows_affected = 0
Expand Down
7 changes: 3 additions & 4 deletions src/python/latex_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ def main():

print(f"CSV saved to: {csv_filename}")
print(f"Rows: {len(filtered_df)}")

result_df.to_csv(args.output_dir / "result_raw.csv", index_label="idx")

for merge_tool in MERGE_TOOL:
result_df[merge_tool.name + "_raw"] = result_df[merge_tool.name]
for idx, row in result_df.iterrows():
for merge_tool in MERGE_TOOL:
if "plus" in merge_tool.name:
Expand All @@ -507,8 +507,7 @@ def main():
if result1.name == MERGE_STATE.Merge_failed.name \
and result2.name == TEST_STATE.Tests_failed.name:
result_df.loc[idx, merge_tool.name] = TEST_STATE.Tests_failed.name

result_df.to_csv(args.output_dir / "result.csv", index_label="idx")
result_df.to_csv(args.output_dir / "result_adjusted.csv", index_label="idx")

main_df = result_df[result_df["branch_name"].isin(main_branch_names)]
feature = result_df[~result_df["branch_name"].isin(main_branch_names)]
Expand Down
2 changes: 1 addition & 1 deletion src/python/replay_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def merge_replay(
"--merges_csv",
help="CSV file with merges that have been tested",
type=str,
default="results/combined/result.csv",
default="results/combined/result_adjusted.csv",
)
parser.add_argument(
"--idx",
Expand Down
2 changes: 1 addition & 1 deletion src/python/utils/build_inconsistent_merges.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def main():
"--result_csv",
type=str,
help="Path to the result CSV file",
default="results/combined/result.csv",
default="results/combined/result_adjusted.csv",
)
parser.add_argument(
"--output_csv",
Expand Down
2 changes: 1 addition & 1 deletion src/python/utils/select_from_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def main():
parser.add_argument(
"--input",
action="store",
default="results/combined/result.csv",
default="results/combined/result_adjusted.csv",
)
parser.add_argument("columns", nargs=argparse.REMAINDER)
args = parser.parse_args()
Expand Down

0 comments on commit 94785ab

Please sign in to comment.