Skip to content

Commit

Permalink
Update master to Pastas 1.1.0 (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulcollenteur committed May 12, 2023
2 parents 7302511 + a7b11cc commit 5424a28
Show file tree
Hide file tree
Showing 77 changed files with 72,318 additions and 649 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/auto-author-assign.yml
@@ -0,0 +1,15 @@
# .github/workflows/auto-author-assign.yml
name: Auto Author Assign

on:
pull_request_target:
types: [opened, reopened]

permissions:
pull-requests: write

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v1.6.2
35 changes: 7 additions & 28 deletions .github/workflows/ci.yml
@@ -1,8 +1,6 @@
name: pastas
name: CI

on:
# Trigger the workflow on push or pull request on master,
# and also on dev branch
push:
branches:
- master
Expand All @@ -29,15 +27,18 @@ jobs:
- name: Test suite with py310-ubuntu
python: "3.10"
toxenv: py310
- name: Test suite with py311-ubuntu
python: "3.11"
toxenv: py311
- name: Formatting with black + isort
python: "3.9"
toxenv: format
- name: Linting with flake8
python: "3.9"
toxenv: lint
- name: Test suite for Jupyter Notebooks
- name: Test suite for all unit tests including Notebooks
python: "3.9"
toxenv: notebooks
toxenv: all
env:
# Color Output
# Rich (pip)
Expand Down Expand Up @@ -68,30 +69,8 @@ jobs:
- name: Test
run: tox -e ${{ matrix.toxenv }} --skip-pkg-install

- name: Store coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage.xml
if-no-files-found: ignore

coverage:
name: Coverage
runs-on: ubuntu-latest
needs: test
steps:
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
check-latest: true

- name: Get coverage
uses: actions/download-artifact@v3
with:
name: coverage

- name: Run codacy-coverage-reporter
if: ${{ github.repository == 'pastas/pastas' && success() }}
if: ${{ matrix.toxenv == 'all' && github.repository == 'pastas/pastas' && success() }}
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/test_benchmark_notebooks.yml
@@ -0,0 +1,47 @@
name: CI NB

on:
pull_request:
branches:
- master

jobs:
test:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: Test suite for benchmark Notebooks
python: "3.9"
toxenv: notebooks
env:
# Color Output
# Rich (pip)
FORCE_COLOR: 1
# Tox
PY_COLORS: 1
# Pytest
PYTEST_ADDOPTS: "--color=yes"
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
check-latest: true
cache: "pip"
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Setup tox environment
run: tox -e ${{ matrix.toxenv }} --notest

- name: Test
run: tox -e ${{ matrix.toxenv }} --skip-pkg-install
3 changes: 2 additions & 1 deletion README.rst
Expand Up @@ -52,7 +52,7 @@ Get in Touch

Quick installation guide
~~~~~~~~~~~~~~~~~~~~~~~~
To install Pastas, a working version of Python 3.8, 3.9 or 3.10 has to be
To install Pastas, a working version of Python 3.8, 3.9, 3.10, 3.11 has to be
installed on your computer. We recommend using the `Anaconda Distribution
<https://www.continuum.io/downloads>`_ as it includes most of the python
package dependencies and the Jupyter Notebook software to run the notebooks.
Expand All @@ -79,6 +79,7 @@ To get the latest development version, use::
Related packages
~~~~~~~~~~~~~~~~
- `Pastastore <https://github.com/pastas/pastastore>`_ is a Python package for managing multiple timeseries and pastas models
- `Metran <https://github.com/pastas/metran>`_ is a Python package to perform multivariate timeseries analysis using a technique called dynamic factor modelling.
- `Hydropandas <https://github.com/ArtesiaWater/hydropandas/blob/master/examples/03_hydropandas_and_pastas.ipynb>`_ can be used to obtain Dutch timeseries (KNMI, Dinoloket, ..)
- `PyEt <https://github.com/phydrus/pyet>`_ can be used to compute potential evaporation from meteorological variables.

Expand Down
36 changes: 0 additions & 36 deletions doc/about/01_history.rst

This file was deleted.

File renamed without changes.
9 changes: 4 additions & 5 deletions doc/about/04_onsite_course.rst → doc/about/courses.rst
@@ -1,10 +1,9 @@
On-site-courses
===============
Courses
=======

Every now and then on-site Pastas courses are held. Please check the `GitHub Discussion <https://github
Every now and then (on-site) Pastas courses and workshops are held. Please check the `GitHub Discussion <https://github
.com/pastas/pastas/discussions>`_ page for announcements of any public Pastas courses to be held. We can also provide
private courses on request. To organize such a workshop please contact of the following.
private courses on request. To organize such a workshop please contact one of the following:

- For courses in the Netherlands, please contact Artesia (info[AT]artesia-water.nl)
- For international courses, please contact Raoul Collenteur (Raoul.Collenteur[AT]eawag.ch)

47 changes: 47 additions & 0 deletions doc/about/history.rst
@@ -0,0 +1,47 @@
History
=======

The Development of Pastas started in the spring of 2016 at the TU Delft and
Artesia in the Netherlands. Researchers at the TU Delft required a flexible
framework that could support future research on time series analysis of
groundwater data. Consulting company `Artesia <https://www.artesia-water.nl>`_
on the other hand, needed a tool that allowed them to perform more complex
analyses in a scripted environment. As such, Pastas was developed under a
fruitful partnership between academia and private industry, a collaboration
that continues to this day.

.. figure:: ./../_static/history_initial.jpg
:figwidth: 600px

Drawing the initial design of Pastas on a whiteboard (5th of April, 2016)

Python was chosen as the programming language for Pastas, being a flexible and
open-source language that allows for quick prototyping. Moreover, many if not
most hydrologists learn Python during their education, making the software
available to many. From the start, all code was made completely open-source
under MIT license, embracing open science and FAIR (Findability, Accessibility,
Interoperability, and Reuse) data practices.

International use of Pastas and research grew substantially after the
publication of the Pastas article in the international journal Groundwater
:cite:p:`collenteur_pastas_2019`. In addition, the University of Graz in
Austria and now the Swiss research institute Eawag employed one of the
maintainers, further pushing the international use and development of Pastas.
Since its inception, Pastas has been applied in over a dozen countries
worldwide. Supporting international research continues to be an important goal
of Pastas. For a list of peer-reviewed publications using Pastas please see the
:doc:`Publications page <publications>`.

Pastas 1.0
----------

In february 2023, Pastas version 1.0 was released, the celebration of 7 years
of research and development of Pastas. Pastas was already operational for a
couple of years, but the a lot of features were still changing. In Pastas 1.0
focus lies on Pastas main goal: time series analysis on groundwater levels.
This was done by improving the documentation, removing unused features,
unifying the API and relying more on high quality Python packages such as
Pandas, NumPy and Numba. With version 1.0, Pastas is ready for further future
developments!


11 changes: 8 additions & 3 deletions doc/about/index.rst
Expand Up @@ -19,7 +19,12 @@ and their real-world applications.

.. toctree::
:hidden:
:maxdepth: 4
:glob:
:maxdepth: 1

./*
history
team
related
citing
courses
publications
references
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions doc/about/related.rst
@@ -0,0 +1,38 @@
Related Packages
================

Pastas has grown in to a full `GitHub organisation
<https://github.com/pastas>`_ with many useful tools to complement and improve
the time series analysis experience. Important packages are:

PastaStore
----------

`PastaStore <https://github.com/pastas/pastastore>`_ is a module that stores
Pastas time series and models in a database. Storing time series and models in
a database allows the user to manage time series and Pastas models on disk,
which allows the user to pick up where they left off without having to reload
everything. Additionally, PastaStore has a lot of tools to plot time series
(spatially).

Metran
------

While Pastas can only do univariate time series analysis, `Metran
<https://github.com/pastas/metran>`_ can perform multivariate timeseries
analysis using a technique called dynamic factor modelling. It can be used to
describe the variation among many variables in terms of a few underlying but
unobserved variables called factors.

Others
------

There are also related packages which are not part of the Pastas organisation
but depend on Pastas or can be of interest for users for their time series
analysis workflow:

* `traval <https://github.com/ArtesiaWater/traval>`_ for applying automatic error detection schemes to timeseries
* `pyet <https://github.com/pyet-org/pyet>`_ for estimating potential/reference evaporation
* `hydropandas <https://github.com/ArtesiaWater/traval>`_ for (automatically) loading observation data and time series from Dutch datasets
* `SPEI <https://github.com/martinvonk/spei>`_ for calculating drought indices for time series such as the SPI, SPEI and SGI

File renamed without changes.
120 changes: 44 additions & 76 deletions doc/benchmarks/autocorrelation.ipynb

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions doc/benchmarks/check_response_functions.ipynb

Large diffs are not rendered by default.

123 changes: 79 additions & 44 deletions doc/benchmarks/noisemodel.ipynb

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions doc/conf.py
Expand Up @@ -91,6 +91,14 @@
"github_url": "https://github.com/pastas/pastas",
"use_edit_page_button": True,
"header_links_before_dropdown": 6,
"icon_links": [
{
"name": "GitHub", # Label for this link
"url": "https://github.com/pastas/pastas", # required
"icon": "fab fa-github-square",
"type": "fontawesome", # Default is fontawesome
}
],
}

html_context = {
Expand Down
6 changes: 4 additions & 2 deletions doc/developers/index.rst
Expand Up @@ -8,10 +8,12 @@ serves to document code conventions and quick how-to's for maintainers and devel

.. toctree::
:maxdepth: 1
:glob:
:hidden:

./*
code_style
contributing
new_release
roadmap

Bug reports / Feature requests
------------------------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -262,7 +262,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:41:22) [MSC v.1929 64 bit (AMD64)]"
"version": "3.9.15"
},
"vscode": {
"interpreter": {
Expand Down
Expand Up @@ -65,7 +65,7 @@
" .loc[\"1985\":\"2003\"]\n",
")\n",
"\n",
"ps.plots.series(head, [evap, rain]);"
"ps.plots.series(head, [evap, rain], table=True);"
]
},
{
Expand Down Expand Up @@ -152,7 +152,7 @@
"axes = ml.plots.results(\n",
" tmin=\"1975\", figsize=(10, 6)\n",
") # Use tmin=1975 to show warmup period\n",
"axes[0].axvline(\"1986\", c=\"k\", linestyle=\"--\"); # Start of calibration"
"axes[0].axvline(pd.Timestamp(\"1986\"), c=\"k\", linestyle=\"--\"); # Start of calibration"
]
},
{
Expand Down Expand Up @@ -271,7 +271,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:41:22) [MSC v.1929 64 bit (AMD64)]"
"version": "3.9.15"
},
"vscode": {
"interpreter": {
Expand Down
Expand Up @@ -278,7 +278,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "artesia",
"display_name": "pastas_dev",
"language": "python",
"name": "python3"
},
Expand All @@ -292,11 +292,11 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.9.15"
},
"vscode": {
"interpreter": {
"hash": "dace5e1b41a98a8e52d2a8eebc3b981caf2c12e7a76736ebfb89a489e3b62e79"
"hash": "29475f8be425919747d373d827cb41e481e140756dd3c75aa328bf3399a0138e"
}
}
},
Expand Down

0 comments on commit 5424a28

Please sign in to comment.