R CMD check: import rlang pronouns, move sf to Suggests - #114
Merged
Merged
Conversation
Import the .data and .env pronouns from rlang, which code used unqualified, and move sf from Imports to Suggests: no R code calls it, and cd_crop() only checks inherits(aoi, "sf") before terra::vect(), which loads sf itself. Tests that read their AOI with sf::st_read() now skip without sf. Fixes #111 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj
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.
Summary
.dataand.envpronouns from rlang (@importFrom rlang .data .envinR/cd-package.R). They were used unqualified incd_baseline(),cd_compare(),cd_plot_comparison(),cd_plot_timeseries()andcd_summary().sffrom Imports to Suggests. No R code calls it:cd_crop()checksinherits(aoi, "sf")and hands the object toterra::vect(), which loads sf itself, and anyone holding an sf object already has sf installed. The examples, README and vignettes still usesf::st_read().sf::st_read()nowskip_if_not_installed("sf"), as the Kendall/zyp tests already do.Fixes #111
Behaviour change for installers:
pak::pak("NewGraphEnvironment/cd")no longer installs sf. The org's only package that depends on cd iswet, which lists it under Suggests.Related Issues
Test plan
R CMD check --no-manual --ignore-vignettes: Status: OK, 0 NOTEs (was 2). Run with_R_CHECK_FORCE_SUGGESTS_=false, since aws.s3 and ecmwfr are not installed locally.devtools::test(): FAIL 0, PASS 436. Its 6 warnings come fromcd_plot_comparisonand appear onmaintoo.importFromlines brings both NOTEs back, so the import is what clears them./code-check: 3 rounds, all Clean.terra::vect()path without sf loaded.identical(ggplot2::.data, rlang::.data).pkg::and every test that uses sf.Notes
@examplescallsf::st_read()without a guard. They fail only under a check that skips Suggests without sf installed, and nothing here checks that way.🤖 Generated with Claude Code
https://claude.ai/code/session_01GignjoKpZADXywTf6pAMgj