Enhance Progression Path Comparison and Slot Evaluation Features
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m12s
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m12s
- Introduced new fields in `ProgressionPathSuggestRequest` for baseline evaluation and incremental scoring, improving the assessment of proposed paths. - Implemented `_apply_slot_diff_to_steps` and `_score_incremental_slot_diffs` functions to manage slot differences and evaluate their impact on quality scores. - Updated `ProgressionGraphEditor` to streamline the match comparison flow, integrating new evaluation parameters and improving user notifications. - Enhanced `ProgressionOptimizeCompareModal` to better display proposed path suggestions, including pro/con evaluations and quality delta metrics. - Refactored utility functions for clearer handling of slot differences and improved overall data management in the progression graph editor.
This commit is contained in:
1 parent
19bbcdaf50
commit
85fccdd093
5 files changed
+1098
-282
No files matched your search
@@ -0,0 +1,39 @@
|
||||
"""Tests inkrementelles Slot-Diff-Scoring (nur messbare Verbesserungen)."""
|
||||
from planning_exercise_path_builder import (
|
||||
_apply_slot_diff_to_steps,
|
||||
_slot_diff_improves_path,
|
||||
)
|
||||
|
||||
|
||||
def test_slot_diff_improves_path_fill_neutral_or_positive():
|
||||
fill = {"baseline_exercise_id": None, "proposed_exercise_id": 101}
|
||||
assert _slot_diff_improves_path(fill, 0.0) is True
|
||||
assert _slot_diff_improves_path(fill, 0.04) is True
|
||||
assert _slot_diff_improves_path(fill, -0.01) is False
|
||||
|
||||
|
||||
def test_slot_diff_improves_path_off_topic_allows_neutral_replace():
|
||||
repl = {"baseline_exercise_id": 10, "proposed_exercise_id": 99}
|
||||
assert _slot_diff_improves_path(repl, 0.0, off_topic=True) is True
|
||||
assert _slot_diff_improves_path(repl, -0.02, off_topic=True) is False
|
||||
|
||||
|
||||
def test_apply_slot_diff_merges_proposed_step():
|
||||
baseline = [
|
||||
{"roadmap_major_step_index": 0, "exercise_id": 1, "title": "A"},
|
||||
{"roadmap_major_step_index": 1, "exercise_id": None, "title": "Leer"},
|
||||
]
|
||||
proposed = [
|
||||
{"roadmap_major_step_index": 0, "exercise_id": 1, "title": "A"},
|
||||
{"roadmap_major_step_index": 1, "exercise_id": 55, "title": "Neu", "slot_status": "matched"},
|
||||
]
|
||||
diff = {
|
||||
"roadmap_major_step_index": 1,
|
||||
"baseline_exercise_id": None,
|
||||
"proposed_exercise_id": 55,
|
||||
"proposed_title": "Neu",
|
||||
}
|
||||
merged = _apply_slot_diff_to_steps(baseline, diff, proposed)
|
||||
assert merged[0]["exercise_id"] == 1
|
||||
assert merged[1]["exercise_id"] == 55
|
||||
assert merged[1]["title"] == "Neu"
|
||||
Reference in new issue
Block a user