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/pilarN.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/pilar*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:
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/pilarN_*.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/pilar2-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_6pilar.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).
