feat: add exact-duration operations and time series iterator#11
Merged
Conversation
- Implemented exact-precision duration calculations in the Time<S, F> struct, including methods for calculating differences, adding, and subtracting exact durations. - Introduced rounding methods (round_to_epoch, floor_to_epoch, ceil_to_epoch) for time instants. - Added TimeSeries struct for generating uniform sequences of Time<S> over a specified range with exact-duration steps. - Included error handling for TimeSeries creation, ensuring valid ranges and step sizes. - Created property tests for ExactDuration and time conversions, verifying invariants and round-trip preservation across different time scales. - Established a validation crate for cross-referencing GNSS ICD reference points and ensuring accuracy in time conversions.
…tion, and TimeSeries - ExactDuration serde Serialize now returns an error instead of silently saturating when the value exceeds i64 seconds range. - ExactDuration::from_quantity panics consistently in all build profiles on non-finite or overflowing input (was a debug_assert only before). - round_to/floor_to/ceil_to use saturating arithmetic for overflow safety. - add_exact/sub_exact/diff_exact docs clarify the ~120–150 ns ULP error near J2000 ± 50 years; they are not sub-nanosecond exact. - RFC 3339 parser validates :60 leap seconds against the UTC-TAI table; invalid leap-second dates return ConversionError::InvalidLeapSecond. - RFC 3339 formatter render_with_digits carries rounding overflow into the seconds field correctly. - GNSS epoch unit tests assert exact (week=0, sow=0, ns=0). - GNSS validation CSV tests parse the utc_iso column and verify full week numbers at rollover boundaries; sow=0 is not asserted because GPS week boundaries do not align with UTC midnight. - TimeSeries length calculation guards against u64 overflow before cast.
- Enhanced RFC 3339 parsing to reject invalid fractional seconds and added strict validation for sub-second precision. - Improved leap second handling in time formatting, ensuring correct representation during leap seconds. - Introduced new methods for ExactDuration to enforce canonical forms and handle overflow cases more gracefully. - Updated time arithmetic methods to maintain precision and handle edge cases, particularly around sub-second durations. - Revised documentation to clarify the behavior of new and existing methods, including error handling and expected ranges. - Added comprehensive tests to validate new functionality and ensure robustness against edge cases.
Contributor
|
…nds, and subseconds
…r Cargo.toml and Cargo.lock feat: enhance GnssWeek and ExactDuration with new typed constructors and accessors fix: improve error handling in time formatting and duration calculations
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.
over a specified range with exact-duration steps.