fix: rename eval.py to eval_checks.py to avoid shadowing stdlib eval
Some checks failed
CI / lint-and-test (push) Has been cancelled
Some checks failed
CI / lint-and-test (push) Has been cancelled
Also fixes _is_entity path check to use Path.parts instead of string containment, preventing false positives on paths like "domains/entities-overview/". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ff68ebc561
commit
2253f48993
4 changed files with 4 additions and 4 deletions
|
|
@ -168,8 +168,8 @@ def _is_entity(path: Path) -> bool:
|
||||||
fm = _parse_frontmatter(path)
|
fm = _parse_frontmatter(path)
|
||||||
if fm and fm.get("type") == "entity":
|
if fm and fm.get("type") == "entity":
|
||||||
return True
|
return True
|
||||||
# Also check path — entities live under entities/ directory
|
# Check path parts — avoids false positives on paths like "domains/entities-overview/"
|
||||||
return "entities/" in str(path)
|
return "entities" in Path(path).parts
|
||||||
|
|
||||||
|
|
||||||
def _same_source(path_a: Path, path_b: Path) -> bool:
|
def _same_source(path_a: Path, path_b: Path) -> bool:
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,7 @@ def get_db_stats() -> dict:
|
||||||
return {"merged_claims": "?", "contributors": "?"}
|
return {"merged_claims": "?", "contributors": "?"}
|
||||||
|
|
||||||
|
|
||||||
from eval import (
|
from eval_checks import (
|
||||||
_LLMResponse, estimate_cost, check_url_fabrication, apply_confidence_floor,
|
_LLMResponse, estimate_cost, check_url_fabrication, apply_confidence_floor,
|
||||||
CONFIDENCE_FLOOR, COST_ALERT_THRESHOLD,
|
CONFIDENCE_FLOOR, COST_ALERT_THRESHOLD,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import pytest
|
||||||
# Add telegram/ to path for imports
|
# Add telegram/ to path for imports
|
||||||
sys.path.insert(0, str(Path(__file__).parent.parent / "telegram"))
|
sys.path.insert(0, str(Path(__file__).parent.parent / "telegram"))
|
||||||
|
|
||||||
from eval import (
|
from eval_checks import (
|
||||||
_LLMResponse,
|
_LLMResponse,
|
||||||
estimate_cost,
|
estimate_cost,
|
||||||
check_url_fabrication,
|
check_url_fabrication,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue