Use timelapse template for image data field validation#2
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates read_image_data() to derive CSV column specifications from TimeLapse .tdb templates (bundled or user-supplied), enabling more flexible CSV imports (extra columns, multiple template types including migration/wallow) and aligning downstream summaries/QA with the new schema variability.
Changes:
- Add
.tdbparsing and mapping toreadrcolumn specs; support selecting templates via filename detection, interactive menu, or explicittemplate=path. - Update image-data import/cleaning to better handle template-specific columns and to add
total_count_episodewhen missing. - Refresh documentation and snapshots; bundle additional TimeLapse templates in
inst/extdata.
Reviewed changes
Copilot reviewed 18 out of 32 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
tests/testthat/test-image-data.R |
Adds tests for extra columns, unnamed empty columns, and template selection paths. |
tests/testthat/_snaps/summary.md |
Updates summary snapshot outputs reflecting starred counts. |
tests/testthat/_snaps/sessions.md |
Updates snapshots for changed column types (e.g., integer vs double). |
tests/testthat/_snaps/rai.md |
Updates RAI snapshots for changed total_count type. |
tests/testthat/_snaps/image-data.md |
Updates snapshots for new warnings/errors and type changes. |
man/read_image_data.Rd |
Documents new template argument and expanded behavior. |
inst/scratch-templates.R |
Adds an example script for trying migration/wallow imports. |
inst/extdata/timelapse-templates/TimelapseTemplate_Ungulate_General_v2.tdb |
Bundles a new TimeLapse template DB. |
inst/extdata/timelapse-templates/TimelapseTemplate_Elk_Migration_v1.tdb |
Bundles a new TimeLapse template DB. |
inst/extdata/timelapse-templates/RISC_WCR_MasterTemplateFieldPicklist_20250109.tdb |
Bundles master picklist template DB used for type overrides. |
inst/extdata/timelapse-templates/RISC_WCR_ImageLabelling_Template_v20230518.2.tdb |
Bundles a new/updated labeling template DB. |
inst/extdata/timelapse-templates/RISC_WCR_ImageLabelling_Template_v20230518.1.tdb |
Bundles a labeling template DB. |
data-raw/field_info.R |
Removes the prior approach for generating template field info from a .tdb. |
data-raw/data-raw.R |
Stops sourcing/saving the removed tl_template_* dataset. |
README.md |
Updates user docs/examples for selecting templates and reflects type changes. |
README.Rmd |
Same as README.md but in source form. |
R/tdb-to-colspec.R |
Introduces .tdb parsing and mapping to readr::cols(). |
R/sysdata.rda |
Updates internal package data (binary). |
R/summary.R |
Makes summary more robust to missing columns across templates. |
R/qa-images.R |
Adjusts QA column dropping logic and count validation to handle missing cols. |
R/image-data.R |
Integrates template selection, .tdb colspecs, extra-column handling, and new cleaning steps. |
R/classes.R |
Stores template name as an attribute on image_data. |
DESCRIPTION |
Bumps minimum R version and moves DBI/RSQLite/jsonlite to Imports. |
.gitignore |
Adds ignores for .claude and Quarto artifacts. |
.Rbuildignore |
Excludes .claude from package builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…into Use-timelapse-tdb
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.
This is to increase the flexibility of importing different csvs. It will allow:
.tdbfile from TimeLapseThis will now allow importing data from the wallow/migration timelapse templates.
This reads in migration and wallow data structured with different approaches (with/without a static image accompanying the start of a video episode). It imports, standardizes names and column types, and allows for
summary()and the start ofqa_image_data()on these new types of datasets