Skip to content

Commit

Permalink
Merge 0d3bfd6 into 7b23a98
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag authored Jul 3, 2021
2 parents 7b23a98 + 0d3bfd6 commit c2b19a9
Show file tree
Hide file tree
Showing 3 changed files with 348 additions and 329 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ importFrom(rvest,html_node)
importFrom(rvest,html_nodes)
importFrom(rvest,html_text)
importFrom(stats,aggregate)
importFrom(stringi,stri_detect_fixed)
importFrom(stringi,stri_enc_toascii)
importFrom(stringi,stri_match)
importFrom(stringi,stri_match_all)
importFrom(stringi,stri_trans_general)
importFrom(tibble,as_tibble)
importFrom(tools,file_ext)
Expand Down
9 changes: 8 additions & 1 deletion R/create_OSD.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,15 @@ osd_to_json <- function(logfile = file.path(output_dir, "OSD/OSD.log"),
res <- sapply(1:length(all_osds), function(i) {
filepath <- all_osds[[i]]
logmsg(logfile, " - %s", filepath)

x <- validateOSD(logfile, filepath)

parsed.OSD <- .doParseOSD(x)

# SPC-style components from parseOSD returned as nested data.frames in JSON
x$SITE <- I(list(parsed.OSD$`site-data`))
x$HORIZONS <- I(list(parsed.OSD$`hz-data`))

if (is.logical(x))
if (!x) return(FALSE)

Expand All @@ -382,7 +389,7 @@ osd_to_json <- function(logfile = file.path(output_dir, "OSD/OSD.log"),

fn <- gsub("\\.txt", "\\.json", basename(all_osds[[i]]))

write(jsonlite::toJSON(x, pretty = TRUE, auto_unbox = TRUE),
write(jsonlite::toJSON(x, pretty = TRUE, auto_unbox = FALSE),
file = file.path(fld, fn))
return(TRUE)
})
Expand Down
Loading

0 comments on commit c2b19a9

Please sign in to comment.