Skip to main content

gwmock

Python CI pre-commit.ci status Documentation Status codecov PyPI Version Python Versions License: GPL-3.0-or-later Ruff DOI

A Python package for generating Mock Data Challenge (MDC) datasets for the gravitational-wave (GW) community. It simulates strain data for detectors like Einstein Telescope, providing a unified interface for reproducible GW data generation.

Features

  • Modular Design: Uses mixins for flexible simulator composition
  • Detector Support: Built-in support for various GW detectors with custom configuration options
  • Waveform Generation: Integrates with PyCBC and LALSuite for accurate signal simulation
  • Noise Models: Colored and correlated noise, spectral lines, and detector glitches via the gwmock-noise package
  • Population Models: Handles injection populations for signals and glitches
  • Data Formats: Outputs in standard GW formats (GWF frames)
  • CLI: Command-line tools for easy simulation workflows

Installation

We recommend using uv to manage virtual environments for installing gwmock. The commands below use uv, but gwmock is a regular PyPI package that also installs fine with plain pip in any environment.

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

Without uv (venv or Conda)

If you prefer not to use uv, install with plain pip in a standard virtual environment:

# venv
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install gwmock
# Conda
conda create -n gwmock python=3.13
conda activate gwmock
pip install gwmock

Note: The package requires Python 3.13 or later and is built and tested against Python 3.13–3.15. When creating a virtual environment with uv, specify the Python version to ensure compatibility: uv venv --python 3.13 (replace 3.13 with your preferred supported version: 3.13, 3.14 or 3.15). HDF5 and frame (GWF) files need the hdf5 and gwpy extras (pip install "gwmock[hdf5,gwpy]"), which may not install on Python 3.15 yet; NumPy (.npy) output needs neither.

From PyPI

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

From Source

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

Quick Start

Command Line

# Generate simulated data
gwmock simulate config.yaml

Interactive Configuration Editor

For an easier configuration experience, use the interactive editor:

gwmock config --interactive

The interactive editor provides:

  • Live configuration preview with real-time updates
  • Autocomplete suggestions for commands and values
  • Command history navigation (Up/Down arrows)
  • Built-in templates for common simulation types
  • Script generation for SLURM and local execution
  • Immediate validation feedback

Use /help inside the editor to see all available commands, or /template to start with a preset configuration. To modify an existing configuration:

gwmock config --interactive --load existing_config.yaml

Configuration

gwmock uses YAML configuration files for reproducible simulations. New runs use the adapter-backed orchestration surface, which keeps backend selection explicit and lets third-party packages plug in through public protocols.

Key configuration sections:

Section Purpose
globals Shared orchestration parameters such as sampling rate, segment duration, start time, and output roots
orchestration.population Public population backend, source type, sample count, and backend arguments
orchestration.signal Public signal backend, detector network, waveform model, and output settings
orchestration.noise Public noise backend, generation arguments, and output settings

Example:

globals:
    working-directory: .
    output-directory: output
    metadata-directory: metadata
    simulator-arguments:
        sampling-frequency: 4096
        duration: 1024
        start-time: 1577491218
        total-duration: 5 hours

orchestration:
    population:
        backend: FilePopulationLoader
        source-type: bbh
        n-samples: 1
        arguments:
            path: https://raw.githubusercontent.com/Leuven-Gravity-Institute/gwmock/main/examples/signal/bbh_population.csv
    signal:
        detectors:
            - H1
        waveform-model: IMRPhenomXPHM
        minimum-frequency: 20
        output:
            output_directory: signal
            file_name: signal-{{ counter }}.gwf
            arguments:
                channel: H1:STRAIN
    noise:
        output:
            output_directory: noise
            file_name: noise-{{ counter }}.gwf

Third-party backends can be exposed through an entry point or referenced directly as module:Class, as long as they satisfy the public protocol for the relevant section. See docs/user-guide/protocols.md, docs/user-guide/orchestration.md, and docs/user-guide/extensibility.md for the protocol model and integration details.

Documentation

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

Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a merge 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:

uv run pytest

License

This project is licensed under GPL-3.0-or-later. See the LICENSE file for the full license text.

gwmock is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

gwmock is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with gwmock. If not, see https://www.gnu.org/licenses/.

Support

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

Metadata

Release files for gwmock 0.18.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gwmock 0.18.1
File Size Uploaded Provenance Actions
gwmock-0.18.1.tar.gz 668.8 kB Without provenance Details for gwmock-0.18.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gwmock 0.18.1
File Interpreter ABI Platform Actions
gwmock-0.18.1-py3-none-any.whl Python 3 none any Details for gwmock-0.18.1-py3-none-any.whl

Total release size: 1.0 MB

Release files / gwmock-0.18.1.tar.gz

Download URL gwmock-0.18.1.tar.gz
Size 668.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bb15b1383fb4f630b86d324d8a5fb7162c41820484a5c7280d0149ad274c2be4
BLAKE2b-256 checksum
How to use checksums
86770d4f648bf7b7e3e2f78efb067dbba34bfaebbaa4f1c0188c2490142ad65d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}

Release files / gwmock-0.18.1-py3-none-any.whl

Download URL gwmock-0.18.1-py3-none-any.whl
Size 334.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
155c8957adb333f8298dfd299a918a99301dd018bd3f0b7c524fa2fe9669a2f4
BLAKE2b-256 checksum
How to use checksums
fa7a9964be3e24581e0da4f8cae97ec7701d971e317397c46af86c0e09f81b42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}

Security for gwmock 0.18.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.18.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page