Skip to content

Commit b35176e

Browse files
Merge pull request #502 from nyx-space/feat/mars-frame
Feat/mars frame
2 parents eeee31f + 74ecc7e commit b35176e

File tree

19 files changed

+76
-69
lines changed

19 files changed

+76
-69
lines changed

.github/workflows/python.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114

115115
- uses: actions/setup-python@v5
116116
with:
117-
python-version: "3.11"
117+
python-version: "3.12"
118118
architecture: ${{ matrix.target }}
119119

120120
- name: Build wheels
@@ -150,7 +150,7 @@ jobs:
150150

151151
- uses: actions/setup-python@v5
152152
with:
153-
python-version: "3.11"
153+
python-version: "3.12"
154154

155155
- name: Build wheels
156156
uses: PyO3/maturin-action@v1
@@ -185,7 +185,7 @@ jobs:
185185

186186
- uses: actions/setup-python@v5
187187
with:
188-
python-version: "3.11"
188+
python-version: "3.12"
189189

190190
- name: Build wheels
191191
uses: PyO3/maturin-action@v1
@@ -220,7 +220,7 @@ jobs:
220220

221221
- uses: actions/setup-python@v5
222222
with:
223-
python-version: "3.11"
223+
python-version: "3.12"
224224

225225
- name: Build wheels
226226
uses: PyO3/maturin-action@v1

.github/workflows/rust.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ jobs:
136136
run: cargo test validate_gh_283_multi_barycenter_and_los --release --workspace --exclude anise-gui --exclude anise-py -- --nocapture --include-ignored
137137

138138
- name: Rust-SPICE JPL DE validation
139-
run: RUST_BACKTRACE=1 cargo test validate_jplde --features spkezr_validation --release --workspace --exclude anise-gui --exclude anise-py -- --nocapture --include-ignored --test-threads 1
139+
run: RUST_BACKTRACE=1 cargo test validate_jplde --features validation --release --workspace --exclude anise-gui --exclude anise-py -- --nocapture --include-ignored --test-threads 1
140140

141141
- name: Rust-SPICE hermite validation
142-
run: RUST_BACKTRACE=1 cargo test validate_hermite_type13_ --features spkezr_validation --release --workspace --exclude anise-gui --exclude anise-py -- --nocapture --include-ignored --test-threads 1
142+
run: RUST_BACKTRACE=1 cargo test validate_hermite_type13_ --features validation --release --workspace --exclude anise-gui --exclude anise-py -- --nocapture --include-ignored --test-threads 1
143143

144144
- name: Rust-SPICE Lagrange validation
145145
env:
146146
LAGRANGE_BSP: gmat-lagrange.bsp
147-
run: RUST_BACKTRACE=1 cargo test validate_lagrange_type9_with_varying_segment_sizes --features spkezr_validation --release --workspace --exclude anise-gui --exclude anise-py -- --nocapture --include-ignored --test-threads 1
147+
run: RUST_BACKTRACE=1 cargo test validate_lagrange_type9_with_varying_segment_sizes --features validation --release --workspace --exclude anise-gui --exclude anise-py -- --nocapture --include-ignored --test-threads 1
148148

149149
- name: Rust-SPICE PCK validation
150150
run: RUST_BACKTRACE=1 cargo test validate_iau_rotation_to_parent --release --workspace --exclude anise-gui --exclude anise-py -- --nocapture --ignored
@@ -219,11 +219,11 @@ jobs:
219219
cargo llvm-cov test --no-report validate_gh_283_multi_barycenter_and_los -- --nocapture --ignored
220220
cargo llvm-cov test --no-report validate_iau_rotation_to_parent -- --nocapture --ignored
221221
cargo llvm-cov test --no-report validate_bpc_to_iau_rotations -- --nocapture --ignored
222-
cargo llvm-cov test --no-report validate_jplde_de440s_no_aberration --features spkezr_validation -- --nocapture --ignored
223-
cargo llvm-cov test --no-report validate_jplde_de440s_aberration_lt --features spkezr_validation -- --nocapture --ignored
224-
cargo llvm-cov test --no-report validate_jplde_de440_type3_no_aberration --features spkezr_validation -- --nocapture --ignored
225-
cargo llvm-cov test --no-report validate_hermite_type13_from_gmat --features spkezr_validation -- --nocapture --ignored
226-
cargo llvm-cov test --no-report validate_lagrange_type9_with_varying_segment_sizes --features spkezr_validation -- --nocapture --ignored
222+
cargo llvm-cov test --no-report validate_jplde_de440s_no_aberration --features validation -- --nocapture --ignored
223+
cargo llvm-cov test --no-report validate_jplde_de440s_aberration_lt --features validation -- --nocapture --ignored
224+
cargo llvm-cov test --no-report validate_jplde_de440_type3_no_aberration --features validation -- --nocapture --ignored
225+
cargo llvm-cov test --no-report validate_hermite_type13_from_gmat --features validation -- --nocapture --ignored
226+
cargo llvm-cov test --no-report validate_lagrange_type9_with_varying_segment_sizes --features validation -- --nocapture --ignored
227227
cargo llvm-cov test --no-report ut_embed --features embed_ephem
228228
cargo llvm-cov report --lcov > ../lcov.txt
229229

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["anise", "anise-cli", "anise-gui", "anise-py", "anise/fuzz"]
44

