Skip to main content

pytides-py3

Tidal analysis and prediction library for Python 3.10+. An improved fork of the original pytides, updated for NumPy 2.x and modern SciPy.

Installation

pip install pytides-py3

Or with UV:

uv add pytides-py3

Quick Start

from datetime import datetime, timedelta
from pytidespy3 import Tide, constituent

# Build a model from known constituents
model = Tide(
    constituents=[constituent._M2, constituent._S2, constituent._K1],
    amplitudes=[1.0, 0.5, 0.3],
    phases=[0.0, 90.0, 180.0],
)

# Predict tidal heights
times = [datetime(2023, 1, 1) + timedelta(hours=i) for i in range(24)]
heights = model.at(times)

# Get high/low water times
highs = list(model.highs(datetime(2023, 1, 1), datetime(2023, 1, 8)))
lows = list(model.lows(datetime(2023, 1, 1), datetime(2023, 1, 8)))

# Decompose observed data into harmonic constituents
fitted = Tide.decompose(heights=observed_heights, t=observed_times)

Main Features

  • Tidal analysis and prediction via Schureman's harmonic constituent method
  • 37 NOAA harmonic constituents (M2, S2, K1, O1, N2, etc.)
  • Robust fitting: NaN/inf auto-removal, weighted least squares, robust loss functions (huber, soft_l1, cauchy, arctan)
  • High/low water prediction with highs(), lows(), extrema()
  • Tide classification: form number-based (semidiurnal, mixed, diurnal)

Requirements

  • Python >= 3.10, < 3.14
  • NumPy >= 2.2.6
  • SciPy >= 1.15.3

Development

uv sync
uv run python -m unittest discover -s tests -v
uv build

Python version matrix test with uv:

bash scripts/test-python-matrix.sh

Supported-only or experimental-only runs are also available:

bash scripts/test-python-matrix.sh --supported-only
bash scripts/test-python-matrix.sh --experimental-only

References

  • Original pytides: https://github.com/sam-cox/pytides
  • Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides. U.S. Coast and Geodetic Survey, Special Publication No. 98.
  • Meeus, J. (1991). Astronomical Algorithms. Willmann-Bell.

License

MIT

Metadata

Release files for pytides-py3 0.8.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 pytides-py3 0.8.1
File Size Uploaded Provenance Actions
pytides_py3-0.8.1.tar.gz 29.4 kB Without provenance Details for pytides_py3-0.8.1.tar.gz

Built distribution (wheel)

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

Total release size: 49.3 kB

Release files / pytides_py3-0.8.1.tar.gz

Download URL pytides_py3-0.8.1.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5db7af8ed7a7d6f8f503a1b42e04d5bbed770117a151d3c2ed94b73e20bae87f
BLAKE2b-256 checksum
How to use checksums
79017f6e718378a9b66ccb4926ee6af9349b47ee9ae2850db2a8d23444cb8c34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pytides_py3-0.8.1-py3-none-any.whl

Download URL pytides_py3-0.8.1-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e830b61d8c2ac95ccec9994b42cd09a63e6f1d6a60ff2c8b5da7f7d36e526cac
BLAKE2b-256 checksum
How to use checksums
d952c8cae7df683992c5075e15252db2c7d9c102ecb61bbf0dc25763e268b15b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pytides-py3 0.8.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.

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