Repository navigation
Commit 1636c04
Migrate pure-Julia SOFA implementation from Astrometry.jl (v2.0) (#38)
## Summary
Replaces the `SOFA_jll`-based C wrapper on `main` with the **pure Julia
implementation of SOFA release 19 (2023-10-11)**, migrated from the
`Astrometry.SOFA` submodule of
[Astrometry.jl](https://github.com/JuliaAstro/Astrometry.jl) (at
`b5780028`), originally developed by Paul Barrett (@barrettp). This
begins the v2.0 line; the v1.x C-wrapper releases remain maintained on
their `release-1.x` branches.
## Commit structure
1. **`c189472` — pristine migration.** The implementation as it exists
in Astrometry.jl, copied with minimal adaptation. Reviewers can diff
this commit against upstream directly.
2. **`573a121` — case-collision fix.** `src/sofa.jl` →
`src/sofa_base.jl`: the original name collides with the `src/SOFA.jl`
entry point on case-insensitive filesystems (macOS/Windows), which broke
checkout/precompile on those CI runners.
3. **`6240bee` — layout refactor.** All moves are `git mv` renames, load
order unchanged:
- the 15 topical files move from the vestigial `src/SOFA/` nesting up to
`src/`
- the 11 `constants*.jl` files are collected into a new `src/constants/`
directory (filenames unchanged)
- `src/sofa_base.jl` → `src/base.jl`, with its include list moved into
`src/SOFA.jl` so the module file owns the file tree; `base.jl` now holds
only the shared types, leap-second table, and ephemeris helpers
## What moved
- ~23.5k lines: 15 topical implementation files, 11 `constants*.jl`
files, `util.jl`, `ephemerisDE405.jl`, and the shared types/leap-second
table — replacing all 245 C-wrapper files
- `test/sofatests.jl` — the SOFA validation suite (401 tests), replacing
the C-wrapper `test_sofa.jl`
- New top-level `module SOFA` (promoted from the nested Astrometry
submodule), same export surface
## Final layout
```
src/
SOFA.jl # module: docstring, exports, usings, full include list
base.jl # shared types, leap-second table, ephemeris helpers (was sofa_base.jl)
util.jl
ephemerisDE405.jl
constants/ # the 11 constants*.jl files, names unchanged
astrometry.jl, calendars.jl, … vectorops.jl # 15 topical files
```
## Adaptations during the port
- Inlined `ephem_position`/`ephem_velocity` (from Astrometry's
`model2000.jl`) into `base.jl`, removing the only parent-module
dependency
- Fixed two upstream export typos caught by the export check: `po6e` →
`p06e`, `f2wxy` → `fw2xy`
- `Project.toml`: drop `SOFA_jll`/`Libdl`, add `LinearAlgebra` +
`StaticUnivariatePolynomials`; `version = "2.0.0-DEV"`; Paul Barrett
added to authors
- README/docs updated for the pure-Julia description, with SOFA-license
derived-work acknowledgment
## Breaking changes (v2.0)
- Routine names drop the `iau` prefix: `iauCal2jd` → `cal2jd`, etc.
- No binary dependency; results are computed in native Julia
## Validation
- `Pkg.test()` locally (Julia 1.12.6, linux): **401/401 pass**,
re-verified after each of the three commits
- `Aqua.test_all(SOFA, ambiguities=false)`: all checks pass (incl.
undefined exports, stale deps, compat bounds)
- `docs/make.jl`: builds clean (sofa.md page 626 KiB, under the
configured 800 KiB threshold)
- First CI push: linux/Aqua/Documentation green; macOS/Windows failed on
the case collision addressed by `573a121`
- Note: codecov/patch may stay noisy on a whole-package replacement; not
a correctness signal
## Follow-up
- Drop SOFA from Astrometry.jl
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent d980710 commit 1636c04
281 files changed
Lines changed: 25298 additions & 23133 deletions
File tree
- docs/src
- src
- constants
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
0 commit comments