Skip to content

Commit

Permalink
Merge pull request #96 from FLARE-forecast/main
Browse files Browse the repository at this point in the history
Pulling in updates from main to dev branch
  • Loading branch information
rqthomas authored Nov 22, 2024
2 parents 0eb7608 + 4760f5e commit c0b38da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:

name: R-CMD-check.yaml

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:

name: test-coverage.yaml

Expand Down
10 changes: 6 additions & 4 deletions R/create_flow_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ create_flow_files <- function(flow_forecast_dir = NULL,

lake_name_code <- site_id

round_level <- 10

# set locations of flow drivers (s3 or local)
if (!is.null(flow_forecast_dir) & !is.null(flow_historical_dir)) {
if (use_s3) {
Expand Down Expand Up @@ -173,7 +175,7 @@ create_flow_files <- function(flow_forecast_dir = NULL,
tidyr::pivot_wider(names_from = variable, values_from = prediction) |>
dplyr::rename(time = datetime) |>
dplyr::select(dplyr::all_of(variables)) |>
dplyr::mutate_if(where(is.numeric), list(~round(., 4)))
dplyr::mutate_if(where(is.numeric), list(~round(., round_level)))

# generate the historical period
hist_ens <- hist_df |>
Expand All @@ -184,7 +186,7 @@ create_flow_files <- function(flow_forecast_dir = NULL,
tidyr::pivot_wider(names_from = variable, values_from = prediction) |>
dplyr::rename(time = datetime) |>
dplyr::select(dplyr::all_of(variables)) |>
dplyr::mutate_if(where(is.numeric), list(~round(., 4)))
dplyr::mutate_if(where(is.numeric), list(~round(., round_level)))

# combine to single df
flow <- dplyr::bind_rows(hist_ens,
Expand Down Expand Up @@ -235,7 +237,7 @@ create_flow_files <- function(flow_forecast_dir = NULL,
tidyr::pivot_wider(names_from = variable, values_from = prediction) |>
dplyr::rename(time = datetime) |>
dplyr::select(dplyr::all_of(variables)) |>
dplyr::mutate_if(where(is.numeric), list(~round(., 4)))
dplyr::mutate_if(where(is.numeric), list(~round(., round_level)))


flow <- hist_ens |>
Expand Down Expand Up @@ -282,7 +284,7 @@ create_flow_files <- function(flow_forecast_dir = NULL,
tidyr::pivot_wider(names_from = variable, values_from = prediction) |>
dplyr::rename(time = datetime) |>
dplyr::select(dplyr::all_of(variables)) |>
dplyr::mutate_if(where(is.numeric), list(~round(., 4)))
dplyr::mutate_if(where(is.numeric), list(~round(., round_level)))


flow <- future_ens |>
Expand Down

0 comments on commit c0b38da

Please sign in to comment.