Repository navigation
Conversation
A Rust Library for High-Performance Tensor Exchange with Python! Crate at https://crates.io/crates/dlpark
Bumps [ndarray](https://github.com/rust-ndarray/ndarray) from 0.15.6 to 0.16.1. - [Release notes](https://github.com/rust-ndarray/ndarray/releases) - [Changelog](https://github.com/rust-ndarray/ndarray/blob/master/RELEASES.md) - [Commits](rust-ndarray/ndarray@0.15.6...0.16.1)
Open up `CogReader` struct as public API, with a new `dlpack` method to read into a DLPack tensor! Corresponding PyCogReader struct/class has some new `__dlpack__` and `__dlpack_device__` methods conforming to the Python specification of DLPack (part of the Python array API standard). These methods have replaced the `ndarray`/`as_numpy` methods respectively. The `read_geotiff` functions retain backwards compatibility to output ndarray::Array3/numpy::Pyarray3 objects. Updated unit tests as needed to handle all the refactorings to use DLPack. Wrote new documentation showing how to use CogReader to output a dlpark::versioned::SafeManagedTensorVersioned, and updated the xarray.open_dataarray example to show that a uint16 GeoTIFF can be read properly now! Also added new links to the async-tiff and tiff2 crates in the main README.md.
Found using `cargo msrv find`, the `1.85.0` version is determined by `dlpark=0.6.0` which uses Rust edition 2024.
Not needed anymore after replacing `num_traits::FromPrimitive` trait with `dlpark::traits::InferDataType`.
weiji14
marked this pull request as ready for review
June 13, 2025 07:01
weiji14
enabled auto-merge (squash)
June 13, 2025 07:01
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Open up
CogReaderstruct as public API with a newdlpackmethod to read from GeoTIFFs into a DLPack tensor! Corresponding PyCogReader struct/class has some new__dlpack__and__dlpack_device__methods conforming to the Python specification of DLPack (part of the Python array API standard).Usage:
Changes:
CogReader'sndarraymethod withdlpackmethodPyCogReader'sas_numpymethod with__dlpack__and__dlpack_device__methodsread_geotifffunctions to doTIFF->DLPack->(Py)Array3, while keeping backwards compatibilitydlpark::versioned::SafeManagedTensorVersionedxarray.DataArrayobject.References: