evolutia 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {evolutia-0.1.2 → evolutia-0.1.3}/PKG-INFO +1 -1
  2. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/exercise_analyzer.py +74 -54
  3. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia.egg-info/PKG-INFO +1 -1
  4. {evolutia-0.1.2 → evolutia-0.1.3}/setup.py +1 -1
  5. {evolutia-0.1.2 → evolutia-0.1.3}/LICENSE +0 -0
  6. {evolutia-0.1.2 → evolutia-0.1.3}/README.md +0 -0
  7. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/__init__.py +0 -0
  8. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/async_llm_providers.py +0 -0
  9. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/cache/__init__.py +0 -0
  10. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/cache/exercise_cache.py +0 -0
  11. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/cache/llm_cache.py +0 -0
  12. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/complexity_validator.py +0 -0
  13. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/config_manager.py +0 -0
  14. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/evolutia_engine.py +0 -0
  15. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/exam_generator.py +0 -0
  16. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/exceptions.py +0 -0
  17. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/imports.py +0 -0
  18. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/llm_providers.py +0 -0
  19. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/material_extractor.py +0 -0
  20. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/rag/__init__.py +0 -0
  21. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/rag/consistency_validator.py +0 -0
  22. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/rag/context_enricher.py +0 -0
  23. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/rag/enhanced_variation_generator.py +0 -0
  24. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/rag/rag_indexer.py +0 -0
  25. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/rag/rag_manager.py +0 -0
  26. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/rag/rag_retriever.py +0 -0
  27. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/retry_utils.py +0 -0
  28. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/utils/__init__.py +0 -0
  29. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/utils/json_parser.py +0 -0
  30. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/utils/markdown_parser.py +0 -0
  31. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/utils/math_extractor.py +0 -0
  32. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/validation/__init__.py +0 -0
  33. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/validation/args_validator.py +0 -0
  34. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/validation/config_validator.py +0 -0
  35. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia/variation_generator.py +0 -0
  36. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia.egg-info/SOURCES.txt +0 -0
  37. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia.egg-info/dependency_links.txt +0 -0
  38. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia.egg-info/entry_points.txt +0 -0
  39. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia.egg-info/requires.txt +0 -0
  40. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia.egg-info/top_level.txt +0 -0
  41. {evolutia-0.1.2 → evolutia-0.1.3}/evolutia_cli.py +0 -0
  42. {evolutia-0.1.2 → evolutia-0.1.3}/setup.cfg +0 -0
  43. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_args_validator.py +0 -0
  44. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_cache.py +0 -0
  45. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_complexity_validator.py +0 -0
  46. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_config_discovery.py +0 -0
  47. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_config_validator.py +0 -0
  48. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_exercise_analyzer.py +0 -0
  49. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_exercise_analyzer_cache.py +0 -0
  50. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_json_robustness.py +0 -0
  51. {evolutia-0.1.2 → evolutia-0.1.3}/tests/test_math_extractor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evolutia
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Sistema automatizado para generar preguntas de examen desafiantes basadas en materiales didácticos existentes
5
5
  Home-page: https://github.com/glacy/evolutIA
6
6
  Author: Gerardo Lacy-Mora
@@ -1,16 +1,16 @@
1
- """
2
- Analizador de complejidad de ejercicios.
3
- Identifica tipo, pasos, conceptos y variables de ejercicios.
4
- """
5
- import re
6
- import logging
7
- from typing import Dict, List, Set, Optional, TYPE_CHECKING
8
- from collections import Counter
9
-
10
- if TYPE_CHECKING:
11
- from evolutia.cache.exercise_cache import ExerciseAnalysisCache
12
-
13
- logger = logging.getLogger(__name__)
1
+ """
2
+ Analizador de complejidad de ejercicios.
3
+ Identifica tipo, pasos, conceptos y variables de ejercicios.
4
+ """
5
+ import re
6
+ import logging
7
+ from typing import Dict, List, Set, Optional, TYPE_CHECKING
8
+ from collections import Counter
9
+
10
+ if TYPE_CHECKING:
11
+ from evolutia.cache.exercise_cache import ExerciseAnalysisCache
12
+
13
+ logger = logging.getLogger(__name__)
14
14
 
15
15
  try:
16
16
  from utils.math_extractor import (
@@ -28,19 +28,39 @@ except ImportError:
28
28
  )
29
29
 
30
30
 