55
[workspace.package]
6-
version = "0.6.6"
6+
version = "0.6.7"
77
edition = "2021"
88
authors = ["Christopher Rabotin <[email protected]>"]
99
description = "ANISE provides a toolkit and files for Attitude, Navigation, Instrument, Spacecraft, and Ephemeris data. It's a modern replacement of NAIF SPICE file."
@@ -27,14 +27,14 @@ exclude = [
2727
]
2828

2929
[workspace.dependencies]
30-
hifitime = "4.1.2"
30+
hifitime = "4.1.3"
3131
memmap2 = "0.9.4"
3232
crc32fast = "1.4.2"
3333
der = { version = "0.7.8", features = ["derive", "alloc", "real"] }
3434
log = "0.4"
3535
pretty_env_logger = "0.5"
3636
tabled = "=0.20"
37-
nalgebra = { version = "0.34", default-features = true, features = [
37+
nalgebra = { version = "0.33", default-features = true, features = [
3838
"serde-serialize",
3939
] }
4040
zerocopy = { version = "0.8.0", features = ["derive"] }
@@ -47,7 +47,7 @@ numpy = "0.25"
4747
ndarray = ">= 0.15, < 0.17"
4848
rayon = "1.10.0"
4949

50-
anise = { version = "0.6.6", path = "anise", default-features = false }
50+
anise = { version = "0.6.7", path = "anise", default-features = false }
5151

5252
[profile.bench]
5353
debug = true

anise-cli/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ where
208208

209209
info!("CRC32 checksum: 0x{:X}", fmt.crc32());
210210
if let Some(comments) = fmt.comments().context(CliDAFSnafu)? {
211-
println!("== COMMENTS ==\n{}== END ==", comments);
211+
println!("== COMMENTS ==\n{comments}== END ==");
212212
} else {
213213
println!("(File has no comments)");
214214
}
@@ -223,7 +223,7 @@ fn rm_daf_by_id<R>(
223223
where
224224
R: NAIFSummaryRecord,
225225
{
226-
info!("Loading {:?} as DAF/PCK", input);
226+
info!("Loading {input:?} as DAF/PCK");
227227
let fmt = DAF::<R>::parse(bytes).context(CliDAFSnafu)?;
228228

229229
let mut ids = HashSet::new();

anise-py/src/bin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use std::env::consts::OS;
1616
use std::fs;
1717
use std::process::Command;
1818

19+
#[allow(clippy::zombie_processes)]
1920
#[pyfunction]
2021
pub(crate) fn exec_gui() -> Result<(), MetaAlmanacError> {
2122
if ["windows", "linux"].contains(&OS) {

anise/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ python = ["pyo3", "pyo3-log", "numpy", "ndarray", "rayon"]
7373
metaload = ["url", "ureq", "platform-dirs", "regex", "serde_dhall"]
7474
embed_ephem = ["rust-embed", "ureq"]
7575
# Enabling this flag significantly increases compilation times due to Arrow and Polars.
76-
spkezr_validation = []
76+
validation = []
7777

7878
[[bench]]
7979
name = "iai_jpl_ephemeris"

anise/src/almanac/python.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl Almanac {
158158
println!("{e}");
159159
None
160160
},
161-
|aer| Some(aer),
161+
Some,
162162
)
163163
})
164164
.collect::<Vec<AzElRange>>();
@@ -301,7 +301,7 @@ impl Almanac {
301301
println!("{e}");
302302
None
303303
},
304-
|aer| Some(aer),
304+
Some,
305305
)
306306
})
307307
.collect::<Vec<Occultation>>();
@@ -381,7 +381,7 @@ impl Almanac {
381381
time_series,
382382
ab_corr=None,
383383
))]
384-
fn py_transform_many<'py>(
384+
fn py_transform_many(
385385
&self,
386386
py: Python,
387387
target_frame: Frame,
@@ -399,7 +399,7 @@ impl Almanac {
399399
eprintln!("{e}");
400400
None
401401
},
402-
|state| Some(state),
402+
Some,
403403
)
404404
})
405405
.collect::<Vec<CartesianState>>();
@@ -460,7 +460,7 @@ impl Almanac {
460460
println!("{e}");
461461
None
462462
},
463-
|state| Some(state),
463+
Some,
464464
)
465465
})
466466
.collect::<Vec<CartesianState>>();

