Contributing to OEIS.R
Source:CONTRIBUTING.md
Thanks for considering a contribution! OEIS.R is a small R package, and contributions of any size — bug reports, documentation fixes, new accessor functions, or bigger changes — are welcome.
Before you start
Please open an issue first for anything beyond a small fix (typos, obvious bugs), so we can agree on the approach before you invest time in it.
A note on how this package works
OEIS.R gets its data by talking to https://oeis.org/ directly: the fmt=text search endpoint for most sequence fields, and the sequence’s HTML page for a few fields that aren’t in the text export (cross-reference context, adjacent sequences). There are no fixtures or mocks — the test suite runs against the live site.
This has one important consequence: OEIS occasionally changes its page markup or text format, and when it does, this package can silently or loudly break even though no line of R code changed. If you’re fixing a bug, it’s worth checking with curl or xml2::read_html() what the current live page/response actually looks like rather than assuming the existing parsing logic is still correct — a past example (fixed in v0.2.0) was a full CSS/HTML redesign of the sequence page that broke every function scraping it.
Development setup
# install.packages("devtools")
devtools::install_deps(dependencies = TRUE)Key dependencies you’ll want available: roxygen2 (documentation), testthat (tests), and devtools.
Making changes
Fork and branch from
master.Write/update code in
R/. Each exported function generally follows the same S3 dispatch pattern used throughout the package: a generic plus methods forcharacter,OEIS_ID,OEIS_internal,OEIS_xml, andOEIS_sequenceinputs (see e.g.R/OEIS_description.Rfor a compact example). New functions should follow this convention unless there’s a good reason not to.-
Document with roxygen2 — do not hand-edit files in
man/orNAMESPACE; they’re generated. After changing roxygen comments, run:devtools::document() Add or update tests in
tests/testthat/. Since tests hit the live OEIS site, prefer sequence IDs that are unlikely to change (old, well-established sequences) and keep the network calls minimal.-
Run the test suite:
devtools::test() -
Run a full check before opening a PR:
devtools::check()
Style
- Follow the existing style in the file you’re editing rather than introducing a new one. Notably, this codebase consistently uses the
magrittr%>%pipe rather than the base R|>pipe — stick with%>%in package code. - Keep roxygen documentation (
@param,@return,@examples,@seealso) up to date with any signature or behavior changes. - Prefer small, focused pull requests over large ones that mix unrelated changes.
Submitting a pull request
- Describe what changed and why, and reference any related issue.
- Make sure
devtools::test()anddevtools::check()pass locally. - Update
NEWS.mdwith a short bullet describing the change.
Reporting bugs
Please include: the OEIS sequence ID you used (if applicable), the code you ran, the actual output/error, and what you expected instead. If you suspect OEIS changed something server-side, a link to the relevant page or a snippet of the raw response is very helpful.
License
By contributing, you agree that your contributions will be licensed under the same MIT License that covers the rest of the project.