Skip to content

v1.9.4: populateDaily (#265), loadLm pred col (#258) - #266

Merged
aappling-usgs merged 2 commits into
mainfrom
EGRET-populateDaily
Oct 14, 2026
Merged

aappling-usgs merged 2 commits into
mainfrom
EGRET-populateDaily

Conversation

@aappling-usgs

@aappling-usgs aappling-usgs commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

This MR could be merged after #264 because this one contains a version update 1.9.3->1.9.4. If we do that, we should add NEWS entries for #264 in one of the PRs- I think this one would be easier.

But this MR contains its own stuff, too:

  • resolve EGRET populateDaily now merges to 1 row per day #265: updates for changes in EGRET to the behavior of populateDaily. I've written about the thinking & changes in this PR within that issue.
  • resolve preds_lm has inconsistent col name #258: loadLm was returning predictions in a column named "fit", which should be "conc" or "flux" to be consistent with other models. That issue is so simple there's not much to discuss, except that I can confirm no regression (or improvement) in tests related to loadLm.

Test results: attaching a bundle of test scripts and pre-and-post change scripts, pretty much. The trick here is that I needed different EGRET versions installed to understand the regression and then the fix. The test files:

  1. 'test-output-261005-1736.rds' - representative of the state before EGRET changed
  2. 'test-output-261013-1102.rds' - representative of the new problems due to the EGRET::populateDaily update. This test might also sit on other loadflex updates as in Address issues 259 260 261 #264, but as noted in Address issues 259 260 261 #264 (comment), the new test errors relative to 261005-1736 appear to be due entirely to the change to EGRET
  3. 'test-output-261013-1447.rds' - after the changes in this PR, with tests fixed relative to BOTH of the preceding files

The test scripts and outputs are bundled here:
tests-PR266.zip

To summarize the changes, this MR fixes two old issues (already present in 261005-1736) and the six issues that popped up as soon as I installed EGRET updates this week (new in 261013-1102).

Details on errors and test comparisons

Changes from 1 to 2 (the new errors to fix):

r$> compare_edits('temp/test-output-261005-1736.rds', 'temp/test-output-261013-1102.rds')
OLD: temp/test-output-261005-1736.rds (Phase 2 complete — tidyverse-drift fixes applied)
    Tests: 89 | Passed: 41 | Failed: 61 | Errors: 16 | Warnings: 21 | Skipped: 24
NEW: temp/test-output-261013-1102.rds (Edits for PR #264, "Address issues 259 260 261")
    Tests: 89 | Passed: 35 | Failed: 61 | Errors: 22 | Warnings: 21 | Skipped: 24

========================================================
  ERRORS (structured, matched by file + test)
========================================================
Totals: OLD = 16 across 16 tests | NEW = 22 across 22 tests

DEGRADED - ERRORS newly present in these tests
----------------------------------------------
test-44-plots.R - plotEGRET works for fitdat and meta (now 1)

test-51-EGRET.R - convertToEGRET allows metadata and data or newdata without model (now 1)

test-51-EGRET.R - convertToEGRET complains about redundant metadata or data (now 1)

test-51-EGRET.R - convertToEGRETDaily returns partial info without preds (now 1)

test-51-EGRET.R - convertToEGRETSample correctly converts (now 1)

test-51-EGRET.R - expandFlowForEGRET returns correct columns (now 1)

Changes from 1 to 3 (this PR fixes two old EGRET-related errors from before the EGRET change - a bonus):

r$> compare_edits('temp/test-output-261005-1736.rds', 'temp/test-output-261013-1447.rds')
OLD: temp/test-output-261005-1736.rds (Phase 2 complete — tidyverse-drift fixes applied)
    Tests: 89 | Passed: 41 | Failed: 61 | Errors: 16 | Warnings: 21 | Skipped: 24
NEW: temp/test-output-261013-1447.rds (v1.9.4: adapt to new EGRET::populateDaily behavior; fix #258)
    Tests: 91 | Passed: 45 | Failed: 61 | Errors: 14 | Warnings: 21 | Skipped: 24

========================================================
  ERRORS (structured, matched by file + test)
========================================================
Totals: OLD = 16 across 16 tests | NEW = 14 across 14 tests

IMPROVED - ERRORS fully gone from these tests
---------------------------------------------
test-51-EGRET.R - convertToEGRET returns prediction-free Daily when predictions are missing (had 1)

test-51-EGRET.R - convertToEGRETDaily correctly converts (had 1)

Changes from 2 to 3 (this PR was focused on fixing the six errors introduced between 1 and 2, and it succeeds as demonstrated here):

r$> compare_edits('temp/test-output-261013-1102.rds', 'temp/test-output-261013-1447.rds')
OLD: temp/test-output-261013-1102.rds (Edits for PR #264, "Address issues 259 260 261")
    Tests: 89 | Passed: 35 | Failed: 61 | Errors: 22 | Warnings: 21 | Skipped: 24
NEW: temp/test-output-261013-1447.rds (v1.9.4: adapt to new EGRET::populateDaily behavior; fix #258)
    Tests: 91 | Passed: 45 | Failed: 61 | Errors: 14 | Warnings: 21 | Skipped: 24

========================================================
  ERRORS (structured, matched by file + test)
========================================================
Totals: OLD = 22 across 22 tests | NEW = 14 across 14 tests

IMPROVED - ERRORS fully gone from these tests
---------------------------------------------
test-44-plots.R - plotEGRET works for fitdat and meta (had 1)

test-51-EGRET.R - convertToEGRET allows metadata and data or newdata without model (had 1)

test-51-EGRET.R - convertToEGRET complains about redundant metadata or data (had 1)

test-51-EGRET.R - convertToEGRET returns prediction-free Daily when predictions are missing (had 1)

test-51-EGRET.R - convertToEGRETDaily correctly converts (had 1)

test-51-EGRET.R - convertToEGRETDaily returns partial info without preds (had 1)

test-51-EGRET.R - convertToEGRETSample correctly converts (had 1)

test-51-EGRET.R - expandFlowForEGRET returns correct columns (had 1)

@github-actions

Copy link
Copy Markdown

📖 pkgdown preview for this PR: https://doi-usgs.github.io/loadflex/preview/pr266/

@gfkltn gfkltn left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Admin review completed. No issues found.

@aappling-usgs
aappling-usgs merged commit 0f6e7e6 into main Oct 14, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EGRET populateDaily now merges to 1 row per day preds_lm has inconsistent col name

2 participants