Skip to content

Add dedicated spec for ChebyshevType2 shared evaluation#84

Merged
rhannequin merged 1 commit into
mainfrom
chebyshev-type2-spec
Jun 22, 2026
Merged

Add dedicated spec for ChebyshevType2 shared evaluation#84
rhannequin merged 1 commit into
mainfrom
chebyshev-type2-spec

Conversation

@rhannequin

Copy link
Copy Markdown
Owner

ChebyshevType2 is the type-2 Chebyshev machinery shared by SPK and PCK
segments. It was only exercised indirectly through the higher-level SPK and
PCK specs, so this adds a dedicated spec covering its own behaviour:

  • time conversion (time_to_seconds, convert_to_seconds)
  • interval binary search, inclusive bounds, caching, and out-of-range
    handling (find_interval, time_in_interval?, compute_normalized_time)
  • record reshaping into [segment][term][component] (process_coefficient_data)
  • that the fused single-pass generate_single returns a position and
    velocity identical to the standalone evaluate / evaluate_derivative
    the "bit-for-bit identical" property the single-pass optimisation relies on

Also corrects the evaluate_derivative docstring: radius is in seconds
and the result is per day (the sibling evaluate_with_derivative already
documents it correctly).

🤖 Generated with Claude Code

Cover the type-2 Chebyshev machinery shared by SPK and PCK segments
directly: time conversion, interval binary search and caching, record
reshaping, and that the fused single-pass generate_single matches the
standalone evaluate / evaluate_derivative results. Also correct the
evaluate_derivative docstring (radius is in seconds; result is per day).
@rhannequin rhannequin merged commit e208b5d into main Jun 22, 2026
57 checks passed
@rhannequin rhannequin deleted the chebyshev-type2-spec branch June 22, 2026 22:23
@rhannequin rhannequin mentioned this pull request Jun 22, 2026
rhannequin added a commit that referenced this pull request Jun 22, 2026
## [0.5.0] - 2026-06-23

### Features

- Read binary PCK (`DAF/PCK`) orientation kernels via `Ephem::PCK`, exposing a
  body's Euler angles and rates over time (`angles_at`, `orientation_at`), the
  foundation for DE440-grade lunar libration ([#76], [#80])
- Add `Ephem::Core::Orientation` (Euler angles + optional rates) and
  `Ephem::Core::Rotation` (kernel-agnostic rotation-matrix helpers), plus
  `Orientation#to_matrix` / `OrientationSegment#matrix_at` for the built-in
  3-1-3 (Z-X-Z) reference→body convention
- Excerpt and the `excerpt` CLI now support binary PCK kernels, detecting the
  kernel kind automatically
- Download binary PCK lunar orientation kernels from NAIF via `Ephem::Download`
- Add `#inspect` and `#to_s` to `State` for easier debugging ([#67])

### Improvements

- Route queries to the covering segment when a body/pair spans multiple
  time-split segments (SPK and PCK), with no overhead for single-segment keys
- Share the type-2 Chebyshev machinery between SPK and PCK segments
- Evaluate position and velocity in a single Chebyshev pass
  (`ChebyshevPolynomial.evaluate_with_derivative`), speeding up every state /
  orientation query (`compute_and_differentiate`, `state_at`, `orientation_at`)
  with bit-for-bit identical results
- Correct the documented velocity unit to km/day (the actual, validated value)
- Remove the `numo-narray` dependency ([#65])
- Skip derivative evaluation in `Segment#compute` ([#57])
- Hoist loop-invariant `t2` computation in Chebyshev evaluation ([#58])
- Cache the `RecordParser` instance in `SummaryManager` ([#63])
- Eliminate a redundant `read_record` call in `SummaryManager` ([#62])
- Replace duplicated endianness format lookups with shared constants ([#64])
- Replace `instance_variable_get` with proper `attr_reader`s in `Excerpt`
  ([#66])
- Use separate error margins for position and velocity validation ([#61])
- Add a comprehensive benchmark suite ([#68])
- Upgrade default Ruby to 4.0.5 ([#81])
- Match SPICE last-loaded-wins precedence for overlapping segments ([#83])
- Add a dedicated spec for the shared type-2 Chebyshev evaluation ([#84])
- Bump standard from 1.50.0 to 1.55.0 by @dependabot ([#45], [#46], [#56],
  [#78])
- Bump actions/checkout from 4 to 7 by @dependabot ([#44], [#52], [#79])
- Bump rake from 13.3.0 to 13.4.2 by @dependabot ([#48], [#73])
- Bump zlib from 3.2.1 to 3.2.3 by @dependabot ([#49], [#70])
- Bump rspec from 3.13.1 to 3.13.2 by @dependabot ([#47])
- Bump parallel from 1.27.0 to 1.28.0 by @dependabot ([#71])
- Bump benchmark-ips from 2.14.0 to 2.15.1 by @dependabot ([#75])
- Bump json from 2.18.1 to 2.19.2 by @dependabot ([#77])

### Bug fixes

- Fix `compute_and_differentiate` returning mismatched velocities for an array
  of times
- Fix precision loss in `time_to_seconds` for dates far from J2000 ([#60])

[#44]: #44
[#45]: #45
[#46]: #46
[#47]: #47
[#48]: #48
[#49]: #49
[#52]: #52
[#56]: #56
[#57]: #57
[#58]: #58
[#60]: #60
[#61]: #61
[#62]: #62
[#63]: #63
[#64]: #64
[#65]: #65
[#66]: #66
[#67]: #67
[#68]: #68
[#70]: #70
[#71]: #71
[#73]: #73
[#75]: #75
[#76]: #76
[#77]: #77
[#78]: #78
[#79]: #79
[#80]: #80
[#81]: #81
[#83]: #83
[#84]: #84

**Full Changelog**: v0.4.1...v0.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant