Enhance Progression Path Suggestion with Planning Catalog Context Integration
Deploy Development / deploy (push) Successful in 41s
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 34s
Test Suite / playwright-tests (push) Successful in 1m16s
Deploy Development / deploy (push) Successful in 41s
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 34s
Test Suite / playwright-tests (push) Successful in 1m16s
- Introduced `planning_catalog_context` to `ProgressionPathSuggestRequest` for improved handling of catalog-related data during path suggestions. - Implemented `_resolve_planning_catalog_context` to retrieve and validate the planning catalog context, enhancing the robustness of the suggestion process. - Updated `_build_path_target_profile` to incorporate catalog context, enriching target profiles with relevant planning data. - Enhanced frontend components in `ProgressionGraphEditor` to manage and display planning catalog context, including new selection options for focus areas, style directions, training types, and target groups. - Added utility functions for parsing and transforming planning catalog context data for API interactions. - Bumped version to 0.8.233 to reflect the new features and improvements.
This commit is contained in:
1 parent
a4e73c830f
commit
6ab2f20f08
8 files changed
+441
-8
No files matched your search
@@ -0,0 +1,47 @@
|
||||
"""Tests Katalog-Kontext für Progressionsgraph-Matching."""
|
||||
from planning_catalog_context import (
|
||||
ProgressionPlanningCatalogContext,
|
||||
PlanningCatalogContextItem,
|
||||
catalog_context_has_items,
|
||||
merge_catalog_context_into_target,
|
||||
)
|
||||
from planning_exercise_profiles import PlanningTargetProfile
|
||||
|
||||
|
||||
def test_catalog_context_has_items():
|
||||
assert not catalog_context_has_items(None)
|
||||
assert not catalog_context_has_items(ProgressionPlanningCatalogContext())
|
||||
assert catalog_context_has_items(
|
||||
ProgressionPlanningCatalogContext(
|
||||
focus_areas=[PlanningCatalogContextItem(id=3, is_primary=True)],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def test_merge_catalog_context_into_target_sets_focus():
|
||||
base = PlanningTargetProfile(sources=["query_only"])
|
||||
merged = merge_catalog_context_into_target(
|
||||
base,
|
||||
ProgressionPlanningCatalogContext(
|
||||
focus_areas=[PlanningCatalogContextItem(id=7, is_primary=True)],
|
||||
training_types=[PlanningCatalogContextItem(id=2, is_primary=True)],
|
||||
),
|
||||
)
|
||||
assert merged.focus_area_ids.get(7, 0) > 0.5
|
||||
assert merged.training_type_ids.get(2, 0) > 0.5
|
||||
assert "catalog_context" in merged.sources
|
||||
|
||||
|
||||
def test_normalize_planning_roadmap_with_catalog_context():
|
||||
from progression_graph_planning_artifact import normalize_planning_roadmap_payload
|
||||
|
||||
out = normalize_planning_roadmap_payload(
|
||||
{
|
||||
"goal_query": "Deeskalation Kinder",
|
||||
"planning_catalog_context": {
|
||||
"focus_areas": [{"id": 4, "is_primary": True}],
|
||||
"target_groups": [{"id": 9, "is_primary": True}],
|
||||
},
|
||||
}
|
||||
)
|
||||
assert out["planning_catalog_context"]["focus_areas"][0]["id"] == 4
|
||||
Reference in new issue
Block a user