You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR introduces a caching system for Web Soil Survey ZIP archives in the downloadSSURGO() workflow, along with new utility functions for cache management. For #473
For a first download (force = FALSE and no existing destination), curl_download() writes directly to destfile. If the transfer fails after creating a partial file, the error path does not remove it because tmp_destfile equals destfile; the next call then returns that corrupt ZIP at line 153 without retrying. Always download to a temporary file and rename it into place only after success, as is already done for forced replacements.
Multiple fiscal years are matched incorrectly
R/WSS_cache.R:219
fiscal_year is normalized element-wise, but == only works correctly for a single requested year; passing multiple years (for example list_WSS_cache(fiscal_year = c(2023, 2024))) recycles the shorter vector and can select the wrong rows. Use set membership for the normalized values so all requested fiscal years are honored.
Fallback cache selection does not support LIKE predicates
R/createSSURGO.R:166
The documented WHERE form areasymbol LIKE 'KS%' cannot use this fallback: .extract_wss_areasymbols() returns KS%, but .wss_cache_select() treats areasymbols as exact values, so cached KS### entries are never selected when the remote metadata query fails. Please make the fallback evaluate supported WHERE predicates against the cache inventory (at least SQL LIKE), or limit this path to exact area-symbol inputs and report that limitation.
Document NULL exdir behavior in createSSURGO
R/createSSURGO.R:308
Making exdir optional changes the public behavior, but the @param exdir documentation still describes only an explicitly supplied path and does not say that NULL selects the latest fiscal-year WSS cache directory (or errors when none exists). Update the roxygen text so the generated createSSURGO help documents this new default.
Test failures are unrelated to this PR (fetchSCAN() failures); those seem to be persisting so I will merge this shortly and focus on some improvements to SCAN testing in another PR
I'd like the other soilDB authors to weigh-in on the topic of accepting any genAI suggested changes. @dylanbeaudette
I don't have a problem with genAI changes in general. I think all the same best practices apply. Targeted changes, presumed ownership of individual contributors functions, etc.. Where it gets sticky is functions that are reused internally by packages, such as uncode, that have to work. In such cases as usual it requires sufficient testing and eyeballs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a caching system for Web Soil Survey ZIP archives in the
downloadSSURGO()workflow, along with new utility functions for cache management. For #473