fitscube-rs
Documentation: Python API, CLI, and algorithm background at fitscube-rs.readthedocs.io; Rust API at docs.rs/fitscube-rs.
A Rust port of the fitscube Python package. Combines single-frequency/single-time FITS images into a FITS cube — building the spectral (or time) axis from the per-image headers, detecting even vs uneven spacing, preserving per-channel beams in a CASA BEAMS table — and extracts individual planes back out.
Note: This is an experiment in LLM-assisted coding with Claude. Do not trust this software as far as you can throw it.
Installation
Python library
pip install fitscube-rs
CLI binary
Requires Rust 1.85+.
cargo install fitscube-rs
Usage
- Python API and quickstart: fitscube-rs.readthedocs.io/en/latest/quickstart.html
- CLI reference: fitscube-rs.readthedocs.io/en/latest/cli.html
- Rust API: docs.rs/fitscube-rs
Development
Install in editable mode:
uv pip install -e .
After changing the Python-facing Rust API in src/python.rs, rebuild with the
stubgen feature (the default build omits _generate_stubs) and regenerate
the type stubs:
uv run maturin develop --features stubgen
uv run --no-sync python -c "from fitscube_rs._fitscube_rs import _generate_stubs; _generate_stubs()"
This overwrites fitscube_rs/_fitscube_rs.pyi from the Rust annotations and docstrings. Commit the result alongside any API changes.
Running tests
Python tests need the compiled extension and the test extra (pytest,
astropy), plus the upstream fitscube
package, which the parity tests validate against. uv sync builds the maturin
extension into .venv, so a plain uvx pytest won't work — it runs in an
isolated env with neither the module nor the deps:
uv sync --extra test # builds the extension + installs test deps
uv pip install fitscube # upstream package, for parity tests
uv run --no-sync pytest
Rust tests run with cargo test:
cargo test
Pre-commit hooks
Formatters and linters run via prek, a fast
drop-in pre-commit reimplementation. The hooks
(.pre-commit-config.yaml) are the same checks CI enforces: ruff lint +
format, ty type checking, cargo fmt, and
cargo clippy.
uv sync --extra dev # installs prek + ty into the venv
uvx prek install # install the git hook (runs on every commit)
uvx prek run --all-files # run all hooks manually
License
fitscube-rs is released under the BSD 3-Clause License.
It is a port of the fitscube Python
package by Alec Thomson (BSD 3-Clause), and validates its output against that
package in the test suite. See
NOTICE.md
for full attributions.
Metadata
Release files for fitscube-rs 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fitscube_rs-1.2.3.tar.gz | 220.1 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fitscube_rs-1.2.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| fitscube_rs-1.2.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| fitscube_rs-1.2.3-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 3.7 MB
Release files / fitscube_rs-1.2.3.tar.gz
| Download URL | fitscube_rs-1.2.3.tar.gz |
|---|---|
| Size | 220.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff2e3076d756b5c1b0aeedc5617e2b767db7d79e89b2cf2083e03ba70bea5a39
|
|
BLAKE2b-256 checksum How to use checksums |
81b885420f7dde7084954c59d135210248632d026ddda2a9c75afb56e91b3d2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / fitscube_rs-1.2.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | fitscube_rs-1.2.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bea8aac3b6888803e11034321a880b588881530dae4e9ad28f9bf235e09f6f5f
|
|
BLAKE2b-256 checksum How to use checksums |
35f4f4006dd99fb20052976ff1fed72a83424729e6876ed5aabd4db862c50441
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / fitscube_rs-1.2.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | fitscube_rs-1.2.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
8e697ab490e7f2b78cc1e82841aa724a6c36f4e6ba041e074ed1641bbfc34475
|
|
BLAKE2b-256 checksum How to use checksums |
0f7c6abdba2280b6c46b4f59169ad973b79b24a3634f29d8bd7381558a5230e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / fitscube_rs-1.2.3-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | fitscube_rs-1.2.3-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
89608b7b979dce156b644c407b5f6f764e3a45a89e909336200c2a883e3e8e83
|
|
BLAKE2b-256 checksum How to use checksums |
c3741f21811535112b9f37b0b8fee38b74a6ec20ee01bb2c7bedcdcfae71db86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log