Skip to content

Commit 3a34af4

Browse files
authored
🔥 Remove cog3pio backend engine, drop xarray dependency (#89)
* ➖ Drop xarray dependency, remove cog3pio backend engine Deciding to remove the image-tiff CPU-based Cog3pioBackendEntrypoint, in favour of the nvtiff CUDA-based backend happening over at cupy-xarray. Remove all code related to xarray, and also the rioxarray comparison benchmark. Users should look into other CPU-based TIFF readers (e.g. async-tiff) instead. This will also trim our dependency footprint considerably for easier maintenance and clearer focus on DLPack. * 📝 Delete or cross-out xarray related documentation Remove xarray section from quickstart and API pages, deleted mention of xarray in recent changelog, and crossed it out in main README.md. * 📝 Update roadmap to take include write support and SIMD wishlist Take out async-tiff refactor since async-geotiff is out. Want to double-down more on hardware-accelerated decoding instead.
1 parent bd9b65a commit 3a34af4

File tree

8 files changed

+13
-176
lines changed

8 files changed

+13
-176
lines changed

.release-plz.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ commit_preprocessors = [
6161
{ pattern = ':boom:', replace = "💥" },
6262
{ pattern = ':bug:', replace = "🐛" },
6363
{ pattern = ':construction_worker:', replace = "👷" },
64+
{ pattern = ':fire:', replace = "🔥" },
6465
{ pattern = ':heavy_minus_sign:', replace = "" },
6566
{ pattern = ':heavy_plus_sign:', replace = "" },
6667
{ pattern = ':label:', replace = "🏷️" },
@@ -85,7 +86,7 @@ commit_parsers = [
8586
{ message = "^(💥|:boom:|🚀|:rocket:)", group = "<!-- 0 --> 🌈 Highlights" },
8687
{ message = "^(✨|:sparkles:)", group = "<!-- 1 --> ✨ Features" },
8788
{ message = "^(🐛|:bug:)", group = "<!-- 2 --> 🐛 Bug Fixes" },
88-
{ message = "^(♻️|:recycle:|🚚|:truck:|🎨|:art:)", group = "<!-- 3 --> 🏭 Refactors" },
89+
{ message = "^(♻️|:recycle:|🚚|:truck:|🎨|:art:|🔥|:fire:)", group = "<!-- 3 --> 🏭 Refactors" },
8990
{ message = "^(📝|:memo:|🔍️|:mag:|🏷️|:label:)", group = "<!-- 4 --> 📝 Documentation" },
9091
{ message = "^(👷|:construction_worker:|🔧|:wrench:|⬆️|:arrow_up:|➕|:heavy_plus_sign:|➖|:heavy_minus_sign:|⬇️|:arrow_down:|📦️|:package:|📌|:pushpin:|🚩|:triangular_flag_on_post:|🔒️|:lock:|🚨|:rotating_light:|🌱|:seedling:|🔊|:loud_sound:)", group = "<!-- 5 --> 🧰 Maintenance" },
9192
]

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Yet another attempt at creating a GeoTIFF reader, in Rust, with Python bindings.
2020
[`object-store`](https://crates.io/crates/object_store))
2121

2222
2024 Q2-Q4:
23-
- [x] Integration with `xarray` as a
24-
[`BackendEntrypoint`](https://docs.xarray.dev/en/v2024.02.0/internals/how-to-add-new-backend.html)
23+
- [x] ~Integration with `xarray` as a
24+
[`BackendEntrypoint`](https://docs.xarray.dev/en/v2024.02.0/internals/how-to-add-new-backend.html)~ (removed)
2525
- [x] Implement single-band GeoTIFF reader for multiple dtypes (uint/int/float) (based
2626
on [`geotiff`](https://crates.io/crates/geotiff) crate)
2727

@@ -34,9 +34,11 @@ Yet another attempt at creating a GeoTIFF reader, in Rust, with Python bindings.
3434
- [x] GPU-based decoding (via [`nvTIFF`](https://crates.io/crates/nvtiff-sys))
3535

3636
2026:
37-
- [ ] Asynchronous I/O (refactor to [`async-tiff`](https://crates.io/crates/async-tiff))
3837
- [ ] Direct-to-GPU loading
38+
- [ ] Write support
3939

40+
2027:
41+
- [ ] SIMD decoding
4042

4143
## Related crates
4244

docs/api.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ These are the Python docs for `cog3pio`, for the Rust docs, see
88
::: cog3pio.CudaCogReader
99
::: cog3pio.CogReader
1010

11-
12-
## Xarray
13-
14-
::: cog3pio.xarray_backend.Cog3pioBackendEntrypoint
15-
options:
16-
members:
17-
- open_dataset
18-
1911
## NumPy
2012

2113
::: cog3pio.read_geotiff

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file.
99
### <!-- 0 --> 🌈 Highlights
1010

1111
- 💥 Read into CUDA memory DLPack tensor ([#57](https://github.com/weiji14/cog3pio/pull/57))
12-
- ⬆️ SPEC 0: Bump min version to Python 3.13, xarray 2024.10.0 ([#66](https://github.com/weiji14/cog3pio/pull/66))
12+
- ⬆️ SPEC 0: Bump min version to Python 3.13 ([#66](https://github.com/weiji14/cog3pio/pull/66))
1313

1414
### <!-- 1 --> ✨ Features
1515

docs/quickstart.md

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# Quickstart
22

3-
There are three ways to read a GeoTIFF with `cog3pio`'s Python bindings into CPU memory.
3+
There are two ways to read a GeoTIFF with `cog3pio`'s Python bindings into CPU memory.
44
Take your pick:
55

6-
| Output | DLPack protocol | coordinates | any dtype |
7-
|:---------:|:---------------:|:-----------:|:---------:|
8-
| PyCapsule ||||
9-
| xarray ||||
10-
| numpy ||||
6+
| Output | DLPack protocol | any dtype |
7+
|:---------:|:---------------:|:---------:|
8+
| PyCapsule |||
9+
| numpy |||
1110

1211
Notes:
1312

1413
- [DLPack - an in-memory tensor structure](https://data-apis.org/array-api/latest/design_topics/data_interchange.html#dlpack-an-in-memory-tensor-structure)
15-
- Coordinates in xarray are computed from the GeoTIFF's affine transformation
1614
- Currently supported dtypes include uint (u8/u16/u32/u64), int (i8/i16/i32/i64) and
1715
float (f16/f32/f64).
1816

@@ -44,24 +42,6 @@ assert array.dtype == "float16"
4442
# ...
4543
```
4644

47-
## Xarray
48-
49-
Read GeoTIFF file from a HTTP url via the
50-
[`Cog3pioBackendEntrypoint`](api#cog3pio.xarray_backend.Cog3pioBackendEntrypoint) engine
51-
into an [xarray.DataArray][] object (akin to
52-
[`rioxarray`](https://corteva.github.io/rioxarray)).
53-
54-
```python
55-
import xarray as xr
56-
57-
# Read GeoTIFF into an xarray.DataArray
58-
dataarray: xr.DataArray = xr.open_dataarray(
59-
filename_or_obj="https://github.com/cogeotiff/rio-tiler/raw/7.8.0/tests/fixtures/cog_dateline.tif",
60-
engine="cog3pio",
61-
)
62-
assert dataarray.sizes == {'band': 1, 'y': 2355, 'x': 2325}
63-
assert dataarray.dtype == "uint16"
64-
```
6545

6646
## NumPy
6747

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ classifiers = [
2323
]
2424
dependencies = [
2525
"numpy>=2.0",
26-
"xarray>=2024.10.0",
2726
]
2827
dynamic = ["version"]
2928

@@ -32,9 +31,6 @@ dynamic = ["version"]
3231
"Documentation" = "https://cog3pio.readthedocs.io"
3332
"Source Code" = "https://github.com/weiji14/cog3pio"
3433

35-
[project.entry-points."xarray.backends"]
36-
cog3pio = "cog3pio.xarray_backend:Cog3pioBackendEntrypoint"
37-
3834
[project.optional-dependencies]
3935
cuda = [
4036
"cupy-cuda13x",
@@ -43,7 +39,6 @@ cuda = [
4339
[dependency-groups]
4440
benchmark = [
4541
"pytest-codspeed",
46-
"rioxarray",
4742
]
4843
docs = [
4944
"mkdocstrings-python",

python/cog3pio/xarray_backend.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

python/tests/test_xarray_backend.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)