Skip to content

Commit 6346abd

Browse files
committed
Script to help fix the mess Codex made of the repository
1 parent e7074a1 commit 6346abd

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# 1. Create experiments dir if it doesn't exist (it should)
5+
mkdir -p experiments
6+
7+
# List of files that are actually scripts, currently hiding in src/
8+
# I identified these based on your uploads and typical patterns.
9+
SCRIPTS=(
10+
"count_standard_basis_tensors.py"
11+
"verify_injective_face_map.py"
12+
"verify_degenerate_preference.py"
13+
"verify_degenerate_preference_range_tensor.py"
14+
"degenerate_counterexample.py"
15+
"discrepancy_test.py"
16+
"fixed_index_face_independence.py"
17+
"homotopy_constraint_verification.py"
18+
"homotopy_constraint_verification_with_independence_test.py"
19+
"n_cycle_conjugation.py"
20+
"n_hypergroupoid_conjecture.py"
21+
"petersen_permutation_test.py"
22+
"random_zero_one_mask_cocycle_test.py"
23+
)
24+
25+
echo "--- Moving Logic from src/ to experiments/ ---"
26+
27+
for file in "${SCRIPTS[@]}"; do
28+
src_path="src/simplicial_tensors/$file"
29+
dest_path="experiments/$file"
30+
trampoline_path="examples/$file"
31+
32+
if [[ -f "$src_path" ]]; then
33+
echo "Moving $src_path -> $dest_path"
34+
mv "$src_path" "$dest_path"
35+
36+
# 2. Fix the imports
37+
# Scripts inside the package used relative imports (from .tensor_ops).
38+
# Scripts outside must use absolute imports (from simplicial_tensors.tensor_ops).
39+
# We also strip the logging setup if it duplicates standard behavior, but for now we just fix imports.
40+
sed -i 's/from \.tensor_ops/from simplicial_tensors.tensor_ops/g' "$dest_path"
41+
sed -i 's/from \./from simplicial_tensors./g' "$dest_path"
42+
else
43+
echo "Warning: $src_path not found, skipping."
44+
fi
45+
46+
# 3. Delete the trampoline in examples/ if it exists
47+
if [[ -f "$trampoline_path" ]]; then
48+
echo "Deleting trampoline $trampoline_path"
49+
rm "$trampoline_path"
50+
fi
51+
done
52+
53+
# 4. Cleanup the "Hallucination" file if it exists
54+
if [[ -f "src/simplicial_tensors/Gemini_hallicination.py" ]]; then
55+
echo "Deleting src/simplicial_tensors/Gemini_hallicination.py"
56+
rm "src/simplicial_tensors/Gemini_hallicination.py"
57+
fi
58+
59+
echo "--- Cleanup Complete ---"
60+
echo "Your src/ directory is now lighter, and experiments/ contains the runnable code."

0 commit comments

Comments
 (0)