Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update master to Pastas 1.1.0 #595

Merged
merged 62 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
19d2fd1
Update types.py
martinvonk Feb 15, 2023
311def6
Update example_uncertainty.py
martinvonk Feb 15, 2023
3eac98a
fix tests
dbrakenhoff Feb 17, 2023
205faa9
support linear trends in modelcompare
dbrakenhoff Feb 17, 2023
25eeb8b
codacy fixes for timer.py
dbrakenhoff Feb 17, 2023
4cc49df
isort
dbrakenhoff Feb 17, 2023
51f8282
fix notebooks pd Timestamp errors
martinvonk Feb 17, 2023
10522d3
add tmin/tmax fix to ps.plots.series()
dbrakenhoff Feb 17, 2023
b109880
Update plots.py
martinvonk Feb 19, 2023
a37e95c
Fix datetime axes with pandas.Timestamp and some other improvements (…
dbrakenhoff Feb 20, 2023
7cbb7f5
Squashed commit of the following:
martinvonk Feb 20, 2023
231bb1b
Merge remote-tracking branch 'origin/dev' into 541-enhancement-add-op…
martinvonk Feb 20, 2023
307da88
Merge remote-tracking branch 'origin/dev' into martinvonk-patch-1
martinvonk Feb 20, 2023
d1ad118
make sure option is tested in a notebook
martinvonk Feb 20, 2023
219cad0
Update plots.py
martinvonk Feb 20, 2023
4c76d63
fix old types while we're at it
martinvonk Feb 20, 2023
8240ef4
fix old types while we're at it
martinvonk Feb 20, 2023
0222fa3
Update metrics.py
martinvonk Feb 20, 2023
c803c73
Merge branch 'martinvonk-patch-1' of https://github.com/pastas/pastas…
martinvonk Feb 20, 2023
96de513
add stats summary check
dbrakenhoff Feb 20, 2023
ef8f88a
Make table in pastas.plots.series() optional (#561)
dbrakenhoff Feb 20, 2023
29ef2f9
Update types.py to support Matplotlib <v3.4 (#553)
dbrakenhoff Feb 20, 2023
cf48f09
Improve documentation (#560)
martinvonk Feb 21, 2023
ea6797e
Fix issue #564
rubencalje Feb 23, 2023
15228e0
create and upload codacy coverage report from notebooks toxenv
martinvonk Feb 27, 2023
7e97c3f
Create auto-author-assign.yml
martinvonk Feb 27, 2023
47870d3
Improve modeling with non-daily timesteps (#556)
dbrakenhoff Feb 28, 2023
665f1d1
ignore some flake8 errors
martinvonk Mar 21, 2023
a01df01
fix ref
martinvonk Mar 21, 2023
072b6f0
Codacy coverage upload, auto-assign pr and flake8 update (#566)
dbrakenhoff Mar 21, 2023
1379345
add fill/bfill timeseries settings options (#558)
dbrakenhoff Mar 21, 2023
5668eb7
improve WellModel
dbrakenhoff Mar 21, 2023
30d019f
forgot to commit nb update
dbrakenhoff Mar 21, 2023
b5c972b
fix nb
dbrakenhoff Mar 21, 2023
ed56bcf
parse metadata passed to WellModel
dbrakenhoff Mar 22, 2023
d2a1cf1
write wrapper around pandas resample function
martinvonk Mar 24, 2023
36c2af4
clarify preprocessing time series notebook and add extra example
martinvonk Mar 24, 2023
caeea3b
update docstring resample function
martinvonk Mar 27, 2023
d54baae
update docstring of pandas_equidistant_nearest
martinvonk Mar 27, 2023
d3dfca6
remove .copy() from resample function
martinvonk Mar 27, 2023
45909de
Add (Pandas) resample wrapper function to timeseries_utils (#581)
dbrakenhoff Mar 27, 2023
4ad5053
fix reading/writing for datetime objects
dbrakenhoff Mar 27, 2023
7a9e44c
Pas datetime fixes for pastastore (#582)
dbrakenhoff Mar 27, 2023
179f95f
update type hint of add_stressmodel
martinvonk Mar 29, 2023
0f56c8f
move pytest fixture to conftest.py
martinvonk Mar 29, 2023
bc34829
rename notebooks toxenv to all
martinvonk Mar 29, 2023
ea3bfa5
test benchmark notebooks during pull requests to master
martinvonk Mar 29, 2023
de33c79
change .yml workflow name:
martinvonk Mar 29, 2023
5c74d9c
fix step response in wrong plot
martinvonk Mar 29, 2023
330a808
Update testing routine with fixtures and benchmark notebooks test (#583)
dbrakenhoff Apr 12, 2023
9261a90
fix #571 warnings tracksolve (#579)
dbrakenhoff May 3, 2023
285a58f
Support Python 3.11 (#588)
martinvonk May 3, 2023
1ac2182
fix #549 stderr formatting (#580)
dbrakenhoff May 3, 2023
fa77a86
fix #575 duplicate columns in plots.compare() (#576)
dbrakenhoff May 3, 2023
b1cfc4c
improve WellModel (#570)
dbrakenhoff May 4, 2023
aac3f9d
fix #551: `up` and `gain_scale_factor` are set by StressModel (#573)
dbrakenhoff May 4, 2023
0408850
add fix to wellmodel
dbrakenhoff May 4, 2023
bfab4c5
black
dbrakenhoff May 4, 2023
1938128
add fix to wellmodel (#589)
dbrakenhoff May 5, 2023
b5ccbd5
fix #577 improve validate_series (#578)
dbrakenhoff May 11, 2023
c4f4c2d
Merge main into dev (#596)
dbrakenhoff May 11, 2023
a7b11cc
review release changes (#597)
dbrakenhoff May 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/auto-author-assign.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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.
7 changes: 3 additions & 4 deletions doc/about/04_onsite_course.rst → doc/about/courses.rst
Original file line number Diff line number Diff line change
@@ -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.

- 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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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.
77 changes: 31 additions & 46 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.

102 changes: 69 additions & 33 deletions doc/benchmarks/noisemodel.ipynb

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading