Repository navigation
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
AstronomyErrorcases 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. -
Int32raw values dropped onCelestialBody,LagrangePointID, andRiseSetDirection(#34): Removed: Int32raw-value conformances and addedCaseIterabletoRiseSetDirection. ReplaceCelestialBody(rawValue:)withCelestialBody(name:)or pattern matching.CelestialBodyremainsCodable, now encoding as its stringname(for example"Mars","EMB") and decoding case-insensitively throughCelestialBody(name:)instead of legacy integer codes. -
Typed
RotationMatrix.Axisreplaces integer axes (#34): AddedRotationMatrix.Axis(.x,.y,.z, conforming toSendable,Equatable,Hashable,CaseIterable) and changedRotationMatrix.pivot(axis: Int, angle: Double)toRotationMatrix.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
DeltaTModelreplaces globalAstronomyConfig.setDeltaTModel(_:)(#34): RemovedAstronomyConfig.setDeltaTModel(_:)and all process-global mutable Delta T state. EachAstroTimenow carriespublic 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:)) andAstroTime.now(deltaT:), and propagates it automatically throughaddingDays(_:),addingHours(_:),addingTerrestrialDays(_:), and event/search helpers.Seasons.forYear(_:deltaT:)acceptsdeltaT: DeltaTModel = .observed, andDeltaTModel.deltaT(universalTime:)evaluates Delta T directly.AstroSearch.find(from:to:toleranceSeconds:_:)requiresstartTimeandendTimeto share the samedeltaTModeland throwsAstronomyError.invalidParameterbefore 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'sEquatable,Comparable, andHashableconformances continue to compare and hashuniversalTimeonly, and itsCodablewire format remains a singleDouble(universalTime), decoding withdeltaT: .observed.
Other changes
- Uniform value-type conformances (#34): Added
Sendable,Equatable, andHashableacross 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), plusCaseIterableonDeltaTModelandRiseSetDirection. - Documentation workflow fix (#35): Archived DocC output to
docs.tar.gzbefore 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