p4TSA — package for Time Series Analysis
Contact: info@elenacuoco.com — https://www.elenacuoco.com
p4TSA is a spin-off of the C++ Noise Analysis Package (NAP). The core is
written in C++ and is exposed to Python through a pybind11
binding. The Python interface is called py4TSA (you can still pronounce it
pi'za) and is imported as py4tsa.
The module used to be called
pytsa. That name on PyPI belongs to an unrelated project, so change anyimport pytsatoimport py4tsa.
What is this for?
p4TSA is a minimal package of ad-hoc functions to work with time series. It
includes:
- Whitening in the time domain
- Double whitening (equivalent to dividing by the Power Spectral Density) in the time domain
- Wavelet decomposition
- Wavelet Detection Filter
The pipeline that uses it
p4TSA is the C++ core. The search pipeline that drives it —
trigger generation and the downstream trigger analysis — is
wdflow, which imports this library
through py4tsa. wdflow supersedes the earlier wdf package.
The two share the top-level module name
wdf, so they cannot be installed side by side: whicheverwdfsits directly insite-packagesshadows the other, including an editable install ofwdflow. Ifimport wdfresolves somewhere unexpected,pip uninstall wdfremoves the legacy package.
How to cite
Use of this code in published work requires citation of the following.
The Wavelet Detection Filter:
- E. Cuoco, The Wavelet Detection Filter: A Real Time Unmodeled Pipeline for Gravitational Wave Transients, Ranking Coincidences with a Graph Neural Network, arXiv:2609.12797 (2026). arxiv.org/html/2609.12797v1, 10.48550/arXiv.2609.12797
- E. Cuoco, M. Razzano, A. Utina, Wavelet-based classification of transient signals for gravitational wave detectors, 26th European Signal Processing Conference (EUSIPCO), 2648–2652 (2018). 10.23919/EUSIPCO.2018.8553393
Time-domain whitening, which this library implements:
- E. Cuoco et al., On-line power spectra identification and whitening for the noise in interferometric gravitational wave detectors, Class. Quantum Grav. 18, 1727 (2001). 10.1088/0264-9381/18/9/309
- E. Cuoco et al., Noise parametric identification and whitening for LIGO 40-m interferometer data, Phys. Rev. D 64, 122002 (2001). 10.1103/PhysRevD.64.122002
CITATION.cff in this repository carries the same list in machine-readable
form; GitHub's Cite this repository button reads it.
Requirements
p4TSA is not a pure-Python package: building it compiles the C++ core into a
single Python extension module. It depends on a few native libraries:
| Library | Role | Needed at |
|---|---|---|
| GSL (+ gslcblas) | linear algebra / numerics | build and run |
| FFTW3 (double, float, long-double) | FFTs | build and run |
| FrameL / libframel | LIGO/Virgo frame I/O | build and run |
| Boost (headers only — Boost.uBLAS) | matrix/vector templates | build only |
| Cereal (headers only) | binary serialization (AR/lattice-filter persistence) | build only |
The wheels on PyPI carry GSL, FFTW3 and FrameL inside them, so this table matters only when building from source. All of it is on conda-forge.
Installation with pip (Linux)
pip install py4tsa
python -c "import py4tsa; print(py4tsa.__file__)"
The wheels are manylinux_2_28_x86_64, for CPython 3.10 to 3.14.
Elsewhere — macOS, Windows, another architecture — pip falls back to the source distribution, which compiles the C++ core and needs the libraries above; use conda there.
Installation with conda
Option A — install a pre-built package
If a built package has been published to a conda channel, install it directly
(replace <channel> with the channel it was uploaded to):
conda install -c conda-forge -c <channel> py4tsa
The importable module is py4tsa:
python -c "import py4tsa; print('py4TSA ready')"
Option B — build from source with conda-build
The repository ships a conda recipe under conda-recipe/. The native
dependencies live on conda-forge, which must be enabled with strict channel
priority, otherwise conda resolves against defaults (where framel,
libframel and libboost-headers do not exist).
The build follows the Python of the environment you activate, so py4tsa always
matches the interpreter you use — no fixed pin, no version mismatch at install
time.
# 1. install conda-build in the base environment
conda install -n base conda-build
# 2. enable conda-forge with strict priority (once)
conda config --add channels conda-forge
conda config --set channel_priority strict
# 3. activate the environment you want to use py4tsa in (or create it),
# then build FOR that environment's Python:
conda activate <your-env>
PYVER=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
conda build conda-recipe/ -c conda-forge --python=$PYVER
# 4. install into the same environment
conda install -c conda-forge --use-local py4tsa
--python=$PYVERcompiles the package exactly for the active environment's Python. If that environment uses a pre-release Python, conda-forge may not yet provide builds of the dependencies — in that case use an environment with a stable Python.
Build and install the py4tsa Python module
The C++ sources are compiled with CMake into a Python extension module named
py4tsa. Build and install it for the currently active Python environment with:
conda install -c conda-forge cmake make compilers pybind11 gsl fftw framel libboost-headers cereal
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX"
cmake --build build -j"$(nproc)"
cmake --install build
CMake may install the compiled extension in the environment prefix. Move it to
the active Python site-packages directory if necessary:
PYTHON_SITE=$(python -c "import sysconfig; print(sysconfig.get_paths()['platlib'])")
mv "$CONDA_PREFIX"/py4tsa*.so "$PYTHON_SITE"/
Verify the installation with:
python -c "import py4tsa; print(py4tsa.__file__)"
Reinstalling after changing the C++ sources
A rebuild does not by itself change what import py4tsa loads. Repeat the build
and install, and check that the module Python resolves is the one just built:
cmake --build build -j"$(nproc)"
cmake --install build
PYTHON_SITE=$(python -c "import sysconfig; print(sysconfig.get_paths()['platlib'])")
mv "$CONDA_PREFIX"/py4tsa*.so "$PYTHON_SITE"/
md5sum build/py4tsa*.so "$PYTHON_SITE"/py4tsa*.so
The two checksums must match. If they differ, the interpreter is still loading the previous build and any change to the C++ will appear not to have taken effect -- a failure that looks like a bug in the code rather than in the install.
A .so placed in site-packages this way takes precedence over an editable
install (pip install -e .), which resolves the module through a .pth file
instead. Having both means the copied file wins and rebuilds stop taking effect
silently, so pick one: either move the file after each build, as above, or use
the editable install and delete the copy in site-packages.
Installation with pip
pip builds the C++ extension from source, so the native libraries and the
Boost headers must already be present in the environment. The simplest way to
provide them is a conda environment:
conda install -c conda-forge gsl fftw framel libboost-headers cereal
pip install .
To build a wheel instead of installing in place:
pip install build
python -m build --wheel # -> dist/py4tsa-3.3.0-*.whl
Running the tests
pip install pytest
pytest python-wrapper/tests/ -v
Runs on every push/PR via GitHub Actions (Python 3.10-3.12).
Changelog
2.2.0 (2026-08-03)
- Contact info updated:
elena.cuoco@unibo.itreplacing the retiredego-gw.itaddress everywhere it appeared (source headers, README, docs); Giancarlo Cella dropped as a docs team contact. - Missing docs page added for
ExtraWaveletFamilies.hpp(Coiflet/Symlet bases below) — it had doxygen comments but no Sphinx page since it was introduced. - CI Node.js 20 deprecation cleared:
actions/checkoutv4→v5,mamba-org/setup-micromambav1→v3 (both now Node 24-native). test_02_persistence.pyno longer depends onwdf: builds itsSeqViewfixture with py4tsa's ownSeqView_double_t/FillPointinstead ofwdf.structures.array2SeqView, which isn't installed in this repo's CI.- WDF trigger SNR statistic fixed:
EventFullFeatured::mSigmanow exposes the winning wavelet basis's own per-window sigma across the C++/Python boundary (was previously recomputed downstream from a separate, staler sigma convention). The candidate wavelet-basis list dropped the 3 biorthogonal B-spline bases (not L2-energy-preserving, let them win basis selection spuriously even on pure noise). - Candidate wavelet-basis list redesigned and trimmed (
WDF2Classify/WDF2Reconstruct, 19 → 10 bases): dropped redundant plain/centered Daubechies duplicates (same filter taps, just phase-shifted), added Coiflet (order 1, 2) and Symlet (order 4, 8) — genuinely new basis shapes, plugged into GSL's own extensiblegsl_wavelet_typemechanism (no new external wavelet library, no GSL patching). Seeinclude/ExtraWaveletFamilies.hpp. eternity(1999-2003 vendored XML persistence) removed entirely, replaced with Cereal (header-only, actively maintained; newcerealconda-forge dependency). Seeinclude/CerealPersistence.hpp.- Legacy pre-packaging-build files removed:
bind.sh,install_dependencies.sh,install_full_dependencies.sh,python-wrapper/CMakeLists.txt(an orphaned separate build script from before this repo's CMake packaging build, unused by it). - CI moved from Travis to GitHub Actions (
.github/workflows/ci.yml) — Travis's free tier for open source was retired years ago, and its old config predated the current build system.
Contributing
Changes reach master through pull requests only, and a pull request merges
only once CI is green. See CONTRIBUTING.md for how to build
and test locally, what CI checks, and the invariants a change to the detection
filter must preserve.
Who do I talk to?
- Repo owner / admin: info@elenacuoco.com
- Team contacts: elena.cuoco@unibo.it
License
GPL-3.0-or-later. See LICENSE.
Release files for py4tsa 3.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py4tsa-3.3.0.tar.gz | 2.1 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| py4tsa-3.3.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 | Details |
| py4tsa-3.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| py4tsa-3.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| py4tsa-3.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| py4tsa-3.3.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 | Details |
Total release size: 24.3 MB
Release files / py4tsa-3.3.0.tar.gz
| Download URL | py4tsa-3.3.0.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95477abc031381cec4d0303646ec7400a348f65e4a7d7ab74a615989f3724811
|
|
BLAKE2b-256 checksum How to use checksums |
9ab33de68c88b769dd8e7302bda2492c541c4c6767da85abddd0ff4543707743
|
| 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 18, 2026.
Transparency logRelease files / py4tsa-3.3.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py4tsa-3.3.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
85bad2420e67c66f54e58fa4f174153762dda3cf45b47d1a68433ddb20f88ced
|
|
BLAKE2b-256 checksum How to use checksums |
9027244b75ceb262c11035539e25b2e0c714e4df9fabfd4b856ca812d503fe35
|
| 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 18, 2026.
Transparency logRelease files / py4tsa-3.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py4tsa-3.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8f33f50a7a546f4f9f6e6814fb214026de162050c815775d65834115a63cf68d
|
|
BLAKE2b-256 checksum How to use checksums |
b72d303d22dddabe37a4ecfb20a959515c4f6d04b6cf77f5fe23951f4ed72769
|
| 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 18, 2026.
Transparency logRelease files / py4tsa-3.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py4tsa-3.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
57377e05b45bd27d892824b5d6290220bea05bbcaf7e8fc3a9a463094ae4bf2e
|
|
BLAKE2b-256 checksum How to use checksums |
6f0a696318aa1810ef7ddce58a1d8d2ce0cf1665c987ec76a519dd2d89aa954c
|
| 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 18, 2026.
Transparency logRelease files / py4tsa-3.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py4tsa-3.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
43d58fb362dcc3e623a9782761242ba299505d86fe8144e0c41c94e1c95b44f4
|
|
BLAKE2b-256 checksum How to use checksums |
75ebb4b781151a6f67c39b43149ed169231c0eff39c70891d5751466f922959f
|
| 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 18, 2026.
Transparency logRelease files / py4tsa-3.3.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py4tsa-3.3.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9263d5f0ae8f80e8868497ffdc6ab3908a469f6705ad03bf2df228c91e23235e
|
|
BLAKE2b-256 checksum How to use checksums |
3875ea47bf38a311945f4fe9fe1e68c2729cacb10995149aef2f25ab8671fe85
|
| 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 18, 2026.
Transparency log