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.1.tar.gz (189.4 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.1-py3-none-any.whl (55.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gwmock_pop-0.5.1.tar.gz
  • Upload date:
  • Size: 189.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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.1.tar.gz
Algorithm Hash digest
SHA256 6e07a21d231c7deb25a7a5610cfae59cc765576d61fd534375a7dd3f183b4a4e
MD5 244fd3eb83010d3fdd41c1b378d06301
BLAKE2b-256 1702a03960ae4e4d7d88b45b2fe16a1d5e37bae3b42eefc1ff5c9f478816b925

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gwmock_pop-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 55.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e6e703d139d0e64a94f8d424bf93002aaafb5c2b7c854d280640b5b56f7a3e9
MD5 ede247634e328c01eee59fd12efb3d55
BLAKE2b-256 b12d1ff81f21750d512d6fb2b6bc07a20d93fd9a3fc525428536c65614e7629e

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