Skip to content

Add testthat coverage and package guidance - #5

Merged
asgr merged 3 commits into
masterfrom
copilot/create-useful-unit-tests
Nov 6, 2026
Merged

asgr merged 3 commits into
masterfrom
copilot/create-useful-unit-tests

Conversation

Copilot AI commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Add useful unit tests for core astronomical conversions and calculations, configure CI to install and run testthat, and document package testing and contribution conventions.

  • Tests: Cover coordinate conversions, spherical transforms, sky area, coordinate matching, and cosmological distances, including validation and boundary cases.
  • Package and CI: Add testthat to Suggests, select edition 3, and ensure CI installs check dependencies.
  • Contributor guidance: Add AGENTS.md with package structure, test commands, and change conventions.

Copilot AI and others added 2 commits October 31, 2026 06:34
Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Copilot AI requested a review from asgr November 6, 2026 04:15
@asgr
asgr marked this pull request as ready for review November 6, 2026 05:29
Copilot AI balanced review requested due to automatic review settings November 6, 2026 05:29
@asgr
asgr merged commit eb7149f into master Nov 6, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The RA=0 round-trip assertion may wrap to 360, so its 1e-10 tolerance needs validation across the R/testthat CI matrix because R was unavailable for runtime verification.

No open issues 🎉

What changed in this PR

Adds automated test coverage for celestial’s core astronomical utilities, integrates testthat into package checks, and documents contributor conventions.

Changes:

  • Add deterministic tests for coordinate conversions, matching, spherical transforms, sky area, and cosmological distances.
  • Configure testthat edition 3 and CI check dependencies.
  • Document package structure, testing commands, and contribution guidance.
File Description
tests/​testthat/​test-spherical-coordinates.R Test spherical/Cartesian and equatorial/galactic round trips.
tests/​testthat/​test-sky-area.R Test full-sky area, unit conversions, and invalid inputs.
tests/​testthat/​test-cosmology.R Test distance identities, ordering, and redshift validation.
tests/​testthat/​test-coordinate-matching.R Test matching, separation units, nearest sources, and linked groups.
tests/​testthat/​test-coordinate-conversions.R Test degree/DMS/HMS conversions and domain validation.
tests/​testthat.R Add the package testthat entry point.
DESCRIPTION Declare testthat and select edition 3.
AGENTS.md Document testing and contribution conventions.
.github/​workflows/​main.yml Configure CI to install testthat and check dependencies.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants