Skip to content

Commit

Permalink
catching reference_datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
rqthomas committed Nov 2, 2023
1 parent 1fe0911 commit 10add40
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions submission_processing/process_submissions.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ if(length(submissions) > 0){
curr_submission <- basename(submissions[i])
theme <- stringr::str_split(curr_submission, "-")[[1]][1]
model_id <- stringr::str_split(tools::file_path_sans_ext(tools::file_path_sans_ext(curr_submission)), "-")[[1]][5]
reference_datetime <- lubridate::as_datetime(paste0(stringr::str_split(curr_submission, "-")[[1]][2:4], collapse = "-"))
submission_dir <- dirname(submissions[i])
print(curr_submission)

Expand Down Expand Up @@ -104,6 +105,10 @@ if(length(submissions) > 0){
fc <- fc |> mutate(model_id = model_id)
}

if(!("reference_datetime" %in% colnames(fc))){
fc <- fc |> mutate(reference_datetime = reference_datetime)
}

fc <- fc |>
dplyr::mutate(pub_datetime = lubridate::as_datetime(pub_datetime),
datetime = lubridate::as_datetime(datetime),
Expand Down

0 comments on commit 10add40

Please sign in to comment.