Skip to content

Migrate to qtty 0.8 and tempoch 0.6 with API updates#74

Merged
VPRamon merged 24 commits into
mainfrom
update-deps
May 18, 2026
Merged

Migrate to qtty 0.8 and tempoch 0.6 with API updates#74
VPRamon merged 24 commits into
mainfrom
update-deps

Conversation

@VPRamon
Copy link
Copy Markdown
Member

@VPRamon VPRamon commented May 15, 2026

No description provided.

VPRamon added 2 commits May 15, 2026 11:08
    - Bump qtty 0.7 → 0.8 and tempoch 0.4 → 0.5 (with tempoch-ffi) in all Cargo.tomls
    - Add [patch.crates-io] pointing to local tempoch 0.5 path
    - Update API usage throughout:
      - EncodedTime::new(f64) → from_raw_unchecked(qtty::Day::new(f64))
      - .jd_value()/.mjd_value() → .raw().value()
      - EncodedTime arithmetic (±Quantity, subtraction) → raw-value operations
      - .julian_millennias() → manual (raw - 2451545) / 365250 formula
      - RepresentationForScale → FormatForScale
      - InfallibleRepresentationForScale → InfallibleFormatForScale
      - J2000_TT → J2000 const from raw value
    - Add JD, MJD, JulianDate/ModifiedJulianDate generic aliases to time.rs
    - Add UT1 re-export to time.rs
- Updated tests to replace direct usage of JulianDate and ModifiedJulianDate constructors with tempoch's Time conversions.
- Changed instances of `ModifiedJulianDate::new` to `ModifiedJulianDate::from_raw_unchecked` for consistency.
- Adjusted assertions to compare raw values instead of MJD values directly.
- Introduced a new file for quick pattern verification of date handling methods.
@VPRamon VPRamon self-assigned this May 15, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

Code Coverage

Package Line Rate Complexity Health
src.targets 99% 0
src 93% 0
src.astro 86% 0
src.calculus.math_core 96% 0
src.coordinates.transform.centers 100% 0
src.calculus.altitude 93% 0
src.atmosphere 97% 0
src.calculus.lunar 94% 0
src.calculus.solar 97% 0
src.coordinates.observation 97% 0
src.provenance 73% 0
src.coordinates.transform 95% 0
src.coordinates 98% 0
src.coordinates.transform.frames 95% 0
src.calculus.azimuth 90% 0
src.astro.nutation 95% 0
src.geometry 96% 0
src.tables 92% 0
src.bodies 85% 0
src.calculus 95% 0
src.calculus.elp2000 99% 0
src.calculus.vsop87 100% 0
src.spectra 80% 0
src.coordinates.transform.providers 95% 0
src.data 89% 0
src.calculus.ephemeris 69% 0
src.calculus.kepler_equations 92% 0
src.coordinates.transform.centers.position 77% 0
src.calculus.stellar 93% 0
src.qtty 100% 0
src.calculus.jpl 93% 0
src.spectra.loaders 100% 0
src.spectra.passbands 99% 0
src.observatories 100% 0
Summary 92% (16262 / 17607) 0

VPRamon added 16 commits May 16, 2026 18:14
…e::jd functions

- Updated instances of `ModifiedJulianDate::from_raw_unchecked` to `crate::time::mjd` for consistency and clarity.
- Replaced `JulianDate::from_raw_unchecked` with `crate::time::jd` in multiple locations to improve code readability and maintainability.
- Ensured all time-related calculations utilize the new time handling functions for better error handling and type safety.
- Updated the `tempoch` dependency to version 0.5.1 in `Cargo.toml` and `Cargo.lock`.
- Refactored date arithmetic in various benchmarks and examples to use the `+=` operator instead of creating new instances with `from_raw_unchecked`.
- Improved clarity in comments regarding time conversions between UTC, TT, and MJD.
- Adjusted the handling of `ModifiedJulianDate` and `Period<ModifiedJulianDate>` to ensure consistency across the codebase.
- Enhanced the readability of the code by simplifying expressions and removing unnecessary intermediate variables.
…itialization

- Updated multiple test files to replace `JulianDate::from_raw_unchecked` with `JulianDate::try_new` for improved safety and error handling.
- Replaced instances of `JulianDate::J2000` with `siderust::time::J2000` for consistency across tests.
- Ensured that all relevant tests now utilize the updated JulianDate initialization method.
…jd` with `JulianDate`

- Updated instances of `crate::time::mjd` to `crate::time::ModifiedJulianDate` across multiple modules to ensure consistency in date handling.
- Replaced `crate::time::jd` with `crate::time::JulianDate` where applicable.
- Adjusted related calculations to use the new constructors for `ModifiedJulianDate` and `JulianDate`.
- Removed deprecated `jd` and `mjd` functions that were previously used for creating Julian and Modified Julian Dates.
- Ensured all tests and references to time-related functions are updated to reflect these changes.
- Added conditional module `dynamics` for satellite feature in `lib.rs`.
- Simplified `jd_ut1` method in `eop.rs` by removing unnecessary line breaks.
- Reformatted multiple instances of `JulianDate::new` calls in `proper_motion.rs`, `solar_system.rs`, and other files for consistency.
- Consolidated assertions in tests to single lines where applicable for clarity.
- Enhanced readability in `moon_cache.rs`, `moon_equations.rs`, and other files by adjusting line breaks and indentation.
- Ensured consistent formatting across various modules to adhere to style guidelines.
@VPRamon VPRamon changed the title Migrate to qtty 0.8 and tempoch 0.5 with API updates Migrate to qtty 0.8 and tempoch 0.6 with API updates May 18, 2026
@VPRamon VPRamon merged commit 752677f into main May 18, 2026
6 checks passed
@VPRamon VPRamon deleted the update-deps branch May 18, 2026 18:08
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