Installation

  1. Requirements
  2. Installing from source
  3. Conda environments
  4. Verifying the installation
  5. Version information

Requirements

gwnr targets Python 3 and builds on the LIGO/Virgo software stack. The heavyweight dependencies are:

  • PyCBC — waveform generation, matched filtering, types (TimeSeries, FrequencySeries)
  • LALSuite — LAL waveform approximants and constants
  • Bilby — Bayesian inference (used by the stats and workflow subpackages)
  • lscsoft-glue — LIGO_LW XML tables and HTCondor DAG utilities

plus the standard scientific stack: numpy, scipy, matplotlib, pandas, h5py, astropy, scikit-learn, seaborn, statsmodels, romspline, numexpr, and pyswarm (particle-swarm optimization, used by the fitting-factor machinery).

The full list is in requirements.txt and setup.py.

Some optional features shell out to external software that must be installed separately: HTCondor (workflow DAGs), ParaView (graph.paraview), the SpECTRE code (nr.spectre), and SXS/SpEC post-processing tools (waveform.prepare_waveforms).

Installing from source

git clone https://github.com/gwnr/gwnr.git
cd gwnr
pip install -r requirements.txt
python setup.py install        # or: pip install .

For development, use an editable install instead:

pip install -e .

The installed Python package is named gwnr (the repository and project are called gwnr):

import gwnr
print(gwnr.get_version_information())

Conda environments

Because LALSuite and PyCBC ship compiled extensions, the most reliable route is a conda environment with dependencies from conda-forge:

conda create -n gwnr python=3.10
conda activate gwnr
conda install -c conda-forge lalsuite pycbc bilby astropy h5py \
    matplotlib pandas scikit-learn scipy seaborn statsmodels
pip install lscsoft-glue romspline numexpr "pyswarm @ git+https://github.com/tisimst/pyswarm@master"
git clone https://github.com/gwnr/gwnr.git && cd gwnr && pip install .

Verifying the installation

import gwnr
import gwnr.waveform as gwf
import gwnr.analysis as gan

# List the detector noise curves shipped with the package
from gwnr.data import available_gw_noise_curves
print(available_gw_noise_curves())

Installed command-line tools (e.g. gwnr_banksim, gwnr_faithsim, gwnr_create_bank_workflow) should be on your PATH; see the CLI reference.

Version information

The package version is stamped at build time from git metadata into gwnr/.version (see write_version_file() in setup.py); at run time gwnr.get_version_information() reads that file back. Versions follow a calendar scheme (e.g. v2021.09.20).


Copyright © Prayush Kumar. Distributed under the GPL license.

This site uses Just the Docs, a documentation theme for Jekyll.