Skip to content

Latest commit

 

History

History
77 lines (51 loc) · 2.91 KB

File metadata and controls

77 lines (51 loc) · 2.91 KB

Installation

This guide walks you through installing PyGTide, verifying the installation, and updating its internal data files.

Prerequisites

Requirement Details
Python ≥ 3.10 (pre-compiled wheels available for CPython 3.12–3.14)
Package manager Anaconda or Miniconda recommended, but any pip works
Fortran compiler Only needed for source builds (Python 3.10/3.11), e.g. gfortran

Option 1: Install from PyPI (recommended)

pip install pygtide

Pre-compiled wheels are provided for Linux, macOS and Windows on Python 3.12 and newer — no compiler required. On Python 3.10 and 3.11, pip automatically builds from the source distribution instead, which requires a Fortran compiler (see Option 2). NumPy and pandas are installed automatically as dependencies.

To upgrade an existing installation:

pip install -U pygtide

Note

Always use the latest release. Several numerical bug fixes in the Fortran core (geodetic coefficients, shear strain, leap-second handling) were shipped in v0.9 and v0.9.1 — see Troubleshooting — Known issues by version.

Option 2: Build from source (Linux, macOS, Windows; Python >= 3.10)

Requirements for building:

  • A Fortran compiler (e.g. gfortran, via conda install gfortran or your system package manager)
  • Meson and ninja (installed automatically by pip)

Clone the repository and install:

git clone https://github.com/hydrogeoscience/pygtide.git
cd pygtide
pip install .

Warning

Keep the installation path reasonably short. Versions before v0.9.1 silently truncated data paths longer than ~244 characters; v0.9.1 raises a clear RuntimeError instead. See Troubleshooting.

Verify the installation

Run the bundled test suite:

python -c "import pygtide; pygtide.test(msg=True)"

The test compares a calculated strain series against a proven reference array and checks the M2 tidal frequency. You should see:

Successfully finished PyGTide tests!

Update the internal databases

PyGTide ships with data files for leap seconds (etddt.dat) and Earth orientation (etpolut1.dat) in its commdat subdirectory. Update them to the latest IERS/USNO data with:

python -c "import pygtide; pygtide.update()"

Note

The update requires an internet connection. If a download server is unreachable, the updater fails gracefully and the bundled (slightly older) files remain in use — see Troubleshooting — Database update fails.

Next steps