HH/check_report.py

32 lines
1.2 KiB
Python

#!/usr/bin/env python
"""Check the enhanced survey analytics report"""
import json
with open('test_analytics_output/survey_analytics_data.json', 'r') as f:
data = json.load(f)
template = data['templates'][0]
print('=== Rankings ===')
rankings = template.get('rankings', {})
print(f'Top 5 by score: {len(rankings.get("top_5_by_score", []))}')
print(f'Bottom 5 by score: {len(rankings.get("bottom_5_by_score", []))}')
print(f'Top 5 by correlation: {len(rankings.get("top_5_by_correlation", []))}')
print(f'Most skipped 5: {len(rankings.get("most_skipped_5", []))}')
print('\n=== Insights ===')
insights = template.get('insights', [])
print(f'Number of insights: {len(insights)}')
for i, insight in enumerate(insights[:3], 1):
print(f'{i}. [{insight["severity"]}] {insight["category"]}: {insight["message"][:80]}...')
print('\n=== Channel Performance ===')
channels = template.get('channel_performance', {})
print(f'Channels tracked: {list(channels.keys())[:5]}')
print('\n=== Question Stats ===')
if template.get('questions'):
q = template['questions'][0]
print(f'Has skewness: {"skewness" in q}')
print(f'Has kurtosis: {"kurtosis" in q}')
print(f'Has correlation: {"correlation_with_overall" in q}')