Skip to main content

Pastas: Analysis of Groundwater Time Series

image image image image image

image image image image

Pastas: what is it?

Pastas is an open source python package for processing, simulating and analyzing groundwater time series. The object oriented structure allows for the quick implementation of new model components. Time series models can be created, calibrated, and analysed with just a few lines of python code with the built-in optimization, visualisation, and statistical analysis tools.

Documentation & Examples

Quick Example

# Import Python packages
import pandas as pd
import pastas as ps

# Load head and meteorological observations into a pandas Series
obs = pd.read_csv("head.csv", index_col="datetime", parse_dates=["datetime"]).squeeze()
prec = pd.read_csv("prec.csv", index_col="datetime", parse_dates=["datetime"]).squeeze()
evap = pd.read_csv("evap.csv", index_col="datetime", parse_dates=["datetime"]).squeeze()

# Create and calibrate Pastas model
ml = ps.Model(obs, name="head")
sm = ps.RechargeModel(ml, prec, evap, rfunc=ps.Exponential(), name="recharge")
ml.solve()

# Visualize the model results
ml.plots.results()

image

Get in Touch

  • Questions on Pastas can be asked and answered on Github Discussions.
  • Bugs, feature requests and other improvements can be posted as Github Issues.
  • Pull requests will only be accepted on the development branch (dev) of this repository. Please take a look at the developers section on the documentation website for more information on how to contribute to Pastas.

Quick installation guide

To install Pastas, a working version of Python has to be installed on your computer. We recommend using uv to manage Python and your project dependencies. However, you are free to use any Python installation method you prefer. The Anaconda Distribution is another popular option.

Stable version

To get the latest stable version, use:

pip install pastas

Or with uv:

uv pip install pastas

Update

To update pastas, use:

pip install pastas --upgrade

Developers

To get the latest development version, use:

pip install git+https://github.com/pastas/pastas.git@dev#egg=pastas
  • Pastastore is a Python package for managing multiple timeseries and pastas models
  • Metran is a Python package to perform multivariate timeseries analysis using a technique called dynamic factor modelling.
  • Hydropandas can be used to obtain Dutch timeseries (KNMI, Dinoloket, ..)
  • PyEt can be used to compute potential evaporation from meteorological variables.

Dependencies

Pastas depends on a number of Python packages, of which all of the necessary are automatically installed when using the pip install manager. To know which dependencies exist, check the pyproject.toml file.

To install the most important optional dependencies (solver with LmFit and caching via cachetools) at the same time with Pastas use:

pip install pastas[full]

or for the development version use:

pip install git+https://github.com/pastas/pastas.git@dev#egg=pastas[full]

Pastas Sustaining membership

Funding is required to maintain Pastas and keep the software up-to-date. For this purpose, we call upon our community to contribute to this effort through our sustaining membership program. We will collect the sustaining membership contributions through Open Collective. The funds raised through the sustaining membership program will be used to support the development and maintenance of Pastas, as well as to fund new features and improvements to the software. For more information and to contribute, go to https://opencollective.com/pastas.

Pastas newsletter

To stay up-to-date with all things Pastas, receive news, event announcements, and more right into your e-mail inbox, please sign up for our quaterly newsletter here: https://hydroconsult.ch/pastas-newsletter-subscription/

How to Cite Pastas?

If you use Pastas in one of your studies, please cite the Pastas article in Groundwater:

To cite a specific version of Pastas, you can use the DOI provided for each official release (>0.9.7) through Zenodo. Click on the link to get a specific version and DOI, depending on the Pastas version.

  • Collenteur, R., Bakker, M., Caljé, R. & Schaars, F. (XXXX). Pastas: open-source software for time series analysis in hydrology (Version X.X.X). Zenodo. http://doi.org/10.5281/zenodo.1465866

Metadata

Release files for pastas 2.0.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 pastas 2.0.1
File Size Uploaded Provenance Actions
pastas-2.0.1.tar.gz 255.5 kB Without provenance Details for pastas-2.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 472.4 kB

Release files / pastas-2.0.1.tar.gz

Download URL pastas-2.0.1.tar.gz
Size 255.5 kB
Tags Source
SHA-256 checksum
How to use checksums
08ce11473338b2d66801f9ef7864b9dbd7ff29f15398d8d1b0824c50caed3595
BLAKE2b-256 checksum
How to use checksums
db284280374fa187d03fbfd31b0122d9f01a27511b49eaa0be9b9944b197bcfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pastas-2.0.1-py3-none-any.whl

Download URL pastas-2.0.1-py3-none-any.whl
Size 216.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97a1e338ac4e8578f17b48281b75f001b08ffbf15748ebd6291a6b47f41a3c27
BLAKE2b-256 checksum
How to use checksums
af3c6f42409e5d7e4d8e317b18d15086c161720f1446466e1ffb6ef6afe733ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pastas 2.0.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

2.0.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