Fix bugs, remove dead code, and deduplicate shared patterns#878
Merged
ldecicco-USGS merged 2 commits intoDOI-USGS:developfrom Apr 16, 2026
Merged
Fix bugs, remove dead code, and deduplicate shared patterns#878ldecicco-USGS merged 2 commits intoDOI-USGS:developfrom
ldecicco-USGS merged 2 commits intoDOI-USGS:developfrom
Conversation
Collaborator
|
Could you change the PR to aim to the "develop" branch? We try to keep "main" to what was most recently pushed to CRAN, and "develop" to what will eventually get pushed up there. The main reason for that (vs just a tagged release) is making it easier to keep the GH-Actions that produce the documentation sync'ed up to what's on CRAN and not a mis-match with what will be on CRAN (since the vast vast majority of users get the package from there and not GitHub). I think the datetime bug was already fixed on develop. Some of the other shared pattern stuff looks good. |
Fix format_api_dates bug where loop variable was unused and full datetime vector was passed instead of each element. Fix readNWISrating referencing undefined intColumns variable. Remove dead functions (only_legacy, post_url, .capitalALL) and unreachable measurements branch. Extract add_api_token, coerce_num_cols, and log_rate_limit helpers to replace duplicated code. Simplify deprecated read_USGS_samples wrapper to use ... forwarding. Cache user-agent string. Replace rbind in loop with pre-allocated lists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
@ldecicco-USGS rebased to dev. Please leave comments on any changes you don't want, or close this PR entirely. I was mainly curious what Claude wouild drag up. |
Give read_USGS_samples its own roxygen docs instead of sharing @Rdname with read_waterdata_samples, since the ... signature doesn't match the documented parameter list. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
format_api_datesbug where loop variableiwas unused — full datetime vector passed toget_dateTime()instead of each elementreadNWISratingreferencing undefinedintColumnsvariable (would crash at runtime)only_legacy,post_url,.capitalALL) and unreachablemeasurementsswitch branchadd_api_token()helper replacing 4 duplicate token injection patternscoerce_num_cols()andlog_rate_limit()helpers inwalk_pages.Rread_USGS_sampleswrapper from 60 lines to 5 using...forwardingpkg.envto avoid recomputing on every HTTP requestreadNGWMNdataNet: -131 lines across 10 files. All 283 tests pass.
Test plan
devtools::test())read_waterdata_samplesdeprecated alias still worksreadNWISratingworks whencurrent_rating_nucolumn is present🤖 Generated with Claude Code