Skip to content

Commit

Permalink
Try to fix the decode out tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Aug 5, 2024
1 parent adfb850 commit 44180a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion crates/numcodecs-python/tests/crc32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ fn python_api() -> Result<(), PyErr> {
let decoded = codec.decode(encoded.as_borrowed(), None)?;
// decode into an output
let decoded_out = numpy::PyArray1::<u8>::zeros_bound(py, (4,), false);
codec.decode(encoded.as_borrowed(), Some(decoded.as_any().as_borrowed()))?;
codec.decode(
encoded.as_borrowed(),
Some(decoded_out.as_any().as_borrowed()),
)?;

// check the encoded and decoded data
let encoded: Vec<u8> = encoded.extract()?;
Expand Down
5 changes: 4 additions & 1 deletion crates/numcodecs-python/tests/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ fn export() -> Result<(), PyErr> {
let decoded = codec.decode(encoded.as_borrowed(), None)?;
// decode into an output
let decoded_out = numpy::PyArray1::<f64>::zeros_bound(py, (4,), false);
codec.decode(encoded.as_borrowed(), Some(decoded.as_any().as_borrowed()))?;
codec.decode(
encoded.as_borrowed(),
Some(decoded_out.as_any().as_borrowed()),
)?;

// check the encoded and decoded data
let encoded: Vec<f64> = encoded.extract()?;
Expand Down

0 comments on commit 44180a0

Please sign in to comment.