Skip to content

5.0.0

Latest

Choose a tag to compare

@heirloomlogic heirloomlogic released this 27 Nov 18:49
2daed9e

AstronomyKit 5.0.0 is a breaking major release built on the pure Swift 6 engine introduced in 4.3.0. It removes the remaining C-era API artifacts, replaces process-global Delta T state with a value-carried DeltaTModel on AstroTime, standardizes value-type conformances across the public API, and updates all documentation for 5.0.0.

Breaking changes

  • Unreachable AstronomyError cases removed (#34): Removed .notInitialized, .bufferTooSmall, .outOfMemory, and .unknown(Int32). All 12 remaining cases are actively thrown by the Swift engine. Remove switch arms matching the deleted cases.

  • Int32 raw values dropped on CelestialBody, LagrangePointID, and RiseSetDirection (#34): Removed : Int32 raw-value conformances and added CaseIterable to RiseSetDirection. Replace CelestialBody(rawValue:) with CelestialBody(name:) or pattern matching. CelestialBody remains Codable, now encoding as its string name (for example "Mars", "EMB") and decoding case-insensitively through CelestialBody(name:) instead of legacy integer codes.

  • Typed RotationMatrix.Axis replaces integer axes (#34): Added RotationMatrix.Axis (.x, .y, .z, conforming to Sendable, Equatable, Hashable, CaseIterable) and changed RotationMatrix.pivot(axis: Int, angle: Double) to RotationMatrix.pivot(axis: Axis, angle: Double) throws -> RotationMatrix.

    // 4.x
    let r = try RotationMatrix.pivot(axis: 2, angle: 45.0)
    
    // 5.0.0
    let r = try RotationMatrix.pivot(axis: .z, angle: 45.0)
  • Value-carried DeltaTModel replaces global AstronomyConfig.setDeltaTModel(_:) (#34): Removed AstronomyConfig.setDeltaTModel(_:) and all process-global mutable Delta T state. Each AstroTime now carries public let deltaTModel: DeltaTModel (defaulting to .observed) through its initializers (init(_:deltaT:), init(year:month:day:hour:minute:second:deltaT:), init(ut:deltaT:), init(tt:deltaT:)) and AstroTime.now(deltaT:), and propagates it automatically through addingDays(_:), addingHours(_:), addingTerrestrialDays(_:), and event/search helpers. Seasons.forYear(_:deltaT:) accepts deltaT: DeltaTModel = .observed, and DeltaTModel.deltaT(universalTime:) evaluates Delta T directly. AstroSearch.find(from:to:toleranceSeconds:_:) requires startTime and endTime to share the same deltaTModel and throws AstronomyError.invalidParameter before invoking the closure if they differ.

    // 4.x
    AstronomyConfig.setDeltaTModel(.jplHorizons)
    let t = AstroTime(year: 2027, month: 6, day: 21)
    let seasons = try Seasons.forYear(2027)
    
    // 5.0.0
    let t = AstroTime(year: 2027, month: 6, day: 21, deltaT: .jplHorizons)
    let nextDay = t.addingDays(1) // carries .jplHorizons
    let seasons = try Seasons.forYear(2027, deltaT: .jplHorizons)

    AstroTime's Equatable, Comparable, and Hashable conformances continue to compare and hash universalTime only, and its Codable wire format remains a single Double (universalTime), decoding with deltaT: .observed.

Other changes

  • Uniform value-type conformances (#34): Added Sendable, Equatable, and Hashable across all public value structs and enums (DailyEvents, Apsis, Atmosphere, LunarEclipse, GlobalSolarEclipse, EclipseEvent, LocalSolarEclipse, Elongation, Illumination, JupiterMoons, StateVector, Libration, LunarNode, MoonQuarter, HourAngleEvent, RotationMatrix, RotationAxis, Seasons, Transit, DeltaTModel, Refraction, Aberration, EquatorDate, RiseSetDirection, LagrangePointID, CelestialBody, FixedStar), plus CaseIterable on DeltaTModel and RiseSetDirection.
  • Documentation workflow fix (#35): Archived DocC output to docs.tar.gz before artifact upload so operator pages with colons in filenames deploy reliably to GitHub Pages.

AstronomyConfig.ephemerisVersion remains "4.2.1" because calculated solar-system values are bit-identical to 4.3.0 / 4.2.1 (0.000e+00 diff across all benchmark workloads).

Validation: strict Persnicket 2.3.0 formatting, package-size check (1.495 MiB < 2.00 MiB), and DocC build (0 errors, 0 broken links) passed. All 668 tests passed in Debug and Release on macOS and Linux, under Linux ThreadSanitizer, and built cleanly for iOS, tvOS, and watchOS.

Full comparison: 4.3.0...5.0.0