Skip to main content

Standalone, minimal-dependency casacore table system with a pybind11 interface

Project description

casacoretables

A standalone, minimal-dependency build of casacore's table system, with a pybind11 Python interface that mirrors python-casacore's casacore.tables.

It bundles only casacore's casa (base) and tables modules — nothing else — so it builds and installs quickly with very few dependencies.

What was removed relative to casacore / python-casacore

  • All other casacore modules: scimath, measures, ms, images, coordinates, fits, lattices, derivedmscal, ...
  • Heavy third-party libraries: HDF5, ADIOS2, Dysco, BLAS/LAPACK, FFTW, CFITSIO, WCSLIB, MPI, OpenMP, and Boost (python-casacore uses Boost.Python; this package uses pybind11 instead).

Remaining dependencies

  • Runtime: the C++ standard library, libdl, libm, pthreads, and numpy. (Nothing else.)
  • Build: a C++17 compiler, CMake ≥ 3.18, and bison ≥ 3 + flex (build-time only, to generate the TaQL/Json parsers).

The MeasurementSet helpers (default_ms, msconcat, addImagingColumns, ...) are intentionally absent: they belong to casacore's ms module.

Install

conda install -n <env> bison flex      # build tools (>=3 for bison)
pip install .

Use

import numpy as np
from casacoretables.tables import table, maketabdesc, makescacoldesc, makearrcoldesc, taql

desc = maketabdesc([makescacoldesc("ANT", 0),
                    makearrcoldesc("DATA", 0.0, ndim=2, shape=[2, 4])])
t = table("my.tab", desc, nrow=5)
t.putcol("DATA", np.zeros((5, 2, 4)))
data = t.getcol("DATA")            # zero-copy: numpy view over casacore storage
sub  = taql("select from $t where ANT > 2")
t.close()

Documentation

A runnable notebook tours the entire Python API — table creation, columns, cells and slices, keywords, tablecolumn/tablerow, TaQL queries, iteration, indexed lookups, copy/rename, and ASCII import/export: docs/casacoretables_api_tour.ipynb.

Using alongside CASA

casacoretables statically links its own copy of casacore and hides all of those symbols (only the module init symbol is exported), so it can be imported into the same Python process as CASA's casatools — which embeds a different, ABI-incompatible casacore — without symbol clashes or crashes.

Zero-copy

Large column reads (getcol) return a numpy array that shares casacore's storage (no copy) via a capsule that keeps the buffer alive. Writes (putcol) and the in-place getcolnp/getcellnp fill paths wrap the numpy buffer directly when its dtype already matches the column, avoiding an intermediate copy. casacore's column-major arrays are exposed in numpy's row-major convention by reversing axes — exactly as python-casacore does.

Tests

  • C++ unit tests (vendored from casacore) — configure with -DBUILD_CPP_TESTS=ON and run with ctest.
  • Python tests (ported from python-casacore) — pytest tests/python.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casacoretables-0.0.3.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

casacoretables-0.0.3-cp313-cp313-manylinux_2_28_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

casacoretables-0.0.3-cp313-cp313-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

casacoretables-0.0.3-cp312-cp312-manylinux_2_28_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

casacoretables-0.0.3-cp312-cp312-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

casacoretables-0.0.3-cp311-cp311-manylinux_2_28_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

casacoretables-0.0.3-cp311-cp311-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file casacoretables-0.0.3.tar.gz.

File metadata

  • Download URL: casacoretables-0.0.3.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for casacoretables-0.0.3.tar.gz
Algorithm Hash digest
SHA256 bd91adb4879a715739fcaf41f529d0f3107d98e85de3f5e6bde59a2349aca9ad
MD5 81f492ff246328a6f4e52e778077855a
BLAKE2b-256 ce086e8e216b6e1906da9fef5a780728f556ff118ed9789677c508894916795b

See more details on using hashes here.

Provenance

The following attestation bundles were made for casacoretables-0.0.3.tar.gz:

Publisher: python-publish-cpp.yml on nrao/casacoretables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file casacoretables-0.0.3-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for casacoretables-0.0.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ab6deeca8b8a065c8dcf287a258ab3fc6683e19adffdaa79d67f15c1e86e5216
MD5 c8e548332b9f65a1d7c0b0259e87027d
BLAKE2b-256 ab848330b3da579dd457e484f74519b7745686ba34f81574b7bc845ce8a6add6

See more details on using hashes here.

Provenance

The following attestation bundles were made for casacoretables-0.0.3-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: python-publish-cpp.yml on nrao/casacoretables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file casacoretables-0.0.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for casacoretables-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d64ebe98b9f38db57985d147c72a5b579af54ffe1c5e2741471680d65fef4f6
MD5 c6bbcdf915f83efbc497bdb60ec6ca2a
BLAKE2b-256 a80c3401c77eb76933323f69a9ffdea36db2dabe7a03bc2df07dba0b067fc681

See more details on using hashes here.

Provenance

The following attestation bundles were made for casacoretables-0.0.3-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: python-publish-cpp.yml on nrao/casacoretables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file casacoretables-0.0.3-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for casacoretables-0.0.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 519129e3857abc6aec928db887b037ca01153f085535eff84dc8e61577cfb1bd
MD5 7f1635597539aa14d8a410a6cd045d03
BLAKE2b-256 166d1a46dcc6a95a8018ca38d807f6d340102ad26c7596b5df3c0f9dd11531a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for casacoretables-0.0.3-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: python-publish-cpp.yml on nrao/casacoretables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file casacoretables-0.0.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for casacoretables-0.0.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 76561841cd982faf0a3b4e83c2e44924790e31ff552151e87b379edb2ba89f2c
MD5 709ff701dcab0747fce99bef46719425
BLAKE2b-256 48bad8a36fa56c0ca4f68e12e4a2f8eac93511ab4edba5bd5678adf16b230c62

See more details on using hashes here.

Provenance

The following attestation bundles were made for casacoretables-0.0.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-publish-cpp.yml on nrao/casacoretables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file casacoretables-0.0.3-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for casacoretables-0.0.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 58f2fe5c5e1162adba5d8772c8c1740150a63be407fd937961ca98b0087728e7
MD5 7a805e3a86d3535b34e1cffb58011b98
BLAKE2b-256 cddee303adb38f7364bc777cbb52e3e8e72b1a0b88de71bf3b54442e09f4473a

See more details on using hashes here.

Provenance

The following attestation bundles were made for casacoretables-0.0.3-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: python-publish-cpp.yml on nrao/casacoretables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file casacoretables-0.0.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for casacoretables-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fceb432e7bdd914bc2ab19a88c5a905c2d052f38b9cd85229dd28561da7a1162
MD5 f7388d24a21e7735f5ff0e6732608920
BLAKE2b-256 dd817af03d42336b3c58ad6b5f8075be2c059f14904a4018422b6569a47f5694

See more details on using hashes here.

Provenance

The following attestation bundles were made for casacoretables-0.0.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python-publish-cpp.yml on nrao/casacoretables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page