Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/call-update-data-r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-data-r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions data-raw/ewe_ecosim_base_nwatlantic.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions data-raw/ewe_ecosim_with_environmental_data_nwatlantic.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
Expand Down
Binary file modified data/ewe_ecosim_base_nwatlantic.rda
Binary file not shown.
Binary file modified data/ewe_ecosim_with_environmental_data_nwatlantic.rda
Binary file not shown.
Loading