Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,6 +33,7 @@ from cryptography.fernet import Fernet
|
|
| 33 |
import calendar
|
| 34 |
from dateutil.relativedelta import relativedelta
|
| 35 |
import numpy as np
|
|
|
|
| 36 |
|
| 37 |
# Enhanced Configuration
|
| 38 |
PROFILES_DIR = "student_profiles"
|
|
@@ -489,7 +490,7 @@ class EnhancedTranscriptParser:
|
|
| 489 |
grade = course.get('grade_earned', '').upper()
|
| 490 |
if grade in grade_points:
|
| 491 |
weight = 1.0 if any(x in course.get('course_name', '').upper()
|
| 492 |
-
|
| 493 |
weighted_grades.append(grade_points[grade] + weight)
|
| 494 |
|
| 495 |
if weighted_grades:
|
|
@@ -894,7 +895,7 @@ class AcademicAnalyzer:
|
|
| 894 |
{
|
| 895 |
'code': code,
|
| 896 |
'description': req.get('description', ''),
|
| 897 |
-
'remaining': float(req.get('required', 0)) - float(req.get('completed', 0)),
|
| 898 |
'status': req.get('status', '')
|
| 899 |
}
|
| 900 |
for code, req in parsed_data.get('requirements', {}).items()
|
|
@@ -1386,6 +1387,7 @@ class DataVisualizer:
|
|
| 1386 |
textposition='inside',
|
| 1387 |
textinfo='percent+label',
|
| 1388 |
marker=dict(line=dict(color='#FFFFFF', width=2))
|
|
|
|
| 1389 |
|
| 1390 |
fig.update_layout(
|
| 1391 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
@@ -1504,7 +1506,7 @@ class EnhancedProfileManager:
|
|
| 1504 |
study_plan = academic_analyzer.generate_study_plan(
|
| 1505 |
transcript,
|
| 1506 |
learning_style_match.group(1)
|
| 1507 |
-
|
| 1508 |
|
| 1509 |
# Prepare data with encryption for sensitive fields
|
| 1510 |
data = {
|
|
@@ -1774,12 +1776,19 @@ class EnhancedTeachingAssistant:
|
|
| 1774 |
|
| 1775 |
analysis = academic_analyzer.analyze_gpa(profile['transcript'])
|
| 1776 |
response = [
|
| 1777 |
-
f"
|
| 1778 |
-
analysis['
|
| 1779 |
-
analysis['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1780 |
]
|
| 1781 |
|
| 1782 |
-
if analysis
|
| 1783 |
response.append("\n**Improvement Tips:**")
|
| 1784 |
response.extend([f"- {tip}" for tip in analysis['improvement_tips']])
|
| 1785 |
|
|
@@ -3049,5 +3058,4 @@ app = create_enhanced_interface()
|
|
| 3049 |
|
| 3050 |
if __name__ == "__main__":
|
| 3051 |
app.launch(server_name="0.0.0.0", server_port=7860)
|
| 3052 |
-
|
| 3053 |
|
|
|
|
| 33 |
import calendar
|
| 34 |
from dateutil.relativedelta import relativedelta
|
| 35 |
import numpy as np
|
| 36 |
+
import matplotlib.pyplot as plt
|
| 37 |
|
| 38 |
# Enhanced Configuration
|
| 39 |
PROFILES_DIR = "student_profiles"
|
|
|
|
| 490 |
grade = course.get('grade_earned', '').upper()
|
| 491 |
if grade in grade_points:
|
| 492 |
weight = 1.0 if any(x in course.get('course_name', '').upper()
|
| 493 |
+
for x in ['AP', 'IB', 'DE', 'HONORS']) else 0.0
|
| 494 |
weighted_grades.append(grade_points[grade] + weight)
|
| 495 |
|
| 496 |
if weighted_grades:
|
|
|
|
| 895 |
{
|
| 896 |
'code': code,
|
| 897 |
'description': req.get('description', ''),
|
| 898 |
+
'remaining': max(0, float(req.get('required', 0)) - float(req.get('completed', 0))),
|
| 899 |
'status': req.get('status', '')
|
| 900 |
}
|
| 901 |
for code, req in parsed_data.get('requirements', {}).items()
|
|
|
|
| 1387 |
textposition='inside',
|
| 1388 |
textinfo='percent+label',
|
| 1389 |
marker=dict(line=dict(color='#FFFFFF', width=2))
|
| 1390 |
+
)
|
| 1391 |
|
| 1392 |
fig.update_layout(
|
| 1393 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
|
|
| 1506 |
study_plan = academic_analyzer.generate_study_plan(
|
| 1507 |
transcript,
|
| 1508 |
learning_style_match.group(1)
|
| 1509 |
+
)
|
| 1510 |
|
| 1511 |
# Prepare data with encryption for sensitive fields
|
| 1512 |
data = {
|
|
|
|
| 1776 |
|
| 1777 |
analysis = academic_analyzer.analyze_gpa(profile['transcript'])
|
| 1778 |
response = [
|
| 1779 |
+
f"## π GPA Analysis",
|
| 1780 |
+
f"**Rating:** {analysis['rating']}",
|
| 1781 |
+
f"{analysis['description']}",
|
| 1782 |
+
f"{analysis['comparison']}",
|
| 1783 |
+
"",
|
| 1784 |
+
f"## π Graduation Status",
|
| 1785 |
+
analysis['status'],
|
| 1786 |
+
f"**Completion:** {analysis['completion_percentage']:.1f}%",
|
| 1787 |
+
"",
|
| 1788 |
+
f"## π« College Recommendations"
|
| 1789 |
]
|
| 1790 |
|
| 1791 |
+
if analysis.get('improvement_tips'):
|
| 1792 |
response.append("\n**Improvement Tips:**")
|
| 1793 |
response.extend([f"- {tip}" for tip in analysis['improvement_tips']])
|
| 1794 |
|
|
|
|
| 3058 |
|
| 3059 |
if __name__ == "__main__":
|
| 3060 |
app.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 3061 |
|