Metadata-Version: 2.4
Name: gwmock-pop
Version: 0.5.1
Summary: A python package for simulating populations of gravitational-wave sources.
Project-URL: Documentation, https://leuven-gravity-institute.github.io/gwmock-pop/
Project-URL: Source, https://github.com/Leuven-Gravity-Institute/gwmock-pop
Project-URL: Tracker, https://github.com/Leuven-Gravity-Institute/gwmock-pop/issues
Project-URL: Home, https://github.com/Leuven-Gravity-Institute/gwmock-pop
Project-URL: Release Notes, https://github.com/Leuven-Gravity-Institute/gwmock-pop/releases
Author: Isaac C. F. Wong
License: Copyright (c) 2026, Leuven Gravity Institute
        
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without modification,
        are permitted provided that the following conditions are met:
        
            * Redistributions of source code must retain the above copyright notice,
              this list of conditions and the following disclaimer.
            * Redistributions in binary form must reproduce the above copyright notice,
              this list of conditions and the following disclaimer in the documentation
              and/or other materials provided with the distribution.
            * Neither the name of gwmock-pop nor the names of its contributors
              may be used to endorse or promote products derived from this software
              without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
        "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
        LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
        A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
        CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
        EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
        PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
        PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
        LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
        NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
        SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.12
Requires-Dist: h5py>=3.16.0
Requires-Dist: jax>=0.10.0
Requires-Dist: networkx>=3.6.1
Requires-Dist: pydantic>=2.13.3
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: ruyaml>=0.91.0
Requires-Dist: typer>=0.24.2
Description-Content-Type: text/markdown

# gwmock-pop

[![Python CI](https://github.com/Leuven-Gravity-Institute/gwmock-pop/actions/workflows/CI.yml/badge.svg)](https://github.com/Leuven-Gravity-Institute/gwmock-pop/actions/workflows/CI.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Leuven-Gravity-Institute/gwmock-pop/main.svg)](https://results.pre-commit.ci/latest/github/Leuven-Gravity-Institute/gwmock-pop/main)
[![Documentation Status](https://github.com/Leuven-Gravity-Institute/gwmock-pop/actions/workflows/documentation.yml/badge.svg)](https://leuven-gravity-institute.github.io/gwmock-pop/)
[![codecov](https://codecov.io/gh/leuven-gravity-institute/gwmock-pop/graph/badge.svg?token=Vwf7NYTHCm)](https://codecov.io/gh/leuven-gravity-institute/gwmock-pop)
[![PyPI Version](https://img.shields.io/pypi/v/gwmock-pop)](https://pypi.org/project/gwmock-pop/)
[![Python Versions](https://img.shields.io/pypi/pyversions/gwmock-pop)](https://pypi.org/project/gwmock-pop/)
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](LICENSE)
[![Security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
[![DOI](https://zenodo.org/badge/1147941311.svg)](https://doi.org/10.5281/zenodo.18574076)
[![SPEC 0 — Minimum Supported Dependencies](https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038)](https://scientific-python.org/specs/spec-0000/)

`gwmock-pop` is a Python package for simulating populations of
gravitational-wave sources.

## Current Package Surface

- Protocol-first simulator interface via `GWPopSimulator`:
    - `source_type: str` (non-empty routing key)
    - `simulate(n_samples, **kwargs) -> Mapping[str, jax.Array]`
    - each returned parameter array is 1-D with length `n_samples`
- Core simulator implementations:
    - `GraphSimulator` (config-driven dependency graph)
    - `CBCPriorSimulator` (lightweight analytic CBC priors)
- External catalogue loader:
    - `FilePopulationLoader` for CSV/HDF5
    - supports structured HDF5 datasets and group-of-datasets layouts

## Requirements

- Python `>=3.12` (tested on 3.12-3.14)
- Linux, macOS, or Windows

## Installation

Install from PyPI:

```bash
uv venv --python 3.12
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install gwmock-pop
```

Install from source:

```bash
git clone git@github.com:Leuven-Gravity-Institute/gwmock-pop.git
cd gwmock-pop
uv venv --python 3.12
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv sync --no-dev
```

Developer setup:

```bash
uv sync --group dev
uv run pre-commit install
```

Docs setup:

```bash
uv sync --group docs
uv run zensical serve
```

## Quick Start (CLI)

Create `population.yaml`:

```yaml
run:
    name: demo_population
    mode: fixed_n_samples
    n_samples: 100
    seed: 42
    output:
        directory: outputs
        format: csv
        overwrite: true

parameters:
    mass_1:
        sampler:
            function: gwmock_pop.samplers.planck_tapered_broken_power_law_plus_two_peaks
            arguments:
                alpha_1: 1.72
                alpha_2: 4.51
                transition: 35.6
                minimum: 5.06
                maximum: 300.0
                mean_1: 9.76
                sigma_1: 0.649
                mean_2: 32.8
                sigma_2: 3.92
                taper_range: 4.32
                lambda_0: 0.361
                lambda_1: 0.586
```

Run:

```bash
gwmock-pop simulate population.yaml
```

## Verification

```bash
gwmock-pop --help
python -c "import gwmock_pop; print(gwmock_pop.__version__)"
```

## Testing

Default test run excludes `integration`-marked tests:

```bash
uv run pytest
```

Run integration/smoke tests explicitly:

```bash
uv run pytest -m integration
```

## Documentation

- Docs home:
  [https://leuven-gravity-institute.github.io/gwmock-pop/](https://leuven-gravity-institute.github.io/gwmock-pop/)
- API reference: [docs/api/index.md](docs/api/index.md)

## License

BSD 3-Clause, see [LICENSE](LICENSE).