31
- class ExerciseAnalyzer:
32
- """Analiza la complejidad y estructura de ejercicios."""
33
-
34
- def __init__(self, cache: Optional['ExerciseAnalysisCache'] = None):
35
- """
36
- Inicializa el analizador.
37
-
38
- Args:
39
- cache: Instancia opcional de ExerciseAnalysisCache para cachear análisis
40
- """
41
- pass
42
-
43
- self.cache = cache
31
+ class ExerciseAnalyzer:
32
+ """Analiza la complejidad y estructura de ejercicios."""
33
+
34
+ TYPE_PATTERNS = {
35
+ 'demostracion': re.compile(r'(?i)(demuestre|pruebe|verifique|muestre|justifique|demostraci[oó]n)'),
36
+ 'calculo': re.compile(r'(?i)(calcule|halle|encuentre|resuelva|eval[uú]e|calcular|obtenga|determinar)'),
37
+ 'aplicacion': re.compile(r'(?i)(aplicaci[oó]n|problema|vida real|modelo|f[íi]sic[ao]|ingenier[íi]a|econom[íi]a|contexto)')
38
+ }
39
+
40
+ STEP_KEYWORDS_PATTERN = re.compile(
41
+ r'(?i)(primero|luego|despu[ée]s|finalmente|entonces|por lo tanto|conclusi[oó]n|paso|seguidamente)',
42
+ re.MULTILINE
43
+ )
44
+
45
+ CONCEPT_PATTERNS = {
46
+ 'integrals': [r'(?i)integral', r'\\int', r'\\iint', r'\\iiint', r'\\oint'],
47
+ 'derivatives': [r'(?i)derivada', r'\\frac{d}{d', r'\\[dp]artial', r'\''],
48
+ 'limits': [r'(?i)l[íi]mite', r'\\lim'],
49
+ 'series': [r'(?i)serie', r'(?i)sucesi[oó]n', r'\\sum', r'convergencia'],
50
+ 'vectors': [r'(?i)vector', r'\\vec', r'\\mathbf', r'producto punto', r'producto cruz'],
51
+ 'matrices': [r'(?i)matriz', r'(?i)determinante', r'\\begin{pmatrix}', r'\\begin{bmatrix}', r'autovalor'],
52
+ 'coordinate_systems': [r'(?i)coordenadas', r'(?i)polares', r'(?i)esf[ée]ricas', r'(?i)cil[íi]ndricas', r'jacobian[oa]'],
53
+ 'vector_operations': [r'(?i)gradiente', r'(?i)divergencia', r'(?i)rotacional', r'\\nabla', r'teorema de stokes', r'teorema de green', r'teorema de la divergencia']
54
+ }
55
+
56
+ def __init__(self, cache: Optional['ExerciseAnalysisCache'] = None):
57
+ """
58
+ Inicializa el analizador.
59
+
60
+ Args:
61
+ cache: Instancia opcional de ExerciseAnalysisCache para cachear análisis
62
+ """
63
+ self.cache = cache
44
64
 
45
65
  def identify_exercise_type(self, content: str) -> str:
46
66
  """
@@ -135,34 +155,34 @@ class ExerciseAnalyzer:
135
155
 
136
156
  return concepts
137
157
 
138
- def analyze(self, exercise: Dict[str, Optional[str]]) -> Dict[str, Optional[str | int | float | List[str]]]:
139
- """
140
- Analiza un ejercicio completo y retorna metadatos de complejidad.
141
-
142
- Args:
143
- exercise: Diccionario con información del ejercicio
144
- - 'content': Contenido del ejercicio
145
- - 'solution': Contenido de la solución (opcional)
146
-
147
- Returns:
148
- Diccionario con análisis de complejidad
149
- """
150
- content = exercise.get('content', '')
151
- solution = exercise.get('solution', '')
152
-
153
- # Intentar caché primero
154
- if self.cache:
155
- cached_analysis = self.cache.get(exercise)
156
- if cached_analysis:
157
- logger.info(f"[ExerciseAnalyzer] Análisis obtenido del caché para exercise={exercise.get('label', 'unknown')}")
158
- return cached_analysis['analysis']
159
-
160
- # Análisis normal (cache miss)
161
- if not content:
162
- return {}
163
-
164
- # Extraer expresiones matemáticas
165
- math_expressions = extract_math_expressions(content)
158
+ def analyze(self, exercise: Dict[str, Optional[str]]) -> Dict[str, Optional[str | int | float | List[str]]]:
159
+ """
160
+ Analiza un ejercicio completo y retorna metadatos de complejidad.
161
+
162
+ Args:
163
+ exercise: Diccionario con información del ejercicio
164
+ - 'content': Contenido del ejercicio
165
+ - 'solution': Contenido de la solución (opcional)
166
+
167
+ Returns:
168
+ Diccionario con análisis de complejidad
169
+ """
170
+ content = exercise.get('content', '')
171
+ solution = exercise.get('solution', '')
172
+
173
+ # Intentar caché primero
174
+ if self.cache:
175
+ cached_analysis = self.cache.get(exercise)
176
+ if cached_analysis:
177
+ logger.info(f"[ExerciseAnalyzer] Análisis obtenido del caché para exercise={exercise.get('label', 'unknown')}")
178
+ return cached_analysis['analysis']
179
+
180
+ # Análisis normal (cache miss)
181
+ if not content:
182
+ return {}
183
+
184
+ # Extraer expresiones matemáticas
185
+ math_expressions = extract_math_expressions(content)
166
186
  if solution:
167
187
  math_expressions.extend(extract_math_expressions(solution))
168
188
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evolutia
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Sistema automatizado para generar preguntas de examen desafiantes basadas en materiales didácticos existentes
5
5
  Home-page: https://github.com/glacy/evolutIA
6
6
  Author: Gerardo Lacy-Mora
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
6
6
 
7
7
  setup(
8
8
  name="evolutia",
9
- version="0.1.2",
9
+ version="0.1.3",
10
10
  author="Gerardo Lacy-Mora",
11
11
  author_email="gerardolacymora@gmail.com",
12
12
  description="Sistema automatizado para generar preguntas de examen desafiantes basadas en materiales didácticos existentes",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes