Skip to main content

A python package for simulating populations of gravitational-wave sources.

Project description

gwmock-pop

Python CI pre-commit.ci status Documentation Status codecov PyPI Version Python Versions License Security: bandit DOI SPEC 0 — Minimum Supported Dependencies

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:

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

Install from source:

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:

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

Docs setup:

uv sync --group docs
uv run zensical serve

Quick Start (CLI)

Create population.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:

gwmock-pop simulate population.yaml

Verification

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

Testing

Default test run excludes integration-marked tests:

uv run pytest

Run integration/smoke tests explicitly:

uv run pytest -m integration

Documentation

License

BSD 3-Clause, see LICENSE.

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

gwmock_pop-0.5.0.tar.gz (189.1 kB view details)

Uploaded Source

Built Distribution

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

gwmock_pop-0.5.0-py3-none-any.whl (55.8 kB view details)

Uploaded Python 3

File details

Details for the file gwmock_pop-0.5.0.tar.gz.

File metadata

  • Download URL: gwmock_pop-0.5.0.tar.gz
  • Upload date:
  • Size: 189.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gwmock_pop-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1f0353d9f46e98bf2e2cca699cd4e0f6411e0b1c22b9a629b4278c34a3029b46
MD5 2e9405a22f15a0722a4ee33238b197fd
BLAKE2b-256 2237c1bc0e9802889fc9884a47c999e7a9c121aa11d1f221c99c547c31a3b83d

See more details on using hashes here.

File details

Details for the file gwmock_pop-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: gwmock_pop-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 55.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gwmock_pop-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f33e8df4c8364f5a65ac86415e41a75ef6cee40325221f42a832d78c3541a0a5
MD5 4541f4560655fa36cc71f2467406d4cc
BLAKE2b-256 cd321f994804b7583d93f9e3c9f031b8a92735426e9d6fe149f82f87657a34b6

See more details on using hashes here.

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