style: ruff format normalization to line-length=100
Committed code predated the line-length=100 ruff config; this brings the five drifted files into compliance. No logic change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -96,10 +96,7 @@ def fetch_references(paper_id: str) -> list[Citation]:
|
||||
context: str | None = contexts[0] if contexts else None
|
||||
|
||||
cited_id: str = (
|
||||
external_ids.get("DOI")
|
||||
or external_ids.get("ArXiv")
|
||||
or cited_paper.get("paperId")
|
||||
or ""
|
||||
external_ids.get("DOI") or external_ids.get("ArXiv") or cited_paper.get("paperId") or ""
|
||||
)
|
||||
if cited_id:
|
||||
citations.append(Citation(citing_id=paper_id, cited_id=cited_id, context=context))
|
||||
|
||||
@@ -365,11 +365,7 @@ def find_connections(
|
||||
continue
|
||||
seen_pairs.add(pair) # type: ignore[arg-type]
|
||||
|
||||
pair_chunks = [
|
||||
c
|
||||
for c in chunks
|
||||
if c.get("bibkey") in {bibkey, other}
|
||||
]
|
||||
pair_chunks = [c for c in chunks if c.get("bibkey") in {bibkey, other}]
|
||||
prompt = _CONNECTION_PROMPT.format(chunks_block=_format_chunks(pair_chunks))
|
||||
raw = _safe_llm_generate(llm, prompt, settings.synthesis_llm_model)
|
||||
if not raw.strip():
|
||||
|
||||
@@ -240,9 +240,36 @@ def _parse_claims(markdown: str) -> list[Claim]:
|
||||
|
||||
_STOPWORDS: frozenset[str] = frozenset(
|
||||
{
|
||||
"the", "a", "an", "in", "on", "of", "to", "is", "are", "was", "were",
|
||||
"and", "or", "but", "for", "with", "this", "that", "it", "we", "they",
|
||||
"be", "as", "at", "by", "from", "has", "have", "not", "which",
|
||||
"the",
|
||||
"a",
|
||||
"an",
|
||||
"in",
|
||||
"on",
|
||||
"of",
|
||||
"to",
|
||||
"is",
|
||||
"are",
|
||||
"was",
|
||||
"were",
|
||||
"and",
|
||||
"or",
|
||||
"but",
|
||||
"for",
|
||||
"with",
|
||||
"this",
|
||||
"that",
|
||||
"it",
|
||||
"we",
|
||||
"they",
|
||||
"be",
|
||||
"as",
|
||||
"at",
|
||||
"by",
|
||||
"from",
|
||||
"has",
|
||||
"have",
|
||||
"not",
|
||||
"which",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -360,12 +387,8 @@ def _detect_conflicts(
|
||||
for bk2 in bibkeys[i + 1 :]:
|
||||
# Check if any chunk from bk1 contains a conflict keyword
|
||||
# and any chunk from bk2 also does — heuristic signal only
|
||||
bk1_has_conflict = any(
|
||||
_CONFLICT_KEYWORDS.search(c) for c in by_bib[bk1]
|
||||
)
|
||||
bk2_has_conflict = any(
|
||||
_CONFLICT_KEYWORDS.search(c) for c in by_bib[bk2]
|
||||
)
|
||||
bk1_has_conflict = any(_CONFLICT_KEYWORDS.search(c) for c in by_bib[bk1])
|
||||
bk2_has_conflict = any(_CONFLICT_KEYWORDS.search(c) for c in by_bib[bk2])
|
||||
if bk1_has_conflict and bk2_has_conflict:
|
||||
conflicts.append((slug, bk1, bk2))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user