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.4.1.tar.gz (205.0 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.4.1-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gwmock_pop-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9c559d750911a80dbf4087289808812dbca9735b74615a6e88a94f6c1ae8af10
MD5 8766db6d23f80497364bf878d2b7b239
BLAKE2b-256 f8e764ddee1abf1f4fa854376fae4a2077052bfa463a42ec2051482496ff91b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwmock_pop-0.4.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.4.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for gwmock_pop-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46794d85daaaf411194431314380c8170f466d9c42b63dcac2c8fff150700bc5
MD5 4b8ed84fe4297b22f2c99274a5fd8525
BLAKE2b-256 49627c4abc2f3a13b675c3fcfad3abddbef672141d6ce8e8cab84277c7331d10

See more details on using hashes here.

Provenance

The following attestation bundles were made for gwmock_pop-0.4.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