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

Change upload_forcing worker to persist previous day for missing runoff files via symlinks instead of failing #233

Merged
merged 5 commits into from
Feb 2, 2024

Conversation

douglatornell
Copy link
Member

re: issue #232

This commit reinstates the required 201702 runoff files in the nowcast
configuration YAML file. Those files, previously marked for removal in the
202111 version, are required for nowcast-agrif operation. It also replaces the
associated TODO comments with explanations that reflect this requirement.
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (a7cdbca) 77.61% compared to head (ba31610) 77.65%.
Report is 2 commits behind head on main.

❗ Current head ba31610 differs from pull request most recent head e5087ac. Consider uploading reports for the commit e5087ac to get more accurate results

Files Patch % Lines
nowcast/workers/upload_forcing.py 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
+ Coverage   77.61%   77.65%   +0.04%     
==========================================
  Files         133      133              
  Lines       18678    18705      +27     
  Branches     1899     1900       +1     
==========================================
+ Hits        14496    14526      +30     
+ Misses       4116     4113       -3     
  Partials       66       66              
Flag Coverage Δ
unittests 77.65% <93.33%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Add assertion that the 202108 runoff file template exists in the config and has
the expected format. This ensures this test case would catch any change in the
file template format.
Reformatted the test case for upload_live_ocean_files function in upload_forcing
module. A mock implementation of symlink_to function has been added and used
instead of patching it inline. This change provides a clearer, simplified method
to test the functionality.
The code now handles FileNotFoundError exceptions when trying to upload
a river runoff forcing file by creating a symbolic link to the previous day's
file. Relevant tests have also been updated and expanded to ensure that these
new changes work as expected and do not introduce any new issues.
@douglatornell douglatornell changed the title Change upload_forcing worker to persist missing runoff files via symlinks instead of failing Change upload_forcing worker to persist previous day for missing runoff files via symlinks instead of failing Jan 31, 2024
The update modifies the handling of missing river runoff files in the
upload_forcing worker. Instead of linking to the file from one day prior, the
system now refers to the file from two days before. Accompanying tests are
adjusted accordingly to ensure proper operation.

Also correct the indentation of the symlink code path.

re: bugs in ba31610
@douglatornell
Copy link
Member Author

Finally tested successfully in production on 2-Feb-2024.

@douglatornell douglatornell merged commit 2920ddb into main Feb 2, 2024
5 checks passed
@douglatornell douglatornell deleted the symlink-missing-runoff-files branch February 2, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Workers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change upload_forcing worker to persist previous day for missing runoff files via symlinks instead of failing
1 participant