Skip to content

Commit 1c36108

Browse files
fix: remove dead DomainCategory code and fix Codecov config
Remove DomainCategory expansion from _resolve_physics_domain that referenced a deleted schema file (domains.yaml migrated to imas-standard-names). Substring matching provides equivalent results. Fix Codecov action 'file' → 'files' parameter name (v6 API change).
1 parent 5b48611 commit 1c36108

3 files changed

Lines changed: 5 additions & 30 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
uses: codecov/codecov-action@v6
8686
if: ${{ !cancelled() }}
8787
with:
88-
file: ./coverage.xml
88+
files: ./coverage.xml
8989
flags: unittests
9090
name: codecov-umbrella
9191
fail_ci_if_error: false

imas_codex/tools/graph_search.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,8 +2614,7 @@ def _resolve_physics_domain(
26142614
Resolution order:
26152615
1. Exact match on PhysicsDomain enum value
26162616
2. IDS name → its physics_domain from the graph
2617-
3. DomainCategory expansion (all domains in that category)
2618-
4. Substring match on domain names
2617+
3. Substring match on domain names
26192618
26202619
Returns:
26212620
(resolved_domains, resolution_method) — list of canonical domain
@@ -2640,31 +2639,7 @@ def _resolve_physics_domain(
26402639
if domains:
26412640
return sorted(set(domains)), f"ids_name:{query}"
26422641

2643-
# 3. DomainCategory expansion
2644-
try:
2645-
from pathlib import Path
2646-
2647-
from linkml_runtime.utils.schemaview import SchemaView
2648-
2649-
schema_path = Path(__file__).parent.parent / "definitions/physics/domains.yaml"
2650-
if schema_path.exists():
2651-
sv = SchemaView(str(schema_path))
2652-
cat_enum = sv.get_enum("DomainCategory")
2653-
if cat_enum and query in cat_enum.permissible_values:
2654-
pd_enum = sv.get_enum("PhysicsDomain")
2655-
if pd_enum:
2656-
domains = []
2657-
for pv_name, pv in pd_enum.permissible_values.items():
2658-
ann = pv.annotations.get("category") if pv.annotations else None
2659-
cat = ann.value if ann else ""
2660-
if cat == query:
2661-
domains.append(pv_name)
2662-
if domains:
2663-
return sorted(domains), f"category:{query}"
2664-
except Exception:
2665-
pass
2666-
2667-
# 4. Substring match on domain names
2642+
# 3. Substring match on domain names
26682643
matches = [d for d in sorted(valid_domains) if query in d]
26692644
if matches:
26702645
return matches, f"substring:{query}"

tests/graph_mcp/test_graph_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,11 @@ def test_no_match(self, graph_client):
677677
assert domains == []
678678
assert method == "no_match"
679679

680-
def test_category_expansion(self, graph_client):
680+
def test_substring_expansion(self, graph_client):
681681
from imas_codex.tools.graph_search import _resolve_physics_domain
682682

683683
domains, method = _resolve_physics_domain(graph_client, "diagnostics")
684-
assert method == "category:diagnostics"
684+
assert method == "substring:diagnostics"
685685
assert "magnetic_field_diagnostics" in domains
686686
assert "radiation_measurement_diagnostics" in domains
687687

0 commit comments

Comments
 (0)