Repository navigation
Read curation sheets from bugphyzzExports instead of Google (#306) - #311
Conversation
physiologies() read all 24 curation sheets and the fatty acid sheet live from Google on every call. It now reads the snapshots in bugphyzzExports sources/sheets/ (bugphyzzExports ADR 0007, #113) through BiocFileCache, like the programmatic sources. - spreadsheet_links.tsv / spreadsheet_customlinks.tsv: link now holds the path under sources/ (sheets/aerophilicity.csv); source_link kept. - .importSpreadsheets() and .fattyAcidComposition() resolve link against .sourcesBaseUrl() and read via .getResource(), so a sheet is cached and a change shows up only after forceDownload = TRUE. forceDownload added to .importSpreadsheets() and passed through from physiologies(). - An unreachable base URL when reading the sheets is a hard error; the programmatic-sources read stays a warning, with corrected text. - Tests: give the base-URL tests a sheet file, add an offline sheet read. - Docs: README, inst/scripts/README (and the custmolinks typo), physiologies() @details/@PARAM and .Rd, NEWS. Verified old-vs-new, run back to back: .importSpreadsheets (24), .fattyAcidComposition (138,496 rows) and physiologies("all") (45) are identical on rows and column types, and bugphyzzExports apply_sheet_overrides() matches all 5 override rows on the new output. Co-authored-by: Claude Code <noreply@anthropic.com>
| ## CSV in waldronlab/bugphyzzExports, sources/sheets/ (ADR 0007); the `link` | ||
| ## column of spreadsheet_customlinks.tsv holds the path there, resolved against | ||
| ## .sourcesBaseUrl() and read through the cache like .importSpreadsheets(). | ||
| .fattyAcidComposition <- function(forceDownload = FALSE){ |
There was a problem hiding this comment.
forceDownload is added here, but nothing in R/ calls .fattyAcidComposition(). physiologies(forceDownload = TRUE) therefore never refreshes this sheet, although the docs say it re-downloads "the curation sheets". Either pass it through from the caller or drop the argument and adjust the docs. The new caching code is also duplicated from .importSpreadsheets() (tag + .getResource + cache-key construction); a small shared helper would keep the two in step.
|
Review notes:
I found nothing else worth raising. Exported docs ( |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #311 +/- ##
===========================================
+ Coverage 46.69% 56.76% +10.06%
===========================================
Files 5 5
Lines 816 821 +5
===========================================
+ Hits 381 466 +85
+ Misses 435 355 -80 ☔ View full report in Codecov by Harness. |
.importSources(), .importSpreadsheets() and .fattyAcidComposition()
repeated the base-URL hash cache key and the .getResource() call. Pull it
into one helper so the keying cannot drift between them. No behaviour
change: physiologies("all") and the sheet/fatty-acid imports are identical
to before (addresses the PR #311 review).
Co-authored-by: Claude Code <noreply@anthropic.com>
|
Thanks. Addressed both points: 2 (duplication): extracted 1 ( @claude review |
Closes #306. Needs waldronlab/bugphyzzExports#113, which is merged.
physiologies()read all 24 curation sheets and the fatty acid sheet live from Google on every call. It now reads the snapshots in bugphyzzExportssources/sheets/(bugphyzzExports ADR 0007, waldronlab/bugphyzzExports#113) through BiocFileCache, like the programmatic sources. Results are identical; the sheet data is now cached, so a change to a sheet shows up only afterforceDownload = TRUE.Changes
spreadsheet_links.tsvandspreadsheet_customlinks.tsv:linknow holds the path undersources/(sheets/aerophilicity.csv);source_linkis kept per ADR 0007..importSpreadsheets()and.fattyAcidComposition()resolvelinkagainst.sourcesBaseUrl()and read through.getResource(), sooptions(bugphyzz.sourcesBaseUrl = ...)points them at a local checkout.forceDownloadadded to.importSpreadsheets()and passed through fromphysiologies().sources = FALSEstill means "skip programmatic sources" and reads the sheet data.source_linkstays, so.appendLinks()(dead code, referenced only ininst/backup/) is left untouched.inst/scripts/README.md(and thecustmolinkstypo),physiologies()@details/@paramand.Rd, NEWS. Version is already 1.9.1.Old vs new comparison
Run back to back so the sheets could not change in between (old = live Google Sheets, new = this branch against bugphyzzExports). Everything is identical on rows, sorted content, and column types.
.importSpreadsheets(showPhys("spreadsheets")).fattyAcidComposition()physiologies("all")apply_sheet_overrides()on the new outputDo not merge between about 21:00 UTC Sunday and 01:00 UTC Monday, while the weekly export runs.
🤖 Drafted with Claude Code