Thanks for your interest in contributing to edaphos – a research-grade R package for Digital Soil Mapping. This document captures the conventions of the project so a contributor can submit a useful pull request without round-tripping with the maintainer.
Code of conduct
By participating in this project you agree to abide by the Code of Conduct.
Quick path: I just want to file an issue
- Bug: open https://github.com/HugoMachadoRodrigues/edaphos/issues/new?template=bug_report.md and follow the template (minimal reproducible example, expected vs observed behaviour, R version + platform).
-
Feature request: open https://github.com/HugoMachadoRodrigues/edaphos/issues/new?template=feature_request.md and motivate the feature against one of the 10 research pillars (
cheatsheets/pillarN.md). - Security disclosure: see SECURITY.md – do NOT file public issues.
Quick path: I want to send a PR
Fork the repo and create a feature branch off
main.Discuss first for non-trivial changes (architectural, public-API-breaking). Open an issue and tag it
discussion.Code style: 2-space indent, no tabs, ~80 char lines. Use the existing pillar’s idiom (look at any
R/pillar*file).Tests: add
testthattests covering the new behaviour. Seetests/testthat/helper-torch.Rfor the torch-skip pattern.Documentation: every exported function gets
@export,@paramfor every argument,@return, and at least one@examplesblock. Rundevtools::document()before committing.-
Run locally before pushing:
The fast loop, for iterating:
devtools::load_all() devtools::test() # all green devtools::check(args = c("--no-manual", "--no-build-vignettes"))check()reports 2 NOTEs, not a clean sweep. This block used to say0/0/0; that was never true of any tree this package has had, andcran-comments.mdexplains what each note is. A checklist item that can only be satisfied by a lie gets ticked anyway.And build the vignettes at least once before opening a PR that touches
vignettes/,R/, or anything they read:devtools::check(args = "--no-manual") # builds all 19 vignettes--no-build-vignettesis convenient and it is also how documents rot here. Four articles underarticles/were excluded from the build and went unbuilt for as long as they existed; all four were broken, by a one-line bibliography path, and nothing noticed because nothing ever built them. Several vignettes also carryknitr::knit_exit()gates that truncate the document to a single line when an optional dependency (torch,dagitty,aqp,sp) is absent — a full build is the only thing that shows you what a reader without that dependency actually receives.Then the two documentation gates, which CI also runs (
.github/workflows/quality-gates.yaml):devtools::spell_check() # clean on the English surfaces urlchecker::url_check() # 403s from doi.org are bot-blocking, not breakage Commit messages: use the Conventional Commits prefixes (
feat,fix,perf,docs,test,refactor,chore). Bullet-list the substantive changes in the body.NEWS.md: prepend a versioned entry under the next planned release.
Send PR against
main. CI must be green on all five matrix legs (Ubuntu oldrel-1 / devel / release + macOS + Windows).
Architectural conventions
- Every “pillar” (1-10) lives in
R/pillarN_*.R. Cross-pillar bridges live inR/bridges_*.R. - Heavy optional dependencies (
torch,terra,geodata,dagitty, …) go in Suggests, NOT Imports. Code that uses them MUST be wrapped inrequireNamespace("foo", quietly = TRUE). - Every predictive output should be wrappable as
as_edaphos_posterior(...)so cross-pillar benchmarks score on the same scale. - Compiled code (
src/*.cpp) requires a correspondingtests/testthat/test-*-rcpp.Rvalidating numerical equivalence with the pure-R reference. - Vignettes follow a “methods paper” structure: abstract, derivation, code, results, references. See
vignettes/pillar2-piml-profile.Rmdfor the canonical template.
Branch / release flow
-
mainis the integration branch. All PRs targetmain. -
gh-pagesholds the rendered pkgdown site (auto-managed by.github/workflows/pkgdown.yaml). - Releases follow SemVer:
-
MAJORfor breaking public-API changes, -
MINORfor additions (new pillars, bridges, exported functions), -
PATCHfor bugfixes. Every release gets a git tag (vX.Y.Z) and a NEWS.md entry.
-
Reproducing the benchmarks
Heavy artefacts are under data-raw/. The pattern is:
data-raw/
A re-run is a one-liner:
Rscript data-raw/benchmark_wosis_6pillar.R
Some scripts require a network (OpenAlex, SoilGrids, MoCo download from Zenodo) and explicit env vars (e.g. EDAPHOS_IV_REAL_STACK=1, EDAPHOS_CORPUS_MAILTO=...). See the script header for details.
Asking for help
- GitHub Discussions: https://github.com/HugoMachadoRodrigues/edaphos/discussions
- Maintainer: rodrigues.machado.hugo@gmail.com (slow async reply expected; tag GitHub for faster turn-around).
