@@ -52,7 +52,7 @@ pub struct TrkConfig {
52
52
pub sampling : Duration ,
53
53
/// List of tracking strands during which the given tracker will be tracking
54
54
#[ builder( default , setter( strip_option) ) ]
55
- pub strands : Option < Vec < EpochRanges > > ,
55
+ pub strands : Option < Vec < Strand > > ,
56
56
}
57
57
58
58
impl ConfigRepr for TrkConfig { }
@@ -133,18 +133,18 @@ impl Default for TrkConfig {
133
133
}
134
134
}
135
135
136
- /// Stores an epoch range for tracking.
136
+ /// Stores a tracking strand with a start and end epoch
137
137
#[ derive( Copy , Clone , Debug , Serialize , Deserialize , PartialEq ) ]
138
138
#[ cfg_attr( feature = "python" , pyclass) ]
139
139
#[ cfg_attr( feature = "python" , pyo3( module = "nyx_space.orbit_determination" ) ) ]
140
- pub struct EpochRanges {
140
+ pub struct Strand {
141
141
#[ serde( serialize_with = "epoch_to_str" , deserialize_with = "epoch_from_str" ) ]
142
142
pub start : Epoch ,
143
143
#[ serde( serialize_with = "epoch_to_str" , deserialize_with = "epoch_from_str" ) ]
144
144
pub end : Epoch ,
145
145
}
146
146
147
- impl EpochRanges {
147
+ impl Strand {
148
148
/// Returns whether the provided epoch is within the range
149
149
pub fn contains ( & self , epoch : Epoch ) -> bool {
150
150
( self . start ..=self . end ) . contains ( & epoch)
@@ -179,21 +179,21 @@ mod trkconfig_ut {
179
179
180
180
let start = Epoch :: now ( ) . unwrap ( ) ;
181
181
let end = start + 10 . seconds ( ) ;
182
- cfg. strands = Some ( vec ! [ EpochRanges { start, end } ] ) ;
182
+ cfg. strands = Some ( vec ! [ Strand { start, end } ] ) ;
183
183
assert ! (
184
184
cfg. sanity_check( ) . is_err( ) ,
185
185
"strand of too short of a duration should mark this insane"
186
186
) ;
187
187
188
188
let end = start + cfg. sampling ;
189
- cfg. strands = Some ( vec ! [ EpochRanges { start, end } ] ) ;
189
+ cfg. strands = Some ( vec ! [ Strand { start, end } ] ) ;
190
190
assert ! (
191
191
cfg. sanity_check( ) . is_ok( ) ,
192
192
"strand allowing for a single measurement should be OK"
193
193
) ;
194
194
195
195
// An anti-chronological strand should be invalid
196
- cfg. strands = Some ( vec ! [ EpochRanges {
196
+ cfg. strands = Some ( vec ! [ Strand {
197
197
start: end,
198
198
end: start,
199
199
} ] ) ;
0 commit comments