Fixes a bug reported by a tester where hydrograph_setup() produced NA for obs_vol when the input CSV contained trailing empty rows — a common artifact of read.csv() on Excel-exported files.
read.csv() reads the full padded row range from Excel exports, producing trailing rows with NA in the Flow column and "" in Date/Time. These propagated through zoo::rollmeanr() as NA, poisoning obs_vol, and broke the routing extension's time sequence.
Truncate each input hydrograph at the last row with a valid (non-NA) flow value. Interior NAs are preserved so malformed inputs fail loudly downstream, rather than being silently dropped. Emits a cli::cli_inform per hydrograph noting how many trailing rows were dropped.
Added tests/testthat/test-hydrograph_setup.R with two tests:
- Confirms
obs_volis finite when input has trailing empty rows, and matches the result from clean input - Confirms the
cli_informmessage fires with the correct row count
Both pass locally under devtools::test() and devtools::check().
- Created news file. This feels like a big step
- Added validation vignettes and user guide/manual.
- There will be many blind spots and bugs. All questions, bug reports, and suggestions are welcome!