Installation¶
GWFrames requires Python 3.11 or newer, on Linux or macOS. Binary wheels for Linux and macOS (x86_64 and arm64) are published on PyPI.
The HDF5 functions (ReadFromH5, OutputToH5, ReadFromNRAR, and
OutputToNRAR) and the GWFrames.Extrapolation module need
h5py. PyPI has no h5py wheels for Python
3.15, and there may never be any, so on Python 3.15 and newer GWFrames
is installed without h5py; everything else works without it. If you
need those functions, either use Python 3.14 or older with uv or
pip, or get h5py from conda-forge with pixi or mamba, which do
build it for Python 3.15.
With uv or pip¶
uv add GWFrames # in a uv project
uv pip install GWFrames # or in any virtual environment
pip install GWFrames # or with pip
With uv, adding --python 3.14 to uv init or uv venv selects a
Python for which h5py is available.
To install the latest code from GitHub, or on any platform without a wheel, GWFrames is compiled from source. That needs a C++ compiler, GSL, and FFTW, which are available from most package managers:
sudo apt-get install libgsl-dev libfftw3-dev # Debian or Ubuntu
brew install gsl fftw # macOS with Homebrew
after which
uv pip install "git+https://github.com/moble/GWFrames"
builds and installs it. (The submodules are fetched automatically.)
If GSL or FFTW is installed somewhere unusual, set CMAKE_PREFIX_PATH
to its prefix.
With pixi¶
pixi can take NumPy, SciPy, and h5py from conda-forge and GWFrames itself from PyPI:
pixi init my-project
cd my-project
pixi add python numpy scipy h5py
pixi add --pypi GWFrames
pixi run python -c 'import GWFrames; print(GWFrames.__version__)'
With mamba or conda¶
Similarly, the dependencies can come from conda-forge and GWFrames from PyPI:
mamba create -n gwframes -c conda-forge python numpy scipy h5py
mamba activate gwframes
python -m pip install GWFrames
To build the latest code from GitHub instead, all of the build requirements are available from conda-forge:
mamba create -n gwframes -c conda-forge python numpy scipy h5py gsl fftw \
cxx-compiler cmake ninja pkg-config pybind11 scikit-build-core
mamba activate gwframes
python -m pip install --no-deps --no-build-isolation "git+https://github.com/moble/GWFrames"
On Apple Silicon, make sure that the environment is native: mamba info should show platform : osx-arm64. Older instructions for
GWFrames recommended Intel environments (with CONDA_SUBDIR=osx-64 or
a subdir: osx-64 setting), which run under Rosetta. The first build
in such an environment can fail with “Accessing CMake timed out” while
Rosetta translates CMake; running the same command again works.
Checking the installation¶
python -c 'import GWFrames; W = GWFrames.PNWaveform("TaylorT4", 0.0, [0., 0., 0.9], [0.0, 0.0, 0.9], 0.01); print("That worked!")'