Repository navigation
Add testthat coverage and package guidance - #5
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🔵 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add useful unit tests for core astronomical conversions and calculations, configure CI to install and run testthat, and document package testing and contribution conventions.
Suggests, select edition 3, and ensure CI installs check dependencies.AGENTS.mdwith package structure, test commands, and change conventions.