-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from nyx-space/4.0.0-dev-gh-237
4.0.0 dev gh 237
- Loading branch information
Showing
40 changed files
with
2,835 additions
and
3,026 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,7 @@ | |
Cargo.lock | ||
.env | ||
.venv | ||
dist/ | ||
dist/ | ||
.venv | ||
src/epoch.rs | ||
.vscode/settings.json |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "hifitime" | ||
version = "4.0.0-dev" | ||
version = "4.0.0-alpha" | ||
authors = ["Christopher Rabotin <[email protected]>"] | ||
description = "Ultra-precise date and time handling in Rust for scientific applications with leap second support" | ||
homepage = "https://nyxspace.com/" | ||
|
@@ -21,7 +21,10 @@ name = "hifitime" | |
serde = { version = "1.0.155", optional = true } | ||
serde_derive = { version = "1.0.155", optional = true } | ||
der = { version = "0.7.8", features = ["derive", "real"], optional = true } | ||
pyo3 = { version = "0.21.1", features = ["extension-module"], optional = true } | ||
pyo3 = { version = "0.21.1", features = [ | ||
"extension-module", | ||
"inventory", | ||
], optional = true } | ||
num-traits = { version = "0.2.15", default-features = false, features = [ | ||
"libm", | ||
] } | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
""" | ||
* Hifitime, part of the Nyx Space tools | ||
* Copyright (C) 2023 Christopher Rabotin <[email protected]> et al. (cf. AUTHORS.md) | ||
* Copyright (C) 2023 Christopher Rabotin <[email protected]> et al. (cf. https://github.com/nyx-space/hifitime/graphs/contributors) | ||
* This Source Code Form is subject to the terms of the Apache | ||
* v. 2.0. If a copy of the Apache License was not distributed with this | ||
* file, You can obtain one at https://www.apache.org/licenses/LICENSE-2.0. | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
""" | ||
* Hifitime, part of the Nyx Space tools | ||
* Copyright (C) 2023 Christopher Rabotin <[email protected]> et al. (cf. AUTHORS.md) | ||
* Copyright (C) 2023 Christopher Rabotin <[email protected]> et al. (cf. https://github.com/nyx-space/hifitime/graphs/contributors) | ||
* This Source Code Form is subject to the terms of the Apache | ||
* v. 2.0. If a copy of the Apache License was not distributed with this | ||
* file, You can obtain one at https://www.apache.org/licenses/LICENSE-2.0. | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Hifitime, part of the Nyx Space tools | ||
* Copyright (C) 2023 Christopher Rabotin <[email protected]> et al. (cf. AUTHORS.md) | ||
* Copyright (C) 2023 Christopher Rabotin <[email protected]> et al. (cf. https://github.com/nyx-space/hifitime/graphs/contributors) | ||
* This Source Code Form is subject to the terms of the Apache | ||
* v. 2.0. If a copy of the Apache License was not distributed with this | ||
* file, You can obtain one at https://www.apache.org/licenses/LICENSE-2.0. | ||
|
@@ -40,14 +40,14 @@ impl<'a> Decode<'a> for Duration { | |
impl Encode for Epoch { | ||
fn encoded_len(&self) -> der::Result<der::Length> { | ||
let ts: u8 = self.time_scale.into(); | ||
ts.encoded_len()? + self.to_duration().encoded_len()? | ||
ts.encoded_len()? + self.duration.encoded_len()? | ||
} | ||
|
||
fn encode(&self, encoder: &mut impl Writer) -> der::Result<()> { | ||
let ts: u8 = self.time_scale.into(); | ||
|
||
ts.encode(encoder)?; | ||
self.to_duration().encode(encoder) | ||
self.duration.encode(encoder) | ||
} | ||
} | ||
|
||
|
@@ -114,7 +114,7 @@ fn test_encdec() { | |
TimeScale::QZSST => epoch.to_qzsst_duration(), | ||
}; | ||
|
||
let e_dur = epoch.to_duration(); | ||
let e_dur = epoch.duration; | ||
|
||
assert_eq!(e_dur, duration, "{ts:?}"); | ||
|
||
|
@@ -126,7 +126,7 @@ fn test_encdec() { | |
let encdec_epoch = Epoch::from_der(&buf).unwrap(); | ||
// Check that the duration in J1900 TAI is the same | ||
assert_eq!( | ||
encdec_epoch.duration_since_j1900_tai, epoch.duration_since_j1900_tai, | ||
encdec_epoch.duration, epoch.duration, | ||
"Decoded epoch incorrect ({ts:?}):\ngot: {encdec_epoch}\nexp: {epoch}", | ||
); | ||
// Check that the time scale used is preserved | ||
|
Oops, something went wrong.