Metadata-Version: 2.4
Name: SUGC
Version: 0.1.1
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Dist: numpy>=1.23
Requires-Dist: matplotlib>=3.8
License-File: LICENSE
Summary: Sparse Unbiased Galaxy Clustering - high-performance hybrid Rust/Python correlation functions
Author-email: Oscar Hickman <oscar.hickman17@alumni.imperial.ac.uk>
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Bug Tracker, https://github.com/OscarHickman/SUGC/issues
Project-URL: Homepage, https://github.com/OscarHickman/SUGC
Project-URL: Repository, https://github.com/OscarHickman/SUGC

# SUGC

[![PyPI version](https://img.shields.io/pypi/v/sugc.svg)](https://pypi.org/project/sugc/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Correlation function counters for galaxy catalogues drawn from sparse partitions of periodic N-body simulations. Written in Rust with a Python interface via PyO3.

Supports real-space ξ(r), redshift-space ξ(s, μ) multipoles, and high-order N-point functions (N ≥ 3). Pair counts are corrected for the statistical under-sampling that arises when working with m-of-k independent partitions of a simulation box.

## Installation

```bash
# pip / uv
uv add sugc

# conda
conda install -c conda-forge sugc
```

## Usage

```python
import numpy as np
from sugc import count_pairs_1d

coords = np.random.uniform(0, 500.0, size=(100_000, 3))
partition_ids = np.zeros(100_000, dtype=np.int32)  # single partition
r_bins = np.linspace(0.1, 50.0, 20)

counts, weights = count_pairs_1d(coords, partition_ids, r_bins, box_size=500.0)
```

See `examples/` for redshift-space distortions and 3-point correlation functions.

## Citation

If you use this in published work, please cite:

> Hickman, O. et al. (2026). *Fast and Unbiased Clustering Estimators for Sparse Partitions.* (In Prep).

A `CITATION.cff` is included for software citation via GitHub or Zenodo.

## License

MIT — see [LICENSE](LICENSE).

