MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _window_papers

Function _window_papers

skills/profile-updater/scripts/update_profile.py:656–669  ·  view source on GitHub ↗
(
    papers: List[Dict[str, Any]],
    *,
    max_size: int,
    max_days: int,
    now: datetime,
)

Source from the content-addressed store, hash-verified

654
655
656def _window_papers(
657 papers: List[Dict[str, Any]],
658 *,
659 max_size: int,
660 max_days: int,
661 now: datetime,
662) -> List[Dict[str, Any]]:
663 cutoff = now - timedelta(days=max_days)
664 recent = [
665 paper for paper in papers
666 if _paper_timestamp(paper, now) >= cutoff
667 ]
668 recent.sort(key=lambda paper: _paper_timestamp(paper, now))
669 return recent[-max_size:]
670
671
672def _collect_embeddings(papers: List[Dict[str, Any]], target_dim: int) -> List[List[float]]:

Callers 1

Calls 1

_paper_timestampFunction · 0.85

Tested by

no test coverage detected