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: MIT Security: bandit DOI

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

Installation

We recommend using uv to manage virtual environments for installing gwmock-pop.

If you don't have uv installed, you can install it with pip. See the project pages for more details:

  • Install via pip: pip install --upgrade pip && pip install uv
  • Project pages: uv on PyPI | uv on GitHub
  • Full documentation and usage guide: uv docs

Requirements

  • Python 3.10 or higher
  • Operating System: Linux, macOS, or Windows

Note: The package is built and tested against Python 3.10-3.12. When creating a virtual environment with uv, specify the Python version to ensure compatibility: uv venv --python 3.10 (replace 3.10 with your preferred version in the 3.10-3.12 range). This avoids potential issues with unsupported Python versions.

Install from PyPI

The recommended way to install gwmock-pop is from PyPI:

# Create a virtual environment (recommended with uv)
uv venv --python 3.10
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install gwmock-pop

Optional Dependencies

For development or specific features:

# Development dependencies (testing, linting, etc.)
uv pip install gwmock-pop[dev]

# Documentation dependencies
uv pip install gwmock-pop[docs]

# All dependencies
uv pip install gwmock-pop[dev,docs]

Install from Source

For the latest development version:

git clone git@github.com:Leuven-Gravity-Institute/gwmock-pop.git
cd gwmock-pop
# Create a virtual environment (recommended with uv)
uv venv --python 3.10
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install .

Development Installation

To set up for development:

git clone git@github.com:Leuven-Gravity-Institute/gwmock-pop.git
cd gwmock-pop

# Create a virtual environment (recommended with uv)
uv venv --python 3.10
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install ".[dev]"

# Install the commitlint dependencies
npm install

# Install pre-commit hooks
pre-commit install
pre-commit install --hook-type commit-msg

Verify Installation

Check that gwmock-pop is installed correctly:

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

Documentation

Full documentation to be available at https://leuven-gravity-institute.github.io/gwmock-pop.

Quick Start with the CLI

The current MVP CLI supports fixed-size population generation through GraphSimulator.

Create a configuration file such as 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 the simulator:

gwmock-pop simulate population.yaml

This writes outputs/demo_population.csv. For the MVP, the CLI only supports run.mode: fixed_n_samples.

Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Release Schedule

Releases follow a fixed schedule: every Tuesday at 00:00 UTC, unless an emergent bugfix is required. This ensures predictable updates while allowing flexibility for critical issues. Users can view upcoming changes in the draft release on the GitHub Releases page.

Testing

Run the test suite:

pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For questions or issues, please open an issue on GitHub or contact the maintainers.

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.3.1.tar.gz (198.9 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.3.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gwmock_pop-0.3.1.tar.gz
  • Upload date:
  • Size: 198.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gwmock_pop-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e8f2567110687929a0ef41c47eb6e634600e1bb307a83555640651768df666e2
MD5 2913e0bc670cc1983f3f381af4e80390
BLAKE2b-256 d445209cb4025cc6f272a59d2859a26e203740500de855cef9e645ac49342fc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwmock_pop-0.3.1.tar.gz:

Publisher: create_tag.yml on Leuven-Gravity-Institute/gwmock-pop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: gwmock_pop-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gwmock_pop-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f3d4030641bb4985d4be6d72efd384e6907175544ab6e01687cfd0fe1f37ebe
MD5 7ef8eb4176c76985d22d764ae0401dda
BLAKE2b-256 6001c3c336cd29ee103a27df768f000f46d4f8a1328b900b9e739262dda3477c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwmock_pop-0.3.1-py3-none-any.whl:

Publisher: create_tag.yml on Leuven-Gravity-Institute/gwmock-pop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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