Skip to content

feat: add exact-duration operations and time series iterator#11

Merged
VPRamon merged 10 commits into
mainfrom
int-duration
May 28, 2026
Merged

feat: add exact-duration operations and time series iterator#11
VPRamon merged 10 commits into
mainfrom
int-duration

Conversation

@VPRamon

@VPRamon VPRamon commented May 27, 2026

Copy link
Copy Markdown
Member
  • 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 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.

- 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.
@VPRamon VPRamon self-assigned this May 27, 2026
VPRamon added 3 commits May 27, 2026 23:20
…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.
@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Complexity Health
tempoch-core.src.period 95% 0
tempoch-core.src.data 88% 0
tempoch-core.src.format 94% 0
tempoch-core.src 100% 0
tempoch-core.src.data.runtime_data 93% 0
tempoch-core.src.model 90% 0
tempoch-core.src.model.scale 92% 0
tempoch-core.src.features 99% 0
tempoch-ffi.src 85% 0
tempoch-core.src.foundation 98% 0
tempoch-core.src.earth 97% 0
tempoch-core.src.encoding 100% 0
Summary 92% (5821 / 6355) 0

@VPRamon VPRamon merged commit 3e4557b into main May 28, 2026
5 checks passed
@VPRamon VPRamon deleted the int-duration branch May 28, 2026 19:42
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