Skip to content

Commit

Permalink
Pyo3-0.22 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep authored and LDeakin committed Nov 15, 2024
1 parent 3d88471 commit ea2364c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
30 changes: 15 additions & 15 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ name = "zarrs_python"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21.0", features = ["extension-module"] }
pyo3 = { version = "0.22.6", features = ["extension-module"] }
zarrs = { version = "0.18.0-dev", git = "https://github.com/LDeakin/zarrs.git" }
paste = "1.0"
rayon_iter_concurrent_limit = "0.2.0"
rayon = "1.10.0"
# fix for https://stackoverflow.com/questions/76593417/package-openssl-was-not-found-in-the-pkg-config-search-path
openssl = { version = "0.10", features = ["vendored"] }
numpy = "0.21"
numpy = "0.22.1"
unsafe_cell_slice = "0.2.0"
serde_json = "1.0.128"

Expand Down
16 changes: 10 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,15 @@ impl CodecPipelineImpl {
)
}

fn selection_to_array_subset(selection: &[&PySlice], shape: &[u64]) -> PyResult<ArraySubset> {
fn selection_to_array_subset(
selection: &[Bound<'_, PySlice>],
shape: &[u64],
) -> PyResult<ArraySubset> {
let chunk_ranges = selection
.iter()
.zip(shape)
.map(|(selection, &shape)| {
let indices = selection.indices(i64::try_from(shape).unwrap())?;
let indices = selection.indices(isize::try_from(shape).unwrap())?;
assert!(indices.start >= 0); // FIXME
assert!(indices.stop >= 0); // FIXME
assert!(indices.step == 1);
Expand Down Expand Up @@ -247,21 +250,22 @@ type RetrieveChunksItem<'a> = (
Vec<u64>,
String,
Vec<u8>,
Vec<&'a PySlice>,
Vec<&'a PySlice>,
Vec<Bound<'a, PySlice>>,
Vec<Bound<'a, PySlice>>,
);

type StoreChunksItem<'a> = (
String,
Vec<u64>,
String,
Vec<u8>,
Vec<&'a PySlice>,
Vec<&'a PySlice>,
Vec<Bound<'a, PySlice>>,
Vec<Bound<'a, PySlice>>,
);

#[pymethods]
impl CodecPipelineImpl {
#[pyo3(signature = (metadata, validate_checksums=None, store_empty_chunks=None, concurrent_target=None))]
#[new]
fn new(
metadata: &str,
Expand Down

0 comments on commit ea2364c

Please sign in to comment.