Breaking API cleanup (0.21): typed sgp4 error, time(scale=), lambert::Error - #123
Merged
Conversation
Move the SGP4Error enum (and its i32 conversions) from sgp4::sgp4_impl into sgp4::error, and change Error::SatRecInit(i32) to Error::SatRecInit(SGP4Error). The raw Vallado init error code is mapped to the corresponding SGP4Error variant at construction. SGP4Error stays re-exported at satkit::sgp4::SGP4Error, so the public path is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a `scale=` keyword to the `satkit.time(...)` constructor so Gregorian date/time components can be interpreted in an explicit time scale (default UTC), mirroring `time.from_mjd(..., scale=)` / `time.from_jd(..., scale=)`. Backed by a new scale-aware core constructor `Instant::from_datetime_with_scale`, which delegates to `from_datetime` for UTC (preserving exact leap-second behavior) and to `from_mjd_with_scale` for the uniform time scales. Purely additive: calls without `scale` are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The last per-module error enum that missed the thiserror-era `module::Error` convention (PRs #83-#86). Rename the enum to `Error`, add a `lambert::Result<T>` alias, and keep a `#[deprecated]` type alias `LambertError = Error` so downstream code still compiles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The breaking / pre-1.0 API cleanup batch, kept separate from the non-breaking polish in #122 (this PR is stacked on
ci-stubtest; retarget tomainonce #122 merges). These are the items worth inflicting on downstream exactly once.Breaking
sgp4::Error::SatRecInit(i32)→SatRecInit(SGP4Error)— the raw Vallado init code is mapped to the typed variant (eccentricity, mean motion, perturbed eccentricity, semi-latus rectum, orbit decay) at construction, soDisplayis now descriptive.SGP4Errormoved fromsgp4::sgp4_impltosgp4::error; still re-exported atsatkit::sgp4::SGP4Error, so the public path is unchanged.LambertError→lambert::Error— matches themodule::Errorconvention used everywhere else (the last straggler from the thiserror migration). The old name stays as a#[deprecated]type alias, so downstream compiles with a warning; also addedlambert::Result<T>.Added (non-breaking)
scale=keyword ontime(...)— Gregorian components can be interpreted in an explicit time scale, e.g.satkit.time(2020, 1, 1, scale=satkit.timescale.TAI), mirroringtime.from_mjd(..., scale=...). Defaults to UTC, so all existing calls are unchanged. Backed by a new coreInstant::from_datetime_with_scale.Deliberately dropped
Stringmatches the wire; the typed-field win didn't justify the deserializer + Python-dict-contract work.Validation
Verified UTC−TAI = 37.0 s / UTC−GPS = 18.0 s for the
scale=path; no-scale calls unchanged. 206 Rust tests, 114 Python tests, clippy-D warnings,cargo fmt --check, andmypy.stubtestall clean on the integrated branch.🤖 Generated with Claude Code