Thank you for considering a contribution to symcompR. The package ports SymPy to R, so a change is judged on two things: whether the R code is sound, and whether it gives the answer SymPy gives.
Before You Start
- Use GitHub issues for bug reports, feature requests, documentation gaps, and questions about porting a SymPy module.
- For larger changes, such as porting a new module, open an issue first so the design can be discussed before implementation.
- Keep pull requests focused. A new module, a bug fix, and a refactor should usually be separate pull requests.
Reporting a Wrong Answer
A wrong result is the most valuable bug report. Please include:
- the R input that produces it,
- what symcompR returns,
- what SymPy returns for the same input, if you can run it,
-
sessionInfo().
Development Setup
Install the development dependencies from the repository root:
install.packages(c("remotes", "testthat", "devtools", "roxygen2"))
remotes::install_deps(dependencies = TRUE)symcompR has no compiled code, so no C or C++ toolchain is needed.
Porting Rules
- Follow the SymPy source at the pinned commit recorded in
inst/COPYRIGHTS. Port the algorithm, not just the output of one example. - Take expected values in tests from SymPy itself, run on the same input. Do not write an expected value by hand when SymPy can produce it.
- Attaching the package must not mask any base R function. A SymPy name that clashes with base R gets a
sym_prefix, or an S3 method when base R has a generic. The test intests/testthat/test-aliases.Renforces this. - Keep R code ASCII only; write other characters as
\uescapes. - Use exact arithmetic (
gmpbig integers and rationals) wherever SymPy is exact. Never round through doubles in an exact code path. - Keep roxygen tags directly above the function they document; a helper placed between them takes over the export and the help page.
Branches and Pull Requests
- Use one branch per logical change, named after the change (
port-fu-trigsimp,fix-range-intersection). - Write commit subjects in the imperative (“Port the Fu trigonometric simplification routines”).
- Keep the implementation, its tests, the roxygen source, the regenerated documentation, and the
NEWS.mdbullet together in the same pull request.
Code Style
- Follow the style already used in the surrounding R files.
- Prefer clear validation and explicit errors over silent coercion.
- Do not add new package dependencies unless they are necessary and justified.
- Regenerate the
.Rdfiles withdevtools::document()after changing roxygen comments.
Pull Request Checklist
Before opening a pull request, confirm:
- Tests relevant to the change pass, with expected values from SymPy.
- No base R function is masked.
- Documentation is updated.
-
NEWS.mdhas an entry for user-facing changes. - No generated build artifacts, local caches,
.Rcheckdirectories, or tarballs are committed.
Code of Conduct
All contributors are expected to follow the project Code of Conduct.