Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object_store = "0.12"
pyo3 = { version = "0.23.0", features = ["macros"] }
pyo3-async-runtimes = "0.23"
pyo3-bytes = "0.1.3"
pyo3-object_store = "0.1.0-beta.2"
pyo3-object_store = "0.1.0-beta.4"
rayon = "1.10.0"
tokio-rayon = "2.1.0"
thiserror = "1"
Expand Down
1 change: 1 addition & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dev-dependencies = [
"mkdocstrings-python>=1.13.0",
"mkdocstrings>=0.27.0",
"numpy>=1",
"obstore",
"pip>=24.2",
"pytest-asyncio>=0.24.0",
"pytest>=8.3.3",
Expand Down
7 changes: 6 additions & 1 deletion python/python/async_tiff/_tiff.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import obstore
from ._tile import Tile
from ._ifd import ImageFileDirectory
from .store import ObjectStore

class TIFF:
@classmethod
async def open(
cls, path: str, *, store: ObjectStore, prefetch: int | None = 16384
cls,
path: str,
*,
store: obstore.store.ObjectStore | ObjectStore,
prefetch: int | None = 16384,
) -> TIFF: ...
@property
def ifds(self) -> list[ImageFileDirectory]: ...
Expand Down
4 changes: 2 additions & 2 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ fn _async_tiff(py: Python, m: &Bound<PyModule>) -> PyResult<()> {
m.add_class::<PyThreadPool>()?;
m.add_class::<PyTIFF>()?;

pyo3_object_store::register_store_module(py, m, "async_tiff")?;
pyo3_object_store::register_exceptions_module(py, m, "async_tiff")?;
pyo3_object_store::register_store_module(py, m, "async_tiff", "store")?;
pyo3_object_store::register_exceptions_module(py, m, "async_tiff", "exceptions")?;

Ok(())
}
6 changes: 3 additions & 3 deletions python/src/tiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use pyo3::exceptions::PyIndexError;
use pyo3::prelude::*;
use pyo3::types::PyType;
use pyo3_async_runtimes::tokio::future_into_py;
use pyo3_object_store::PyObjectStore;
use pyo3_object_store::AnyObjectStore;

use crate::tile::PyTile;
use crate::PyImageFileDirectory;
Expand All @@ -25,10 +25,10 @@ impl PyTIFF {
_cls: &'py Bound<PyType>,
py: Python<'py>,
path: String,
store: PyObjectStore,
store: AnyObjectStore,
prefetch: Option<u64>,
) -> PyResult<Bound<'py, PyAny>> {
let reader = ObjectReader::new(store.into_inner(), path.into());
let reader = ObjectReader::new(store.into_dyn(), path.into());
let object_reader = reader.clone();

let cog_reader = future_into_py(py, async move {
Expand Down
Loading