Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main pr4 #91

Merged
merged 2 commits into from
Jul 31, 2024
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
7 changes: 4 additions & 3 deletions .github/workflows/after-validate-submission.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
- name: Check if RETRO files are present
id: check_files
run: |
echo 'retro='$(echo '${{ steps.changed-files.outputs.added_files }} ${{ steps.changed-files.outputs.modified_files }}' | grep 'model-output' | grep -c '.*-RETRO.*\.\(csv\|parquet\)') >> $GITHUB_ENV
echo 'conventional='$(echo '${{ steps.changed-files.outputs.added_files }} ${{ steps.changed-files.outputs.modified_files }}' | grep -c -v '.*-RETRO.*\.\(csv\|parquet\)') >> $GITHUB_ENV
echo 'retro='$(echo '${{ steps.changed-files.outputs.added_files }} ${{ steps.changed-files.outputs.modified_files }}' | tr ' ' '\n' | grep 'model-output' | grep '.*-RETRO.*\.\(csv\|parquet\)'| grep -v '\.github/') >> $GITHUB_ENV
echo 'conventional='$(echo '${{ steps.changed-files.outputs.added_files }} ${{ steps.changed-files.outputs.modified_files }}' | tr ' ' '\n' | grep -v '\.github/' | grep -c -v '.*-RETRO.*\.\(csv\|parquet\)') >> $GITHUB_ENV
- name: Run R script
run: |
cd ./scripts
Expand All @@ -90,7 +90,8 @@ jobs:
- name: Run retro_ensemble.R
run: |
cd ./scripts
for file in $(echo '${{ steps.changed-files.outputs.added_files }} ${{ steps.changed-files.outputs.modified_files }}' | grep 'model-output' | grep '.*-RETRO.*\.\(csv\|parquet\)'); do
for file in $(echo '${{ steps.changed-files.outputs.added_files }} ${{ steps.changed-files.outputs.modified_files }}' | tr ' ' '\n' | grep 'model-output' | grep '.*-RETRO.*\.\(csv\|parquet\)'| grep -v '\.github/'); do
echo "Processing file: $file"
Rscript retro_ensemble.R $file
done
if: ${{ env.retro != '0' }}
Expand Down
7 changes: 7 additions & 0 deletions scripts/retro_ensemble.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ projection_data_all <- file_paths %>%
})
head(projection_data_all)

# Check the format of 'origin_date' column
print(unique(projection_data_all$origin_date))

# Ensure 'origin_date' is in a standard date format
projection_data_all <- projection_data_all %>%
mutate(origin_date = as.Date(origin_date, format = "%Y-%m-%d"))

# Prepare data
projection_data_all <- dplyr::mutate(projection_data_all,
target_date = as.Date(origin_date) + (horizon * 7) - 1)
Expand Down
Loading