Contributing to spatialkit
Source:.github/CONTRIBUTING.md
Getting help
Ask a question or report a bug on the issue tracker. Include:
- a small example that reproduces the problem (simulated points are fine);
- the output of
sessionInfo(); - the full warning or error, as R printed it;
- if it helps, the session log, which the package writes to
file.path(tempdir(), "spatialkit_model_log.log").
Proposing a change
Contributions are welcome. Open an issue describing the bug or the change first, and include a regression test with any fix.
Development
devtools::load_all() # interactive development
devtools::test() # run the test suite
devtools::document() # regenerate NAMESPACE and man/ with roxygen2
devtools::check() # full R CMD check (building the vignettes needs pandoc)The checked-in NAMESPACE and man/ are generated by roxygen2, whose version is recorded in DESCRIPTION; devtools::document() reproduces them. README.md is generated from README.Rmd by devtools::build_readme().
README figures
The three figures in man/figures/ are drawn from package output. Regenerate them from the package root:
The script prints the cell counts and leave-one-out errors that README.Rmd quotes beside the figures; copy them into README.Rmd whenever the figures change. readme-resolution.png marks the default cell count, so rebuild it whenever the default count of resolution_profile() or its scoring changes.
Tests and continuous integration
The test suite covers the geometry and tessellation pipeline, every exported function, and regression tests for the statistical internals: the variance of Moran’s I and its sparse-weights path, the alignment of folds and row IDs in cross-validation, CRPS, hex-grid sizing, the choice of CRS at wide extents, and the CRS and NA alignment of predictions, among others. A test that needs an optional package skips when that package is absent.
The backends job in .github/workflows/R-CMD-check.yaml installs the optional model backends and most other optional packages, but not brms, so a green run there means the guarded paths ran. The Stan smoke tests also need the SPATIALKIT_TEST_BRMS environment variable, which only the weekly check-brms workflow sets, so they do not run in the matrix even where brms is installed.