Skip to content

Commit

Permalink
Merge branch 'main' into reintroduce_pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
kralka authored Feb 3, 2025
2 parents cf68b9a + 136a8d0 commit 47d4805
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 22 deletions.
136 changes: 120 additions & 16 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ name = "sedpack_rs"
crate-type = ["cdylib", "rlib"]

[dependencies]
flatbuffers = "24.12"
flatbuffers = "25.1"
flate2 = { version = "1.0.17" }
lz4_flex = { version = "0.11.3", default-features = false , features = ["frame"] }
numpy = "0.23"
pyo3 = "0.23"
rand = "0.8"
rand = "0.9"
strum = "0.26.3"
strum_macros = "0.26.4"
yoke = { version = "0.7", features = ["derive"] }
Expand Down
7 changes: 3 additions & 4 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ mod static_iter {
/// - Python does not guarantee that __del__ is called right away (or at all). Thus RustIter
/// also implements a context manager which is guaranteed to call __exit__ and drop memory
/// owned by the corresponding ExampleIterator.
static STATIC_ITERATORS: std::sync::LazyLock<
std::sync::Mutex<HashMap<usize, ExampleIterator>>,
> = std::sync::LazyLock::new(|| std::sync::Mutex::new(HashMap::new()));
static STATIC_ITERATORS: std::sync::LazyLock<std::sync::Mutex<HashMap<i32, ExampleIterator>>> =
std::sync::LazyLock::new(|| std::sync::Mutex::new(HashMap::new()));

#[pyclass]
pub struct RustIter {
/// Which ExampleIterator are we interacting with (unique id).
static_index: usize,
static_index: i32,
/// Read only value. For iteration we use this object as a context manager which allows us
/// to free resources in STATIC_ITERATORS on the call of __exit__.
///
Expand Down

0 comments on commit 47d4805

Please sign in to comment.