Skip to content

Make the 1 arcmin data the default (climateData 3.0.0) - #45

Draft
achubaty wants to merge 17 commits into
feat/arbutus-hostingfrom
feat/1arcmin-default
Draft

achubaty wants to merge 17 commits into
feat/arbutus-hostingfrom
feat/1arcmin-default

Conversation

@achubaty

@achubaty achubaty commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Makes the 1 arcmin data release the default and adds an option to choose the 3 arcmin release. Stacked on #44. This is climateData 3.0.0 in #36's plan: don't merge it until 2.3.0 (#44, the 3 arcmin release) is released. Then retarget it to development, give its NEWS bullets their own 3.0.0 section, and squash-merge it: commit d57aa73 has no index files on its own (they arrive in c96a101).

For users

  • The default data are now the 1 arcmin release (cna-v7.70-1arcmin; cells about 1.85 km north to south), built from the same years and scenarios as the 3 arcmin release.
  • options(climateData.resolution = "3arcmin") selects the 3 arcmin release; any other value stops with the two valid ones. ClimateNA_tiles_sqlite() gets a resolution argument, which defaults to the option. The option must be set in every R process that calls climateData: a new process (a parallel or targets worker, callr) starts with the default, 1 arcmin. The docs say so.
  • The 1 arcmin archives are about 6 times larger (958 GiB against 150 GiB for the whole release); NEWS and the vignette warn about disk space.
  • When prepClimateLayers() can't find a mosaic it built, the error names the file and the release's output folder (the check itself failed before, on file.exists() of a list).
  • prepClimateLayers() writes its rasters to a subfolder of dstdir named for the data release (e.g. <dstdir>/cna-v7.70-1arcmin/), as it already does for downloads in srcdir, and adds the release to its cache key. The two resolutions' files have the same names, so they never mix. Rasters written to dstdir itself by earlier versions are not used again.

For maintainers

  • The package ships one index per release: inst/extdata/ClimateNA_tiles_1arcmin.sqlite (new) and ClimateNA_tiles_3arcmin.sqlite (the 2.3.0 index, renamed). Both are in Host the archives on Arbutus and download over HTTPS #44's normalized schema, about 20 MB each (52 MB before); the pipeline rebuilt the 1 arcmin one from its store, and every row, archive, filled cell and release field equals the index the upload produced.
  • data-raw/pipeline/release-1arcmin.yml holds the 1 arcmin release's settings (same as release.yml but release_id and dem_resolution). The pipeline's default previous_index (for reusing identical zips) is the shipped ClimateNA_tiles_<dem_resolution>.sqlite.
  • Each resolution needs its own out_root: a run at the other resolution in the same out_root would delete and rerun every period, overwriting the first release's raw outputs. tar_make() now stamps out_root with its dem_resolution (an older out_root takes it from its index) and stops on a mismatch, before any target runs (data-raw/pipeline/R/out_root.R; only under tar_make(), so tar_manifest() and the like write nothing).
  • The maintainer vignette now describes two releases: adding a year or scenario means editing both release files (a test keeps them equal but for release_id and dem_resolution), running the pipeline once per resolution, and shipping both indexes.
  • canClimateData's own Cache() doesn't key on the release; it must add climateDataRelease()$release_id before it moves to climateData 3.0.0, or it can return one resolution's cached layers for the other.
  • Carries Host the archives on Arbutus and download over HTTPS #44's later fixes (see Host the archives on Arbutus and download over HTTPS #44): download edge cases, pipeline checks, the report, and the normalized index schema.

Data

Checks

  • The 1 arcmin upload: 6,560 upload branches, none failed. A listing of climateData/cna-v7.70-1arcmin/ against the new index: 24,518 keys, none missing, no MD5 or size differences (the 52 other objects are catalogue pages). 200 random anonymous HEADs: status 200, ETag = MD5. Its report.csv holds only the 108 warnings about land cells still empty after filling (tiles 30, 31 and 40), as in the 3 arcmin release.
  • End to end on a compute node with no Google credentials, once per resolution, each from an empty srcdir into the same dstdir: prepClimateLayers() for tile 39, one variable per archive type. Each run downloaded 4 zips over HTTPS with no googledrive call and returned layers at its own resolution, written to <dstdir>/cna-v7.70-1arcmin/ and <dstdir>/cna-v7.70-3arcmin/ (10 files each). The 3 arcmin run left the 1 arcmin files unchanged (same MD5s and modification times).
  • R CMD check on a compute node: 0 errors, 0 warnings, 1 note (unused hms import, as on Build data releases with a targets pipeline; ship cna-v7.70-3arcmin #39). Full suite with the online tests (one download per resolution): 581 expectations, 0 failed, 1 skipped (makeClimateDEM(), Windows only).

🤖 Generated with Claude Code

achubaty and others added 13 commits December 3, 2026 23:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
release-1arcmin.yml matches release.yml but for release_id and resolution;
previous_index defaults to the shipped index of the release's resolution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
options(climateData.resolution) picks the 1 arcmin (default) or 3 arcmin index;
prepClimateLayers() writes outputs under <dstdir>/<release_id>/ and keys its cache on the release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ClimateNA_tiles_1arcmin.sqlite indexes the new cna-v7.70-1arcmin release in the bucket;
the 3 arcmin index is renamed unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NEWS 3.0.0 bullets, a Resolution section in the user vignette, per-resolution index
names in the maintainer vignette and CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The resolution option must be set in each R process; 1 arcmin archives are ~6x larger;
maintainers need one out_root per resolution and run each update twice (review findings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tar_make() stamps out_root with dem_resolution (or reads it from an older out_root's index)
and stops on a mismatch, which would rerun every period and overwrite the other release's
outputs. Also drops the dead fallback to the pre-3.0.0 index name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ClimateNA_tiles_sqlite('1arcsec') now names `resolution`; every lookup is checked to open the
option's index, and the release-file test no longer hard-codes the release id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lookups say they follow the option; filled-cell figures for both resolutions; NEWS names the
replaced index file; getClimateTiles() wants a folder per release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
achubaty and others added 4 commits December 4, 2026 22:44
…1arcmin-default

# Conflicts:
#	CLAUDE.md
#	R/dataRelease.R
#	data-raw/pipeline/_targets.R
#	man/climateDataRelease.Rd
#	vignettes/maintaining-climate-data.Rmd
The check called file.exists() on a list, so it failed before naming the files; it now names
them and the release's output folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
terra::all.equal() sampled 1e5 cells of the larger 1 arcmin rasters, with a warning each time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebuilt by the pipeline (tar_make(names = "index", shortcut = TRUE)) from the release's store;
every view row, archive, filled cell and release field equals the previous index's. 52.9 -> 20.7 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant