Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Sitta

A lightweight, dynamic multi-dimensional array / view for C++20. Pure container: shape, strides, memory ownership and zero-copy views, nothing else. Optional, opt-in interop with xtensor, Kokkos, HDF5, TBB, Boost.MultiArray, and Python.

#include <sitta/sitta.hpp>
using namespace sitta;

Installation

Header-only with zero dependencies for the core functionality.

cmake -B build
cmake --build build
ctest --test-dir build

Interop features (xtensor, Kokkos, HDF5, TBB, Boost.MultiArray, Python) are auto-detected and built only if their dependencies are found; pass -DSITTA_ENABLE_<NAME>=OFF to skip one even when present.

Usage example

Two flavors: static rank (SittaArray<T, N>, rank known at compile time, tightest codegen) and dynamic rank (SittaArray<T>, rank known at runtime). Both share the same API.

// Owning allocation, static rank 2.
auto a = SittaArray<double, 2>::from_shape({3, 4});
a(1, 2) = 3.14;

// Views share the buffer (refcounted): no copy, no allocation.
auto t = a.transpose();                                        // shape (4, 3)
auto s = a.slice(std::array<Range,2>{Range{0, 2, 1}, Range{1, 3, 1}});
s(0, 0) = 42;   // writes through to `a`

// Wrap external memory without taking ownership.
std::vector<float> buf(6);
auto w = SittaArray<float, 2>::wrap(buf.data(), {2, 3});

See the Getting Started guide for the full walkthrough: element access, reshape/squeeze, the rank-reducing drop_axis/subview, static/dynamic rank conversion, inspecting an array, and the element-wise for_each/transform algorithms.

Interop

  • xtensor: zero-copy view for host math (sitta::xt_interop::as_xtensor)
  • Kokkos: wraps a Kokkos::View's refcount for host/device buffers
  • HDF5: read/write full datasets or hyperslabs, including user structs
  • TBB: parallel for_each/transform
  • Boost.MultiArray: zero-copy or copying conversion, static rank only
  • Python: nanobind module with NumPy and DLPack zero-copy interop

Full usage for each adapter is in docs/interop.rst.

What this class is not

No arithmetic, no broadcasting, no iterators, no I/O beyond the HDF5 adapter, no automatic host/device mirroring. It's a metadata + buffer-lifetime layer: build numeric operations on top via the xtensor/Kokkos/Python adapters.

Documentation

Full API reference (generated from source via clang-doc) and detailed guides build with Sphinx:

cmake -B build -DSITTA_ENABLE_DOCS=ON
cmake --build build --target docs

See docs/README.md for the doc-build pipeline, or browse the .rst sources directly: docs/getting_started.rst, docs/interop.rst.

License

MIT. See LICENSE.

Metadata

Release files for sitta 2.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sitta 2.0.0rc1
File Size Uploaded Provenance
sitta-2.0.0rc1.tar.gz 90.0 kB Without provenance Details

Release files / sitta-2.0.0rc1.tar.gz

Download URL sitta-2.0.0rc1.tar.gz
Size 90.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7e081eb8e395a2bfa18e49527298e8d1edba49e12eda55efcf2986e406db5a33
BLAKE2b-256 checksum
How to use checksums
9e63af9748a7be8973adfc62543a9b52eb1d0991882f8fe533328551f778f937
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for sitta 2.0.0rc1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page