Thank you for your interest in contributing to nabla! This document describes how to report bugs, propose changes, and submit pull requests.
Open an issue at https://github.com/queelius/nabla/issues with:
- A minimal reproducible example
- Expected vs actual output
sessionInfo()output
For feature requests or design discussions, open an issue first so we can align on the approach before you invest time coding.
- Fork the repo and create a feature branch from
main. - Follow the existing coding conventions (see below).
- Add tests for new functionality in
tests/testthat/. - Run
devtools::test()andR CMD check --as-cranbefore submitting. - Update documentation if you change any exported functions:
roxygen2::roxygenise(). - Keep PRs focused — one logical change per PR.
- S4 classes and methods for all dual number types and operators.
- Arithmetic operators (
+,-,*,/,^) and hot-path math (exp,sqrt,log) have direct S4 methods; everything else uses group generics (Ops,Math,Math2,Summary). - Internal helpers are prefixed with
.(e.g.,.dual(),.as_dual()). - Test files mirror source files:
R/dual-math.Ris tested bytests/testthat/test-math.R.
nabla uses testthat edition 3. The standard verification pattern is:
- Compute the derivative via AD (dual numbers)
- Compare against the analytical formula
- Compare against numerical finite differences (
central_difference()fromtests/testthat/helper-numerical.R)
devtools::test() # run all tests
testthat::test_file("tests/testthat/test-math.R") # run one file
covr::package_coverage() # check coveragePlease note that nabla is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.