-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ellipse.py
More file actions
95 lines (84 loc) · 3.32 KB
/
test_ellipse.py
File metadata and controls
95 lines (84 loc) · 3.32 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env python3
"""
타원 시각화 테스트
"""
import requests
import json
BASE_URL = 'http://localhost:5000'
TEST_FILE = '/var/www/html/vowelspace/test/test_multi_speaker.csv'
print("=== 타원 시각화 테스트 ===\n")
# 1. Static 시각화 테스트
print("1. 일반 정적 시각화...")
with open(TEST_FILE, 'rb') as f:
files = {'files': ('test_multi_speaker.csv', f, 'text/csv')}
data = {'viz_type': 'static'}
response = requests.post(f'{BASE_URL}/upload', files=files, data=data)
if response.status_code == 200:
result = response.json()
if result.get('success'):
print(" ✅ 성공: 일반 정적 시각화")
else:
print(f" ❌ 실패: {result.get('error')}")
else:
print(f" ❌ HTTP 오류: {response.status_code}")
# 2. 타원 시각화 (포인트 포함) 테스트
print("\n2. 타원 시각화 (포인트 포함)...")
with open(TEST_FILE, 'rb') as f:
files = {'files': ('test_multi_speaker.csv', f, 'text/csv')}
data = {
'viz_type': 'ellipse',
'show_ellipses': 'true',
'show_points': 'true'
}
response = requests.post(f'{BASE_URL}/upload', files=files, data=data)
if response.status_code == 200:
result = response.json()
if result.get('success'):
print(" ✅ 성공: 타원 + 포인트")
summary = result.get('data_summary', {})
print(f" - 데이터 포인트: {summary.get('rows')}")
print(f" - 모음: {', '.join(summary.get('vowels', []))}")
else:
print(f" ❌ 실패: {result.get('error')}")
else:
print(f" ❌ HTTP 오류: {response.status_code}")
# 3. 타원만 시각화 테스트
print("\n3. 타원만 시각화 (포인트 제외)...")
with open(TEST_FILE, 'rb') as f:
files = {'files': ('test_multi_speaker.csv', f, 'text/csv')}
data = {
'viz_type': 'ellipse',
'show_ellipses': 'true',
'show_points': 'false'
}
response = requests.post(f'{BASE_URL}/upload', files=files, data=data)
if response.status_code == 200:
result = response.json()
if result.get('success'):
print(" ✅ 성공: 타원만 (포인트 제외)")
else:
print(f" ❌ 실패: {result.get('error')}")
else:
print(f" ❌ HTTP 오류: {response.status_code}")
# 4. 동적 궤적 시각화 테스트
print("\n4. 동적 포먼트 궤적...")
with open(TEST_FILE, 'rb') as f:
files = {'files': ('test_multi_speaker.csv', f, 'text/csv')}
data = {'viz_type': 'dynamic'}
response = requests.post(f'{BASE_URL}/upload', files=files, data=data)
if response.status_code == 200:
result = response.json()
if result.get('success'):
print(" ✅ 성공: 동적 궤적")
else:
print(f" ❌ 실패: {result.get('error')}")
else:
print(f" ❌ HTTP 오류: {response.status_code}")
print("\n=== 테스트 완료 ===")
print("\n💡 웹 브라우저에서 확인:")
print(f" {BASE_URL}")
print("\n✨ 새로운 기능:")
print(" 1. 시각화 유형에서 '타원 모음 공간' 선택")
print(" 2. 각 모음/화자/언어별로 95% 신뢰 타원 표시")
print(" 3. 개별 데이터 포인트 표시 옵션")
print(" 4. 레전드 클릭으로 특정 그룹 선택 가능")