forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before attempting to read it #809
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?
Background
analyze_single_patentconstructs the pathpatents/{patent_id}.pdfand reads from disk, but does not download the PDF first. Calling this method on a patent that has not been previously fetched will fail with aFileNotFoundError.What to do
patents/{patent_id}.pdfexists before attempting to read itanalyze_single_patentso callers do not need to know the prerequisiteanalyze_single_patenton a patent ID that has not been pre-downloaded and confirms it either downloads the file or raises a clear errorAcceptance criteria
analyze_single_patenton a new patent ID does not raiseFileNotFoundErrorPatentNotDownloadedError(or similar) is raised with a helpful messageReferences
Roadmap item: P2 Backend --
analyze_single_patentassumes local file path