_work_to_minimal() in openalex_resolve.py drops OA fields¶
Root cause of biblio_pdf_fetch_oa failing to find any OA URLs: the _work_to_minimal() function that extracts fields from OpenAlex API responses did not include open_access, best_oa_location, or primary_location. These fields were in the API select clause and returned by OpenAlex, but stripped before writing to resolved.jsonl.
Fix applied¶
Added three fields to _work_to_minimal():
"open_access": work.get("open_access") ...
"best_oa_location": work.get("best_oa_location") ...
"primary_location": work.get("primary_location") ...
File: packages/biblio/src/biblio/openalex/openalex_resolve.py line ~91
After fix, re-resolve correctly shows oa_status=gold and pdf_url=... for open-access papers. PDF fetch then downloads them successfully.
Source context: pixecog¶
PixEcog (pixecog): Neuropixels and ECoG dataset and analysis
Recent commits:
8dc0d9d Pipeline docs: gitignore docs/pipelines/, relocate hand-authored files
96cd1ec Refactor sharpwaveripple/contracts: extract generic helpers to utils/io, remove pipelines __init__.py
36f9326 Add result note directory and sample note
README:
type: readme
Quick Start for Collaborators¶
Follow this checklist to get started with Pixecog documentation and workflows.
🐀 Pixecog Project — Compact Overview¶
Core principles
- One immutable BIDS raw dataset (
raw/) as the canonical baseline - Each analysis pipeline ha
Related Notes¶
- issue-arash-20260409-231641-242830.md — Direct symptom: biblio_pdf_fetch_oa downloading 0 files is caused by the missing OA fields stripped by _work_to_minimal()
- issue-arash-20260409-231546-838942.md — Same resolution pipeline: missing biblio_openalex_resolve MCP tool is part of the same OpenAlex resolution workflow
- issue-arash-20260409-231618-516346.md — Downstream effect: biblio_enrich returning 0 when resolution is missing is a consequence of broken/incomplete resolved.jsonl output