Skip to content

Add integral model solutions #13

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

Merged
merged 17 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 28 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,33 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
# needed by coveralls
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
source_check:
name: source check
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --editable .[check]
pip install --editable .[check,test]
pip install "coveralls>=3.0.0"

- name: black check
run: |
python -m black --check --diff --color .

- name: black preview
run: |
python -m black --preview --diff --color .

- name: isort check
run: |
python -m isort --check --diff --color .
Expand All @@ -48,53 +47,60 @@ jobs:
run: |
python -m pylint src/anaflow/

- name: coveralls check
run: |
python -m pytest --cov anaflow --cov-report term-missing -v tests/
python -m coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_sdist:
name: sdist on ${{ matrix.os }} with py ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build coveralls>=3.0.0
pip install build
pip install --editable .[test]

- name: Run tests
run: |
python -m pytest --cov anaflow --cov-report term-missing -v tests/
python -m coveralls --service=github

- name: Build sdist
run: |
python -m build

- uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
with:
path: dist
name: dist
path: dist/*

upload_to_pypi:
needs: [build_sdist]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: artifact
name: dist
path: dist

- name: Publish to Test PyPI
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/source/sg_execution_times.rst

# PyBuilder
target/
Expand Down
8 changes: 6 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/source/conf.py

formats: all
formats: [pdf]

python:
version: 3.7
install:
- method: pip
path: .
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All notable changes to **AnaFlow** will be documented in this file.

## [1.2.0] - 2025-05

See [#12](https://github.com/GeoStat-Framework/AnaFlow/pull/12)

### Enhancements
- added solutions based on the effective transmissivity for the ["Integral" variogram model](https://geostat-framework.readthedocs.io/projects/gstools/en/v1.7.0/api/gstools.covmodel.Integral.html):
- `ext_thiem_int`: steady state solution
- `ext_thiem_int_3d`: steady state solution incorporating vertical anisotropy
- `ext_theis_int`: transient solution
- `ext_theis_int_3d`: transient solution incorporating vertical anisotropy
- added `fix_T_well` and `fix_K_well` bool flag to transient heterogeneous solutions to be able to set if the well value for the effective transmissivity/conductivity should be determined from the limit (`True`) or from the upscaled value in the first ring segment (`False`, default)
- **breaking**: the previous behavior was effectively this set to `True`, which for steep effective curves resulted in an increasing error in the effective head near the well

### Changes
- updated docs (use myst parser for markdown files, only generate html and pdf)
- updated CI (fixed artifacts up-/download action, see #14)
- use hatchling as build backend


## [1.1.0] - 2023-04

Expand Down Expand Up @@ -88,6 +106,7 @@ Containing:
- lap_transgwflow_cyl - Solution for a diskmodel in laplace inversion


[1.2.0]: https://github.com/GeoStat-Framework/AnaFlow/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/GeoStat-Framework/AnaFlow/compare/v1.0.1...v1.1.0
[1.0.1]: https://github.com/GeoStat-Framework/AnaFlow/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/GeoStat-Framework/AnaFlow/compare/v0.4.0...v1.0.0
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

3 changes: 2 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.. mdinclude:: ../../CHANGELOG.md
.. include:: ../../CHANGELOG.md
:parser: myst_parser.docutils_
12 changes: 8 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def setup(app):
"sphinx.ext.napoleon", # parameters look better than with numpydoc only
"numpydoc",
"sphinx_gallery.gen_gallery",
"m2r2",
"myst_parser",
]

# autosummaries from source-files
Expand Down Expand Up @@ -87,8 +87,12 @@ def setup(app):

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"
# source_suffix = ".rst"

# The master toctree document.
# --> this is the sitemap (or content-list in latex -> needs a heading)
Expand Down Expand Up @@ -141,7 +145,7 @@ def setup(app):
# 'canonical_url': '',
# 'analytics_id': '',
"logo_only": False,
"display_version": True,
"version_selector": True,
"prev_next_buttons_location": "top",
# 'style_external_links': False,
# 'vcs_pageview_mode': '',
Expand Down Expand Up @@ -267,7 +271,7 @@ def setup(app):
# Remove the "Download all examples" button from the top level gallery
"download_all_examples": False,
# Sort gallery example by file name instead of number of lines (default)
"within_subsection_order": FileNameSortKey,
"within_subsection_order": "FileNameSortKey",
# directory where function granular galleries are stored
"backreferences_dir": None,
# Modules for which function level galleries are created. In
Expand Down
1 change: 1 addition & 0 deletions examples/01_call_theis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

Reference: `Theis 1935 <https://doi.org/10.1029/TR016i002p00519>`__
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down
9 changes: 3 additions & 6 deletions examples/02_call_ext_theis2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

Reference: `Zech et. al. 2016 <http://dx.doi.org/10.1002/2015WR018509>`__
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down Expand Up @@ -51,12 +52,8 @@
label_TG = "Theis($T_G$)" if i == 0 else None
label_TH = "Theis($T_H$)" if i == 0 else None
label_ef = "extended Theis" if i == 0 else None
plt.plot(
rad, head_TG[i], label=label_TG, color="C" + str(i), linestyle="--"
)
plt.plot(
rad, head_TH[i], label=label_TH, color="C" + str(i), linestyle=":"
)
plt.plot(rad, head_TG[i], label=label_TG, color="C" + str(i), linestyle="--")
plt.plot(rad, head_TH[i], label=label_TH, color="C" + str(i), linestyle=":")
plt.plot(rad, head_ef[i], label=label_ef, color="C" + str(i))
time_ticks.append(head_ef[i][-1])

Expand Down
9 changes: 3 additions & 6 deletions examples/03_call_ext_theis3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

Reference: `Müller 2015 <http://dx.doi.org/10.13140/RG.2.2.34074.24002>`__
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down Expand Up @@ -59,12 +60,8 @@
label_TG = "Theis($K_{efu}$)" if i == 0 else None
label_TH = "Theis($K_H$)" if i == 0 else None
label_ef = "extended Theis 3D" if i == 0 else None
plt.plot(
rad, head_Kefu[i], label=label_TG, color="C" + str(i), linestyle="--"
)
plt.plot(
rad, head_KH[i], label=label_TH, color="C" + str(i), linestyle=":"
)
plt.plot(rad, head_Kefu[i], label=label_TG, color="C" + str(i), linestyle="--")
plt.plot(rad, head_KH[i], label=label_TH, color="C" + str(i), linestyle=":")
plt.plot(rad, head_ef[i], label=label_ef, color="C" + str(i))
time_ticks.append(head_ef[i][-1])

Expand Down
9 changes: 3 additions & 6 deletions examples/04_call_ext_theis_tpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

Reference: (not yet published)
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down Expand Up @@ -62,12 +63,8 @@
label_TG = "Theis($K_G$)" if i == 0 else None
label_TH = "Theis($K_H$)" if i == 0 else None
label_ef = "extended Theis TPL 2D" if i == 0 else None
plt.plot(
rad, head_KG[i], label=label_TG, color="C" + str(i), linestyle="--"
)
plt.plot(
rad, head_KH[i], label=label_TH, color="C" + str(i), linestyle=":"
)
plt.plot(rad, head_KG[i], label=label_TG, color="C" + str(i), linestyle="--")
plt.plot(rad, head_KH[i], label=label_TH, color="C" + str(i), linestyle=":")
plt.plot(rad, head_ef[i], label=label_ef, color="C" + str(i))
time_ticks.append(head_ef[i][-1])

Expand Down
9 changes: 3 additions & 6 deletions examples/05_call_neuman2004.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

Reference: `Neuman 2004 <https://doi.org/10.1029/2003WR002405>`__
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down Expand Up @@ -61,12 +62,8 @@
label_TG = "Theis($T_G$)" if i == 0 else None
label_TH = "Theis($T_H$)" if i == 0 else None
label_ef = "transient Neuman [2004]" if i == 0 else None
plt.plot(
rad, head_TG[i], label=label_TG, color="C" + str(i), linestyle="--"
)
plt.plot(
rad, head_TH[i], label=label_TH, color="C" + str(i), linestyle=":"
)
plt.plot(rad, head_TG[i], label=label_TG, color="C" + str(i), linestyle="--")
plt.plot(rad, head_TH[i], label=label_TH, color="C" + str(i), linestyle=":")
plt.plot(rad, head_ef[i], label=label_ef, color="C" + str(i))
time_ticks.append(head_ef[i][-1])

Expand Down
1 change: 1 addition & 0 deletions examples/06_compare_extthiem2d_grfsteady.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- `Schneider & Attinger 2008 <https://doi.org/10.1029/2007WR005898>`__
- `Zech & Attinger 2016 <https://doi.org/10.5194/hess-20-1655-2016>`__
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions examples/07_compare_extthiem3d_grfsteady.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

Reference: `Zech et. al. 2012 <https://doi.org/10.1029/2012WR011852>`__
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions examples/08_compare_extthiem2d_neuman.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `Neuman 2004 <https://doi.org/10.1029/2003WR002405>`__
- `Zech & Attinger 2016 <https://doi.org/10.5194/hess-20-1655-2016>`__
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down
5 changes: 2 additions & 3 deletions examples/09_compare_exttheis2d_neuman.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `Neuman 2004 <https://doi.org/10.1029/2003WR002405>`__
- `Zech et. al. 2016 <http://dx.doi.org/10.1002/2015WR018509>`__
"""

import numpy as np
from matplotlib import pyplot as plt

Expand Down Expand Up @@ -40,9 +41,7 @@
plt.plot(rad, head2[i], label=label2, color="C" + str(i), linestyle="--")
time_ticks.append(head1[i][-1])

plt.title(
"$T_G={}$, $\sigma^2={}$, $\ell={}$, $S={}$".format(TG, var, len_scale, S)
)
plt.title(r"$T_G={}$, $\sigma^2={}$, $\ell={}$, $S={}$".format(TG, var, len_scale, S))
plt.xlabel("r in [m]")
plt.ylabel("h in [m]")
plt.legend()
Expand Down
5 changes: 2 additions & 3 deletions examples/10_convergence_ext_theis_tpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

Reference: (not yet published)
"""

import numpy as np
from matplotlib import pyplot as plt

Expand All @@ -25,9 +26,7 @@
S = 1e-4 # storativity
rate = -1e-4 # pumping rate

head1 = ext_thiem_tpl(
rad, r_ref, KG, len_scale, hurst, var, dim=dim, rate=rate
)
head1 = ext_thiem_tpl(rad, r_ref, KG, len_scale, hurst, var, dim=dim, rate=rate)
head2 = ext_theis_tpl(
time, rad, S, KG, len_scale, hurst, var, dim=dim, rate=rate, r_bound=r_ref
)
Expand Down
Loading