Skip to content

Commit

Permalink
Merge pull request #91 from kjsato/main-pr4
Browse files Browse the repository at this point in the history
Main pr4
  • Loading branch information
kjsato authored Jul 31, 2024
2 parents e6f7a4d + b89844f commit 12c7d67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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

0 comments on commit 12c7d67

Please sign in to comment.