Skip to content

Commit

Permalink
Minor fixes (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-schesch authored Jul 12, 2024
1 parent e2f9c78 commit 89ef249
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 436 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ output.txt
replay_logs/
my.secrets

repos-small-test
output/
merge_repo/
merges_small_valid_subsamples/
Expand Down
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ check-python-style:
# This target deletes files that are not committed to version control.
clean:
${MAKE} clean-workdir
rm -rf repos
rm -rf repos-small-test
rm -rf scratch
rm -rf results/small
rm -rf .valid_merges_counters

clean-repos:
rm -rf repos
# This target deletes files in the cache, which is commited to version control.
clean-cache:
rm -rf cache
Expand Down Expand Up @@ -95,24 +97,19 @@ copy-paper:
rsync -av --exclude='*.csv' results ../AST-Merging-Evaluation-Paper/
find ../AST-Merging-Evaluation-Paper/ -type d -empty -delete

# Update cache
update-cache-results:
python3 src/python/cache_merger.py
make compress-cache

# As of 2023-07-31, this takes 5-20 minutes to run, depending on your machine.
small-test:
${MAKE} clean-test-cache clean
./run_small.sh --include_trivial_merges --no_timing
AST_REPOS_PATH=repos-small-test ./run_small.sh --include_trivial_merges --no_timing
${MAKE} compress-small-cache
${MAKE} small-test-diff
rm -rf results/small
./run_small.sh --include_trivial_merges --no_timing
AST_REPOS_PATH=repos-small-test ./run_small.sh --include_trivial_merges --no_timing
${MAKE} small-test-diff

small-test-without-cleaning:
${MAKE} clean-test-cache
./run_small.sh --include_trivial_merges --no_timing
AST_REPOS_PATH=repos-small-test ./run_small.sh --include_trivial_merges --no_timing
${MAKE} small-test-diff

update-figures:
Expand Down Expand Up @@ -147,7 +144,7 @@ clean-workdir:

clean-local:
${MAKE} clean-workdir
rm -rf repos
rm -rf repos-small-test

check-merges-reproducibility:
@echo "Running replay_merge sequentially for each idx..."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,6 @@ To run style checking run `make style`.

To investigate differences between two mergers:

* edit file `src/python/select_from_results.py` to reflect the differences you are interested in.
* run `src/python/select_from_results.py` to create a .csv database containing only the differences.
* edit file `src/python/utils/select_from_results.py` to reflect the differences you are interested in.
* run `src/python/utils/select_from_results.py` to create a .csv database containing only the differences.
* run `src/python/replay_merge.py --idx INDEX` (maybe add `-test`) for the index of the merge you are interested in.
13 changes: 4 additions & 9 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,12 @@ mkdir -p "$OUT_DIR"
if [ -d "$CACHE_DIR" ]; then
find "$CACHE_DIR" -name "*.lock" -delete
fi
if [ -d "repos" ]; then
find "repos/locks" -name "*.lock" -delete
REPOS_PATH=${AST_REPOS_PATH:-repos}
if [ -d "$REPOS_PATH" ]; then
find "$REPOS_PATH" -name "*.lock" -delete
fi

# Check if .workdir exists and delete it
if [ -d .workdir ]; then
chmod -R +w .workdir
rm -rf .workdir
fi

python3 src/python/delete_cache_placeholders.py \
python3 src/python/utils/delete_cache_placeholders.py \
--cache_dir "$CACHE_DIR"

python3 src/python/write_head_hashes.py \
Expand Down
86 changes: 0 additions & 86 deletions src/python/cache_merger.py

This file was deleted.

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
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""Delete the keys containing 'imports' in the JSON files in the given directory."""
"""Delete the keys containing the SHA of the merge tests from the cache."""

import pandas as pd
from pathlib import Path
Expand Down
68 changes: 0 additions & 68 deletions src/python/get-merge-output.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/python/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def copy_repo(self) -> None:
if not self.repo_path.exists():
self.clone_repo()
if self.local_repo_path.exists():
return
shutil.rmtree(self.local_repo_path, ignore_errors=True)
self.workdir.mkdir(parents=True, exist_ok=True)
shutil.copytree(
self.repo_path,
Expand Down
File renamed without changes.
File renamed without changes.
83 changes: 0 additions & 83 deletions src/python/utils/delete_adjacent_keys_from_cache.py

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 89ef249

Please sign in to comment.