Fix R CMD check: clean to Status OK#39
Merged
Merged
Conversation
Two changes to src/GM99.cpp: 1. Tighter Poisson truncation in estab(): reduce Kmax from N + 10*sqrt(N+1) + 20 to N + 6*sqrt(N+1) + 6. The tail beyond the new cutoff is < 1e-10, so accuracy is unchanged but each dimension of the Cartesian odometer has ~2x fewer terms (e.g. N=1: 31 -> 16). 2. Replace the fixed-point iteration N_i <- N_i * W_i (up to 10000 steps, absolute tolerance) in gm99_equilibrium() with Newton's method on log W_i(N) = 0 in log-N space, using a numerical Jacobian computed by forward differences. Newton converges quadratically so only ~10-30 steps are needed vs thousands for the old fixed-point, which could oscillate slowly for multi-resident systems. Competitive exclusion is handled by removing near-zero residents (N < 1e-8, log W < 0) from the active Jacobian system. Before/after benchmarks (alpha=7, beta=15, R=1): 2-resident equilibrium: ~3.5 ms -> 0.11 ms (>30x) 3-resident equilibrium: ~1100 ms -> 4.7 ms (>230x, target was <100 ms) assembler step at 3 residents: ~6000 ms -> <0.1 ms (>60000x) All 218 tests pass unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adapt the plant-family build conventions to regnans: - Makefile: adapted from plant/Makefile, dropping RcppR6/vignettes/ website targets (regnans uses plain Rcpp::compileAttributes and has no vignettes or pkgdown). Targets: compile, attributes, roxygen, test, install, build, check, clean. - .github/workflows/R-CMD-check.yaml: adapted from plant-dev2's modern r-lib/actions workflow (plant itself only has legacy Travis/AppVeyor). Runs R CMD check on Windows + macOS. - DESCRIPTION: add Remotes (traitecoevo/plant, smbache/loggr) so CI can install the GitHub-only dependencies. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve the install failure and all R CMD check warnings/notes:
- man/harness_gm99.Rd: reword apostrophes in roxygen (R 4.6 parse_Rd
read them as quote delimiters -> "unexpected end of input")
- community_demography.R: drop stray `ctrl = ctrl` arg (unused-argument
byte-compile note / latent runtime error)
- NAMESPACE: add @importFrom for stats/utils/ggplot2/dplyr/tibble/purrr
+ utils::globalVariables for NSE column names; move dplyr/tidyr/
mlr3learners from Depends to Imports; declare bbotk/data.table/loggr/
mlr3/mlr3mbo/paradox; drop unused progress; requireNamespace(mlr3learners)
- roxygen @param: sync community_start / community_solve_singularity_1D /
community_fitness_landscape with signatures; describe empty `@param ...`;
make community_fitness_landscape_bayesopt internal (no Rd)
- regenerate stale generated files to match committed GM99.cpp (Newton):
RcppExports.R + gm99_equilibrium.Rd defaults (200L / 1e-10)
- fix broken \link{assembler_stochastic_naive} cross-reference
- DESCRIPTION: complete-sentence Description; drop LazyData (no data/)
- .Rbuildignore: .claude, .github, .plant-interface-version, AGENTS.md,
dev Makefile (GNU-extensions warning)
- move WIP vignettes (assembly_fitmax, assembly_stochastic,
solving_attractors) out to overstorey_staging as .qmd
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Brings
R CMD checkto Status: OK (was 6 WARNINGs + 3 NOTEs, plus an install failure and a CI vignette-build error on macOS).Fixes
man/harness_gm99.Rdreworded so R 4.6'sparse_Rdno longer reads apostrophes (x',paper's,Daniel's) as quote delimiters (was: "unexpected end of input").ctrl = ctrlarg indemography_solve_equilibrium_solve()(unused-argument byte-compile note).@importFromfor stats/utils/ggplot2/dplyr/tibble/purrr +utils::globalVariables()for NSE columns; moveddplyr/tidyr/mlr3learnersfrom Depends to Imports; declaredbbotk/data.table/loggr/mlr3/mlr3mbo/paradox; dropped unusedprogress;requireNamespace(mlr3learners)instead ofrequire().@paramblocks with signatures (community_start,community_solve_singularity_1D,community_fitness_landscape); described empty@param ...; madecommunity_fitness_landscape_bayesoptinternal; fixed broken\link{assembler_stochastic_naive}.RcppExports.R+gm99_equilibrium.Rdto match the committed NewtonGM99.cpp(200L/1e-10). Master currently still has the old10000L/1e-12in these generated files, so this also clears the codoc mismatch now present on master.Description; removedLazyData(nodata/)..claude,.github,.plant-interface-version,AGENTS.md, devMakefile(GNU-extensions warning).Vignettes → staging
The three WIP vignettes (
assembly_fitmax,assembly_stochastic,solving_attractors) ran the full plant SCM on every build (the source of the macOS CIcreating vignettes ... ERROR). Moved out tooverstorey_staging/as.qmd.Not touched
loggris left as-is (Imports +Remotes: smbache/loggr), matchingplant, which uses it and passes on Windows. The earlier Windowspkgdependsresolution error on #35 looks like a transient/knock-on solve failure rather than a real loggr problem.🤖 Generated with Claude Code