-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_adaptive_fix.py
More file actions
72 lines (56 loc) · 2.14 KB
/
test_adaptive_fix.py
File metadata and controls
72 lines (56 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python3
"""
Test the fixed adaptive system
"""
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), 'backend'))
def test_adaptive_fix():
"""Test the adaptive system fix"""
# Find the latest beatmap
output_dir = r"c:\Users\hypes\OneDrive\Desktop\Projects\BeatMapper\output"
latest_dir = None
latest_time = 0
for item in os.listdir(output_dir):
item_path = os.path.join(output_dir, item)
if os.path.isdir(item_path):
mod_time = os.path.getmtime(item_path)
if mod_time > latest_time:
latest_time = mod_time
latest_dir = item_path
if not latest_dir:
print("No beatmap found")
return
song_path = os.path.join(latest_dir, 'song.ogg')
if not os.path.exists(song_path):
print(f"Song file not found: {song_path}")
return
print(f"Testing with: {song_path}")
# Test the adaptive system directly
try:
from backend.processing.adaptive_notes_simple import generate_adaptive_notes_csv
test_output = "test_adaptive_fixed.csv"
print("Testing adaptive system...")
success = generate_adaptive_notes_csv(song_path, None, test_output, "EASY")
if success:
print("✅ Adaptive system working!")
# Check the output
with open(test_output, 'r') as f:
lines = f.readlines()
print(f"Generated {len(lines)-1} notes")
# Check first few notes
for i, line in enumerate(lines[:6]):
if i == 0:
print(f"Header: {line.strip()}")
else:
print(f"Note {i}: {line.strip()}")
# Clean up
os.remove(test_output)
else:
print("❌ Adaptive system still failing")
except Exception as e:
print(f"Error testing adaptive system: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
test_adaptive_fix()