Metadata-Version: 2.5
Name: rumi-eo
Version: 0.32.1
Summary: Stateless raster storage for AI4EO.
Project-URL: Homepage, https://github.com/asterisk-labs/rumi
Project-URL: Repository, https://github.com/asterisk-labs/rumi
Project-URL: Issues, https://github.com/asterisk-labs/rumi/issues
Project-URL: Changelog, https://github.com/asterisk-labs/rumi/blob/main/CHANGELOG.md
Author-email: Cesar Aybar <cesar@asterisk.coop>
License: BSD-3-Clause
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: cffi>=1.17
Requires-Dist: numpy>=2
Provides-Extra: test
Requires-Dist: mypy>=1.11; extra == 'test'
Requires-Dist: pytest>=7; extra == 'test'
Requires-Dist: ruff>=0.6; extra == 'test'
Description-Content-Type: text/markdown

# rumi (python)

Python bindings for Rumi, stateless raster storage for AI4EO. Rumi stores images as
`(B, Y, X)` and time series as `(T, B, Y, X)`.

```bash
pip install rumi-eo
```

Use `rumi.geozl` to compress frames before writing. It uses the GeoZL linked
into Rumi; a separate `geozl` package is not required.

Rumi currently supports Linux and macOS and requires Python 3.11 or newer. The
format and APIs may change before 1.0. See the
[project README](https://github.com/asterisk-labs/rumi) for examples and the
[format specification](https://github.com/asterisk-labs/rumi/blob/main/SPEC.md)
for the wire format.

Reads return NumPy by default. PyTorch, JAX and TensorFlow results use DLPack;
`framework="dlpack"` returns the one-shot producer itself. Compatibility is
checked before opening the source, and Rumi never casts a dtype to make it fit.

GPU reads decode straight into CUDA memory on Linux or Metal memory on macOS and
hand it to the framework through DLPack, so PyTorch, JAX and CuPy import it
without a copy.

```python
chip = rumi.read(path, header, framework="torch", device="cuda:0",
                 window=(row, column, height, width))

jax_chip = rumi.read(path, header, framework="jax", device="cuda:0",
                     window=(row, column, height, width))

cupy_chip = cupy.from_dlpack(rumi.read(
    path, header, framework="dlpack", device="cuda:0",
    window=(row, column, height, width)))

mps_chip = rumi.read(path, header, framework="torch", device="mps",
                     window=(row, column, height, width))

cpu_decoded = rumi.read(path, header, framework="torch", device="mps",
                         decode_backend="cpu",
                         window=(row, column, height, width))
```

The header, byte ranges and copy plan stay on the CPU. PFOR and `lanes` frames of
one- and two-byte samples decode on the device when they have one chunk; other
frames use CPU staging before GeoZL writes the result to the selected GPU.
`decode_backend="cpu"` forces complete CPU decoding for all selected frames;
`"auto"` is the default. A CUDA import makes the framework's current stream
wait for the read on the device, and the memory returns to Rumi in that stream's
order, so keep the stream alive while the array lives. MPS reads require PyTorch
2.10 or newer. GPU frame planning follows `rumi.set_num_threads` or
`RUMI_NUM_THREADS`, set before the first read, and defaults to one thread per
process. R and Julia device arrays are not implemented yet.
