diff --git a/.github/workflows/call-update-data-r.yml b/.github/workflows/call-update-data-r.yml index 62d8cf0..6f9ed7d 100644 --- a/.github/workflows/call-update-data-r.yml +++ b/.github/workflows/call-update-data-r.yml @@ -6,11 +6,12 @@ on: push: paths: - 'data-raw/**' + workflow_dispatch: jobs: call-workflow: - uses: NOAA-FIMS/ecosystemom/.github/workflows/update-data-r.yml + uses: NOAA-FIMS/ecosystemom/.github/workflows/update-data-r.yml@main secrets: PAT: ${{ secrets.PAT }} with: diff --git a/.github/workflows/update-data-r.yml b/.github/workflows/update-data-r.yml index 3c8c582..f0eaca8 100644 --- a/.github/workflows/update-data-r.yml +++ b/.github/workflows/update-data-r.yml @@ -59,12 +59,12 @@ jobs: - name: Run R code to update files in /data run: | - devtools::install() + devtools::install(quick = TRUE) r_scripts <- list.files("data-raw", pattern = "\\.R$", full.names = TRUE) if (length(r_scripts) > 0) { for (script in r_scripts) { - # Capture exit code so failures actually stop the GHA runner - status <- system2(paste("Rscript ", shQuote(script))) + message("Executing script: ", script) + status <- system2("Rscript", args = script) if (status != 0) stop(paste("Script failed:", script)) } } else { diff --git a/data-raw/ewe_ecosim_base_nwatlantic.R b/data-raw/ewe_ecosim_base_nwatlantic.R index 1d837fa..8bfce0f 100644 --- a/data-raw/ewe_ecosim_base_nwatlantic.R +++ b/data-raw/ewe_ecosim_base_nwatlantic.R @@ -15,7 +15,7 @@ raw_file_path <- fs::path( # Extract the functional groups from the model's basic estimates file. # The `get_functional_groups` function reads # the specified CSV file to get a list of all functional groups in the model. -functional_groups <- get_functional_groups( +functional_groups <- ecosystemom::get_functional_groups( file_path = fs::path( raw_file_path, "basic_estimates.csv" ) @@ -25,7 +25,7 @@ functional_groups <- get_functional_groups( # The `load_model` function reads all the necessary # files from the specified directory to construct the full model object. # It requires the list of functional groups that was extracted in the previous step. -ewe_ecosim_base_nwatlantic <- load_model( +ewe_ecosim_base_nwatlantic <- ecosystemom::load_model( directory = raw_file_path, type = "ewe_ecosim", functional_groups = functional_groups diff --git a/data-raw/ewe_ecosim_with_environmental_data_nwatlantic.R b/data-raw/ewe_ecosim_with_environmental_data_nwatlantic.R index 1b54d49..98cf37e 100644 --- a/data-raw/ewe_ecosim_with_environmental_data_nwatlantic.R +++ b/data-raw/ewe_ecosim_with_environmental_data_nwatlantic.R @@ -15,7 +15,7 @@ raw_file_path <- fs::path( # Extract the functional groups from the model's basic estimates file. # The `get_functional_groups` function reads # the specified CSV file to get a list of all functional groups in the model. -functional_groups <- get_functional_groups( +functional_groups <- ecosystemom::get_functional_groups( file_path = fs::path( raw_file_path, "basic_estimates.csv" ) @@ -25,7 +25,7 @@ functional_groups <- get_functional_groups( # The `load_model` function reads all the necessary # files from the specified directory to construct the full model object. # It requires the list of functional groups that was extracted in the previous step. -ewe_ecosim_with_environmental_data_nwatlantic <- load_model( +ewe_ecosim_with_environmental_data_nwatlantic <- ecosystemom::load_model( directory = raw_file_path, type = "ewe_ecosim", functional_groups = functional_groups diff --git a/data/ewe_ecosim_base_nwatlantic.rda b/data/ewe_ecosim_base_nwatlantic.rda index 6b11d70..54ae437 100644 Binary files a/data/ewe_ecosim_base_nwatlantic.rda and b/data/ewe_ecosim_base_nwatlantic.rda differ diff --git a/data/ewe_ecosim_with_environmental_data_nwatlantic.rda b/data/ewe_ecosim_with_environmental_data_nwatlantic.rda index 333c904..00e7d10 100644 Binary files a/data/ewe_ecosim_with_environmental_data_nwatlantic.rda and b/data/ewe_ecosim_with_environmental_data_nwatlantic.rda differ