Skip to content

Commit 1636c04

Browse files
icweaverclaude
andauthored
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Project.toml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name = "SOFA"
22
uuid = "ad3d3fd0-b5f2-51ee-b274-8cdbe62317e2"
3-
authors = ["Duncan Eddy <duncan.eddy@gmail.com>"]
4-
version = "1.1.1"
3+
authors = ["Duncan Eddy <duncan.eddy@gmail.com>", "Paul Barrett <pebarrett@gmail.com>"]
4+
version = "2.0.0"
55

66
[workspace]
77
projects = ["test", "docs"]
88

99
[deps]
10-
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
11-
SOFA_jll = "d1004450-2f34-5761-9671-ec24e6a6fe03"
10+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1211
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
12+
StaticUnivariatePolynomials = "6f584044-cad5-5b68-a429-1e244a824f76"
1313

1414
[compat]
15-
Libdl = "1"
16-
StaticArrays = "^1.0.1"
17-
SOFA_jll = "2019.7.22"
18-
julia = "1.10.0"
15+
LinearAlgebra = "1"
16+
StaticArrays = "1.9"
17+
StaticUnivariatePolynomials = "0.6"
18+
julia = "1.10"

‎README.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
99
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
1010

11-
Unofficial wrapper of the IAU SOFA C libraries for fundamental astronomy. See the [Astrometry.jl > SOFA](https://juliaastro.org/Astrometry/stable/SOFA/) sub-package for the pure Julia implementation.
11+
A pure Julia implementation of the IAU SOFA library for fundamental astronomy. For the wrapper of the SOFA C library, see the v1.x releases maintained on the `release-1.x` branches.
1212

1313
## Description
1414

15-
The purpose of this package is to wrap the SOFA C library of fundamental astonomical function to make it easily accessible in Julia. This package serves as a _wrapper_ only. All functions ultimately call the original, unmodified, SOFA C library functions which are compiled as part of the package build process.
15+
This package provides a pure Julia implementation of the SOFA library of fundamental astronomical functions, originally developed by Paul Barrett as the `SOFA` submodule of [Astrometry.jl](https://github.com/JuliaAstro/Astrometry.jl). No compiled C library is required.
1616

17-
The full SOFA C test suite is reproduced as part of the package to
18-
prove compliance and reproducibility of the core SOFA C functionality.
17+
The SOFA C test suite is reproduced as part of the package to
18+
prove compliance and reproducibility of the core SOFA functionality.
1919

2020
## Package Version <-> SOFA Release Correspondence
2121

@@ -35,8 +35,12 @@ The planned package versions below correspond to the following releases of the S
3535
## Notes
3636

3737
1. All computed values are returned by the function call. No values are returned by reference.
38-
2. Wrappers for _iauAtciqn_, _iauAticqn_, and _iauLdn_ do not currently work properly.
38+
2. As of v2.0, function names follow the SOFA names without the `iau` prefix (e.g. `cal2jd` instead of `iauCal2jd`).
3939

4040
## Compliance with SOFA License
4141

4242
This distribution is permitted and compliant with the SOFA license. See the LICENSE for details.
43+
44+
This package is derived from, but is not an official product of, the International
45+
Astronomical Union SOFA collection (http://www.iausofa.org), and is not endorsed
46+
by the IAU SOFA Board.

‎docs/src/index.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SOFA.jl Documentation
22

3-
This module provides a Julia wrapper for International Astronomical Union Standards
4-
of Fundamental Astronomy [SOFA](https://www.iausofa.org/) module.
3+
This module provides a pure Julia implementation of the International Astronomical
4+
Union Standards of Fundamental Astronomy [SOFA](https://www.iausofa.org/) library.

0 commit comments

Comments
 (0)