Conversation
Use names(tag$acceleration) when checking for a 'label' field instead of %in% on the object itself. The previous check could match values rather than column/list names; this ensures we correctly detect a 'label' column/key in tag$acceleration and avoids incorrect branch behavior.
Wrap interactive prompts with interactive() checks across several functions so they no longer block or error in non-interactive/batch contexts (CI/CRAN). Defaults are provided when not interactive: directory-creation prompts default to TRUE, select.list prompts default to choice 1 (No), and overwrite confirmation defaults to FALSE. Files changed: R/geopressuretemplate_tag.R, R/tag_label.R, R/tag_set_map.R, R/trainset_write.R. Adjusted nocov placement accordingly to preserve coverage reporting where appropriate.
load_interim: treat .rda/.rdata extensions as explicit RData paths without requiring the file to already exist (removed file.exists check).
trainset_write: when asking to create a missing directory, honor options("askYesNo") in non-interactive runs by calling utils::askYesNo if that option is set; otherwise default to TRUE. This preserves interactive prompting and allows programmatic control of the prompt behavior.
Protect registration of the S4 method for 'rast' by wrapping methods::setMethod("rast", "map", rast.map) in try(..., silent = TRUE). This prevents package load failures or noisy errors if the method cannot be set (e.g., due to missing generic or conflicts) while preserving the attempt to register the method in zzz.R.
Extract the load_interim() test block from tests/testthat/test-0-workflow.R into a new dedicated file tests/testthat/test-1-load_interim.R. This keeps the workflow test file focused and isolates the var / var_optional checks for load_interim in their own test file; behavior and assertions are unchanged.
Add validation to tag_create to error when both crop_start and crop_end are provided but crop_start is not strictly earlier than crop_end. In tag_create_crop initialize a has_data flag, update it after cropping each sensor, and abort with a clear message if cropping was requested but no data remains. Error messages use cli::cli_abort and include received values to aid debugging.
Replace the old "dataframe" input flow with a new "tabular" mode that accepts in-memory data.frames/tibbles or CSV paths. Adds tag_create_tabular (and helpers tag_create_tabular_read, tag_create_tabular_check, tag_create_csv) to read/validate sensor CSVs, and removes tag_create_dataframe.R. Update tag_create to detect and dispatch "tabular", adjust trainset csv2tag to use tabular, and rename internal sensor variables (e.g. df -> sensor_data) in parsing helpers. Documentation and man pages updated to describe the "tabular" usage and CSV column expectations. Tests updated to cover CSV and in-memory tabular inputs and to reflect changed warning expectations.
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.
No description provided.