Feature 80 switch to vb codes#82
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR transitions the vegbankweb application from using deprecated accession codes and IDs to standardized VegBank codes across all files and tests, aligning with the latest API behavior.
Key Changes
- Renamed all column references from accession code formats (e.g.,
obs_accession_code,party_accession_code) to VegBank code formats (e.g.,ob_code,py_code) - Updated cached data file paths to use standardized naming conventions with dates
- Revised documentation and comments to reflect VegBank code terminology
Reviewed Changes
Copilot reviewed 14 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test_plot_table.R | Updated test data to use ob_code, to_code, and cl_code instead of accession codes |
| tests/testthat/test_plot_map.R | Replaced obs_accession_code with ob_code in test fixtures |
| tests/testthat/test_party_table.R | Changed party_accession_code to py_code and removed party_id column |
| tests/testthat/test_detail_view.R | Updated mock API function parameters to use VegBank code naming |
| tests/testthat/test_community_table.R | Replaced accession_code and default_name with cc_code and comm_name |
| inst/shiny/www/faq.md | Updated terminology from "Accession Code" to "VegBank Code" throughout documentation |
| R/ui.R | Renamed JavaScript variables and message handlers from accession to VegBank code terminology |
| R/table_project.R | Changed action button value from project_accession_code to pj_code |
| R/table_plot.R | Updated column references and join keys to use ob_code, to_code, and cl_code |
| R/table_party.R | Changed button value from party_accession_code to py_code |
| R/table_community.R | Updated column references to cc_code and comm_name, added numeric type for obs_count |
| R/server.R | Renamed state variables and function parameters from accession to VegBank code terminology, updated cached data file paths |
| R/map.R | Updated parameter names and column references to use ob_code instead of obs_accession_code |
| R/detail_view.R | Changed function parameters from accession_code to vb_code, updated field names in detail views |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
regetz
left a comment
There was a problem hiding this comment.
Thanks @DarianGill! Looks good other than the missing PC cache file, at least as far as I can tell. Seems to work fine after renaming plant_concepts_all_20250924.RDS to pc_20250924.RDS, but I'll let you decide whether a simple git mv is sufficient or whether the missing file is actually different.
| plant_data <- load_data_type( | ||
| "plant concepts", | ||
| "inst/cached_data/plant_concepts_all_20250924.RDS", | ||
| "inst/cached_data/pc_20250924.RDS", |
There was a problem hiding this comment.
Looks like this file isn't currently committed to the repo, although I do see a inst/cached_data/plant_concepts_all_20250924.RDS.
There was a problem hiding this comment.
Oh yea, I'd gitignored it because you mentioned not wanting to commit the 30 mb file, but I forgot to delete the old one when I updated the gitignore, so here we are 😅 I'll delete the old files and update the git ignore to include the renamed pc one.
| row <- sorted_taxa[i, ] | ||
| htmltools::tags$tr( | ||
| # TODO: Change to author name? To avoid NA in lots of cases | ||
| htmltools::tags$td(row$int_curr_plant_sci_name_no_auth), |
There was a problem hiding this comment.
FWIW I believe what plant names shows up in the "top five taxa" list on the original VegBank web app is controlled by JSP code here that controls table entries, and here providing the selector for name type.
I haven't totally worked out the logic, but it does seem to fall back readily to the author plant name.
Page example: http://vegbank.org/get/std/observation/2948
| @@ -1,4 +1,4 @@ | |||
| plant_concepts_all_20250924.RDS | |||
| pc_20250924.RDS | |||
There was a problem hiding this comment.
Ah I guess this explains why this RDS file isn't committed :)
What
This PR aligns all vegbankweb files and tests with the latest API behavior. Every view should be working except the community concept detail view which will be changed in the next pr to resemble the plant concept detail view.
Why
So that the web app works with the latest API standardization on vb codes, and removes it's deprecated use of accession codes and IDs
How
Renamed or replaced every accession code and ID reference in the repo to use vb codes
Pulled new RDS files (and modified the existing ones for the taxon obs) to update the cached data
Uploaded the cached data to drive
Added new todos for missing api values (lots of places where we have a code but no label to make a human-readable link with)
Fixed tests
Testing
All tests pass, including API tests run against a local instance of the latest dev API
Used devtools::test_coverage() to verify that we're at 100% coverage
Verified that devtools::check() runs locally without errors or warnings