Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pdftotext with {pdftools} #69

Open
brownag opened this issue Oct 25, 2023 · 0 comments
Open

Replace pdftotext with {pdftools} #69

brownag opened this issue Oct 25, 2023 · 0 comments

Comments

@brownag
Copy link
Member

brownag commented Oct 25, 2023

download_GDS() and download_KST() use a system call to pdftotext that appears to be generating warnings. Safe to assume that these parts are not being routinely updated (granted the PDFs are unchanged and are sourced from a standard location. Not sure what is causing "error in running command". Could potentially switch to {pdftools} for parsing--but will need to ensure that the same settings (-raw -nodiag) can be used and approximately the same TXT output generated

══ Warnings ════════════════════════════════════════════════════════════════════
── Warning ('test-refresh.R:17:3'): refresh (from source; pdftools required) ───
error in running command
Backtrace:
     ▆
  1. └─SoilKnowledgeBase::refresh(keep_pdf = TRUE) at test-refresh.R:17:2
  2.   ├─base::try(lapply(exportfn_sub, function(x) get(x)(...)))
  3.   │ └─base::tryCatch(...)
  4.   │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  5.   │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  6.   │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
  7.   └─base::lapply(exportfn_sub, function(x) get(x)(...))
  8.     └─SoilKnowledgeBase (local) FUN(X[[i]], ...)
  9.       └─get(x)(...)
 10.         └─SoilKnowledgeBase:::parse_GDS(...)
 11.           └─SoilKnowledgeBase:::download_GDS(...)
 12.             └─base::system(sprintf("pdftotext -raw -nodiag GDS.pdf"))
── Warning ('test-refresh.R:17:3'): refresh (from source; pdftools required) ───
'./inst/extdata/GDS' already exists
Backtrace:
     ▆
  1. └─SoilKnowledgeBase::refresh(keep_pdf = TRUE) at test-refresh.R:17:2
  2.   ├─base::try(lapply(exportfn_sub, function(x) get(x)(...)))
  3.   │ └─base::tryCatch(...)
  4.   │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  5.   │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  6.   │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
  7.   └─base::lapply(exportfn_sub, function(x) get(x)(...))
  8.     └─SoilKnowledgeBase (local) FUN(X[[i]], ...)
  9.       └─get(x)(...)
 10.         └─SoilKnowledgeBase:::parse_GDS(...)
 11.           └─SoilKnowledgeBase:::download_GDS(...)
 12.             └─base::dir.create(file.path(outpath, "GDS"), recursive = TRUE)
── Warning ('test-refresh.R:17:3'): refresh (from source; pdftools required) ───
error in running command
Backtrace:
     ▆
  1. └─SoilKnowledgeBase::refresh(keep_pdf = TRUE) at test-refresh.R:17:2
  2.   ├─base::try(lapply(exportfn_sub, function(x) get(x)(...)))
  3.   │ └─base::tryCatch(...)
  4.   │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  5.   │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  6.   │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
  7.   └─base::lapply(exportfn_sub, function(x) get(x)(...))
  8.     └─SoilKnowledgeBase (local) FUN(X[[i]], ...)
  9.       └─get(x)(...)
 10.         ├─base::try(...)
 11.         │ └─base::tryCatch(...)
 12.         │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 13.         │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 14.         │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 15.         └─SoilKnowledgeBase:::download_KST(...)
 16.           └─base::system(sprintf("pdftotext -raw -nodiag %s", fn))
── Warning ('test-refresh.R:17:3'): refresh (from source; pdftools required) ───
error in running command
Backtrace:
     ▆
  1. └─SoilKnowledgeBase::refresh(keep_pdf = TRUE) at test-refresh.R:17:2
  2.   ├─base::try(lapply(exportfn_sub, function(x) get(x)(...)))
  3.   │ └─base::tryCatch(...)
  4.   │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  5.   │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  6.   │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
  7.   └─base::lapply(exportfn_sub, function(x) get(x)(...))
  8.     └─SoilKnowledgeBase (local) FUN(X[[i]], ...)
  9.       └─get(x)(...)
 10.         ├─base::try(...)
 11.         │ └─base::tryCatch(...)
 12.         │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 13.         │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 14.         │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 15.         └─SoilKnowledgeBase:::download_KST(...)
 16.           └─base::system(sprintf("pdftotext -raw -nodiag %s", fn))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant