forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before reading from disk #1430
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
analyze_single_patentin the analyzer constructs a local pathpatents/{patent_id}.pdfand reads it, but never ensures the file has been downloaded first. Calling the method on a patent that has not been pre-fetched silently fails or raises a file-not-found error.What to do
Acceptance criteria
analyze_single_patenton a patent with no cached PDF either downloads it automatically or raises a clearFileNotFoundErrorwith an actionable message.References
Roadmap: P2 Backend -- analyze_single_patent PDF download.
Already implemented.
SPARC/analyzer.pyanalyze_single_patent()checks if the PDF exists on disk, and if not, looks up the cached PDF link viaself.db.get_cached_patent(patent_id)and downloads it usingSERP.save_patents()before proceeding with analysis. A clearFileNotFoundErroris raised when no cached link is available.Closing as completed.