anise/src/astro/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ impl AzElRange {
205205
/// Allows for pickling the object
206206
///
207207
/// :rtype: typing.Tuple
208+
#[allow(clippy::type_complexity)]
208209
fn __getnewargs__(&self) -> Result<(Epoch, f64, f64, f64, f64, Option<Frame>), PyErr> {
209210
Ok((
210211
self.epoch,

anise/src/constants.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub mod celestial_objects {
4141
VENUS => Some("Venus"),
4242
EARTH_MOON_BARYCENTER => Some("Earth-Moon Barycenter"),
4343
MARS_BARYCENTER => Some("Mars Barycenter"),
44+
MARS => Some("Mars"),
4445
JUPITER_BARYCENTER => Some("Jupiter Barycenter"),
4546
SATURN_BARYCENTER => Some("Saturn Barycenter"),
4647
URANUS_BARYCENTER => Some("Uranus Barycenter"),
@@ -53,8 +54,13 @@ pub mod celestial_objects {
5354
}
5455
}
5556

56-
/// Converts the provided ID to its human name. Only works for the common celestial bodies. Should be compatible with CCSDS OEM names
57+
#[deprecated(since = "0.6.7")]
5758
pub fn id_to_celestial_name(name: &str) -> Result<NaifId, EphemerisError> {
59+
id_from_celestial_name(name)
60+
}
61+
62+
/// Converts the provided ID to its human name. Only works for the common celestial bodies. Should be compatible with CCSDS OEM names
63+
pub fn id_from_celestial_name(name: &str) -> Result<NaifId, EphemerisError> {
5864
match name {
5965
"Mercury" => Ok(MERCURY),
6066
"Venus" => Ok(VENUS),
@@ -270,8 +276,16 @@ pub mod orientations {
270276
}
271277
}
272278

273-
/// Converts the provided ID to its human name. Only works for the common celestial bodies. Should be compatible with CCSDS OEM names
279+
#[deprecated(
280+
since = "0.6.7",
281+
note = "use id_from_orientation_name, the original function was incorrectly named"
282+
)]
274283
pub fn id_to_orientation_name(name: &str) -> Result<NaifId, OrientationError> {
284+
id_from_orientation_name(name)
285+
}
286+
287+
/// Converts the provided ID to its human name. Only works for the common celestial bodies. Should be compatible with CCSDS OEM names
288+
pub fn id_from_orientation_name(name: &str) -> Result<NaifId, OrientationError> {
275289
match name {
276290
"J2000" | "ICRF" => Ok(J2000),
277291
"B1950" => Ok(B1950),
@@ -308,6 +322,8 @@ pub mod frames {
308322
pub const MERCURY_J2000: Frame = Frame::new(MERCURY, J2000);
309323
pub const VENUS_J2000: Frame = Frame::new(VENUS, J2000);
310324
pub const EARTH_MOON_BARYCENTER_J2000: Frame = Frame::new(EARTH_MOON_BARYCENTER, J2000);
325+
/// The Mars frame is not available in the standard DE files, and requires a Mars specific BSP.
326+
pub const MARS_J2000: Frame = Frame::new(MARS, J2000);
311327
pub const MARS_BARYCENTER_J2000: Frame = Frame::new(MARS_BARYCENTER, J2000);
312328
pub const JUPITER_BARYCENTER_J2000: Frame = Frame::new(JUPITER_BARYCENTER, J2000);
313329
pub const SATURN_BARYCENTER_J2000: Frame = Frame::new(SATURN_BARYCENTER, J2000);

anise/src/frames/frame.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use serde_dhall::StaticType;
1818

1919
use crate::astro::PhysicsResult;
2020
use crate::constants::celestial_objects::{
21-
celestial_name_from_id, id_to_celestial_name, SOLAR_SYSTEM_BARYCENTER,
21+
celestial_name_from_id, id_from_celestial_name, SOLAR_SYSTEM_BARYCENTER,
2222
};
23-
use crate::constants::orientations::{id_to_orientation_name, orientation_name_from_id, J2000};
23+
use crate::constants::orientations::{id_from_orientation_name, orientation_name_from_id, J2000};
2424
use crate::errors::{AlmanacError, EphemerisSnafu, OrientationSnafu, PhysicsError};
2525
use crate::prelude::FrameUid;
2626
use crate::structure::planetocentric::ellipsoid::Ellipsoid;
@@ -75,11 +75,11 @@ impl Frame {
7575
/// Attempts to create a new frame from its center and reference frame name.
7676
/// This function is compatible with the CCSDS OEM names.
7777
pub fn from_name(center: &str, ref_frame: &str) -> Result<Self, AlmanacError> {
78-
let ephemeris_id = id_to_celestial_name(center).context(EphemerisSnafu {
78+
let ephemeris_id = id_from_celestial_name(center).context(EphemerisSnafu {
7979
action: "converting center name to its ID",
8080
})?;
8181

82-
let orientation_id = id_to_orientation_name(ref_frame).context(OrientationSnafu {
82+
let orientation_id = id_from_orientation_name(ref_frame).context(OrientationSnafu {
8383
action: "converting reference frame to its ID",
8484
})?;
8585

0 commit comments

Comments
 (0)