Skip to content

Commit

Permalink
Fix test flags and update heapless and parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed Nov 16, 2023
1 parent 13db430 commit 6f44c0d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Rust-SPICE BPC validation
run: |
RUST_BACKTRACE=1 RUST_LOG=debug cargo test validate_bpc_ --release -- --nocapture --include-ignored --test-threads 1
RUST_BACKTRACE=1 RUST_LOG=debug cargo test de440s_translation_verif_venus2emb --release -- --nocapture --ignored --include-ignored --test-threads 1
RUST_BACKTRACE=1 RUST_LOG=debug cargo test de440s_translation_verif_venus2emb --release -- --nocapture --include-ignored --test-threads 1
# Now analyze the results and create pretty plots
- uses: actions/setup-python@v4
Expand Down
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@ exclude = [
hifitime = "3.8"
memmap2 = "=0.9.0"
crc32fast = "=1.3.2"
der = { version = "=0.7.8", features = ["derive", "alloc", "real"] }
der = { version = "0.7.8", features = ["derive", "alloc", "real"] }
clap = { version = "4", features = ["derive"] }
log = "=0.4"
pretty_env_logger = "=0.5"
tabled = "=0.14"
const_format = "0.2"
nalgebra = "0.32"
approx = "=0.5.1"
zerocopy = { version = "=0.7.26", features = ["derive"] }
zerocopy = { version = "0.7.26", features = ["derive"] }
bytes = "=1.4.0"
snafu = { version = "=0.7.5", features = ["backtrace"] }
lexical-core = "=0.8.5"
heapless = "=0.7.16"
rstest = "=0.18.2"
snafu = { version = "0.7.5", features = ["backtrace"] }
lexical-core = "0.8.5"
heapless = "0.8.0"
rstest = "0.18.2"

[dev-dependencies]
rust-spice = "0.7.6"
parquet = "47.0.0"
arrow = "47.0.0"
parquet = "49.0.0"
arrow = "49.0.0"
criterion = "0.5"
iai = "0.1"
polars = { version = "0.34", features = ["lazy", "parquet"] }
polars = { version = "0.34.2", features = ["lazy", "parquet"] }
rayon = "1.7"

[features]
Expand Down
6 changes: 4 additions & 2 deletions src/structure/dataset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl<T: DataSetT, const ENTRIES: usize> DataSet<T, ENTRIES> {
}

pub fn get_by_name(&self, name: &str) -> Result<T, DataSetError> {
if let Some(entry) = self.lut.by_name.get(&name.into()) {
if let Some(entry) = self.lut.by_name.get(&name.try_into().unwrap()) {
// Found the name
let bytes = self
.bytes
Expand All @@ -204,7 +204,9 @@ impl<T: DataSetT, const ENTRIES: usize> DataSet<T, ENTRIES> {
} else {
Err(DataSetError::DataSetLut {
action: "fetching by ID",
source: LutError::UnknownName { name: name.into() },
source: LutError::UnknownName {
name: name.try_into().unwrap(),
},
})
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/structure/lookuptable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl<const ENTRIES: usize> LookUpTable<ENTRIES> {
.insert(id, entry)
.map_err(|_| LutError::IdLutFull { max_slots: ENTRIES })?;
self.by_name
.insert(name.into(), entry)
.insert(name.try_into().unwrap(), entry)
.map_err(|_| LutError::NameLutFull { max_slots: ENTRIES })?;
Ok(())
}
Expand All @@ -116,7 +116,7 @@ impl<const ENTRIES: usize> LookUpTable<ENTRIES> {

pub fn append_name(&mut self, name: &str, entry: Entry) -> Result<(), LutError> {
self.by_name
.insert(name.into(), entry)
.insert(name.try_into().unwrap(), entry)
.map_err(|_| LutError::NameLutFull { max_slots: ENTRIES })?;
Ok(())
}
Expand Down Expand Up @@ -211,7 +211,10 @@ impl<'a, const ENTRIES: usize> Decode<'a> for LookUpTable<ENTRIES> {
for (name, entry) in names.iter().zip(name_entries.iter()) {
let key = core::str::from_utf8(name.as_bytes()).unwrap();
lut.by_name
.insert(key[..KEY_NAME_LEN.min(key.len())].into(), *entry)
.insert(
key[..KEY_NAME_LEN.min(key.len())].try_into().unwrap(),
*entry,
)
.unwrap();
}

Expand Down
4 changes: 3 additions & 1 deletion src/structure/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ impl<'a> Decode<'a> for Metadata {
let creation_date =
Epoch::from_str(decoder.decode::<Utf8StringRef<'a>>()?.as_str()).unwrap();
let orig_str = decoder.decode::<Utf8StringRef<'a>>()?.as_str();
let originator = orig_str[..MAX_ORIGINATOR_LEN.min(orig_str.len())].into();
let originator = orig_str[..MAX_ORIGINATOR_LEN.min(orig_str.len())]
.try_into()
.unwrap();
Ok(Self {
anise_version,
dataset_type,
Expand Down
2 changes: 1 addition & 1 deletion src/structure/spacecraft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl<'a> Decode<'a> for SpacecraftData {
};

Ok(Self {
name: name[..name.len().min(32)].into(),
name: name[..name.len().min(32)].try_into().unwrap(),
mass_kg,
srp_data,
drag_data,
Expand Down

0 comments on commit 6f44c0d

Please sign in to comment.