Skip to content

Commit

Permalink
Some minor updates (#109)
Browse files Browse the repository at this point in the history
* ruff formatting

* format notebooks

* update nbs

* attempt adding level in toc for tutorials

* display inline math in notebooks

* ruff formatting

* format notebooks

* update nbs

* attempt adding level in toc for tutorials

* display inline math in notebooks

* up version

* update citation
  • Loading branch information
dbrakenhoff committed Feb 13, 2024
1 parent bf13dca commit 975a074
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 37 deletions.
2 changes: 1 addition & 1 deletion docs/00tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tutorials
TimML tutorials.

.. toctree::
:maxdepth: 3
:maxdepth: 2
:hidden:
:glob:

Expand Down
10 changes: 8 additions & 2 deletions docs/00tutorials/tutorial0_well_single_layer_aquifer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# TimML Tutorial 0\n",
"# TimML Tutorial 0"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Uniform flow to a well in a single layer"
]
},
Expand Down Expand Up @@ -225,7 +231,7 @@
" decimals=1, # print labels with 1 decimal place\n",
" legend=True, # add a legend\n",
" figsize=(5, 5), # specify a figure size of 5 by 5 inches\n",
");"
")"
]
},
{
Expand Down
20 changes: 13 additions & 7 deletions docs/00tutorials/tutorial1_well_multi_layer_aquifer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# TimML Tutorial 1\n",
"# TimML Tutorial 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Uniform flow to a well in a multi-aquifer system"
]
},
Expand Down Expand Up @@ -60,7 +66,7 @@
"outputs": [],
"source": [
"ml = tml.ModelMaq(\n",
" kaq=[10, 20, 5], # hydraulic conductivity, m/d \n",
" kaq=[10, 20, 5], # hydraulic conductivity, m/d\n",
" z=[0, -20, -40, -80, -90, -140], # tops and bottoms of aquifers, m\n",
" c=[4000, 10000], # resistance of leaky layers, d\n",
" npor=0.3, # porosity of the aquifers, one value so the same for all aquifers, -\n",
Expand All @@ -72,7 +78,7 @@
" Qw=10_000, # discharge of well, positive for extraction, m^3/d\n",
" rw=0.2, # well radius, m\n",
" layers=1, # layer numbere where well is screened (may also be a list)\n",
" label='well 1',\n",
" label=\"well 1\",\n",
")\n",
"tml.Constant(\n",
" model=ml, # model to which element is added\n",
Expand Down Expand Up @@ -125,7 +131,7 @@
"metadata": {},
"outputs": [],
"source": [
"print('leakage factors of model (m)')\n",
"print(\"leakage factors of model (m)\")\n",
"print(ml.aq.lab)"
]
},
Expand Down Expand Up @@ -153,7 +159,7 @@
"ml.contour(\n",
" win=[-3000, 3000, -3000, 3000], # window to contour [xmin, xmax, ymin, ymax]\n",
" ngr=50, # number of points where to compute the head\n",
" layers=[0, 1, 2], # layers to contour\n",
" layers=[0, 1, 2], # layers to contour\n",
" levels=10, # draw 10 contours in each layer\n",
" labels=True, # add labels along the contours\n",
" decimals=1, # print labels with 1 decimal place\n",
Expand All @@ -175,7 +181,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(f'The head at the well is: {w.headinside()} m')"
"print(f\"The head at the well is: {w.headinside()} m\")"
]
},
{
Expand Down Expand Up @@ -210,7 +216,7 @@
"source": [
"win = [-3000, 3000, -3000, 3000] # window that is plotted [xmin, xmax, ymin, ymax]\n",
"ml.plot(\n",
" win=win, \n",
" win=win,\n",
" orientation=\"both\", # plot both a plan view and a vertical cross-section\n",
" figsize=(5, 5), # specify a figure size of 5 by 5 inches\n",
")\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/03examples/normal_flux.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/03examples/timml_notebook3_3D_sol.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"source": [
"ml.contour(\n",
" win=[-200, 800, 0, 800], ngr=50, layers=[0, 1], levels=20, labels=1, decimals=2\n",
");"
")"
]
},
{
Expand All @@ -136,7 +136,7 @@
" levels=50,\n",
" labels=1,\n",
" decimals=2,\n",
");"
")"
]
},
{
Expand Down Expand Up @@ -273,7 +273,7 @@
"metadata": {},
"outputs": [],
"source": [
"ml.contour(win=[-200, 1000, 0, 1200], ngr=50, layers=[0, 1], levels=20);"
"ml.contour(win=[-200, 1000, 0, 1200], ngr=50, layers=[0, 1], levels=20)"
]
}
],
Expand Down
14 changes: 7 additions & 7 deletions docs/03examples/timml_notebook4_sol.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/06about/publications.bib
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ @article{bakker_analytic_2006
volume = {29},
doi = {10.1016/j.advwatres.2005.11.005},
abstract = {An analytic element approach is presented for the modeling of steady groundwater flow through multi-aquifer systems with piecewise constant aquifer and leaky layer properties. Different properties may be specified for domains bounded by closed polygons, referred to as polygonal inhomogeneities. The boundary of these inhomogeneities is modeled with two types of high-order line elements. First, a string of single-aquifer line-doublets is used; these elements cut through all aquifers and are valid both inside and outside the inhomogeneity. Second, two strings of multi-aquifer line-sinks are used, one string that is valid inside the inhomogeneity and one string that is valid outside; the comprehensive extraction of these line-sinks is zero at any point along the string. The proposed approach results in a comprehensive flow field of which the component normal to the boundary of the inhomogeneity is continuous across the boundary at any point. Within each individual aquifer, continuity of head and the component of flow normal to the boundary are met approximately across the boundary; the accuracy increases when the order of the line elements is increased and/or when shorter line elements are used. The proposed analytic element approach produces results that are virtually identical to the exact solution for a cylindrical inhomogeneity, and a high-resolution MODFLOW2000 model of two rectangular inhomogeneities with a shared boundary. The practical application of the approach is demonstrated through the solution of a problem with an irregularly shaped inhomogeneity with rivers crossing the inhomogeneity boundary.},
journal = {Advances in Water Resources - ADV WATER RESOUR},
journal = {Advances in Water Resources},
author = {Bakker, Mark},
month = oct,
year = {2006},
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
nb_execution_allow_errors = True # Allow errors in notebooks, to see the error online
nb_execution_mode = "auto"
nb_merge_streams = True
myst_enable_extensions = ["dollarmath", "amsmath"]
myst_dmath_double_inline = True

# -- bibtex options ------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions timml/aquifer.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def initialize(self):
dm1 = -1.0 / (self.c[1:] * self.T[:-1])
A = np.diag(dm1, -1) + np.diag(d0, 0) + np.diag(dp1, 1)
w, v = np.linalg.eig(A)
# take the real part for the rare occasion that the eig
# function returns a complex answer with very small
# take the real part for the rare occasion that the eig
# function returns a complex answer with very small
# imaginary part
w = w.real
v = v.real
Expand Down
6 changes: 3 additions & 3 deletions timml/stripareasink.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@


class StripAreaSinkInhom(Element):
"""Create a strip area-sink in combination with an inhomogeneity.
"""Create a strip area-sink in combination with an inhomogeneity.
Notes
-----
Created automatically using StripInhomMaq or StripInhom3D.
Created automatically using StripInhomMaq or StripInhom3D.
Can only be created if top boundary is confined.
Parameters
Expand Down
10 changes: 4 additions & 6 deletions timml/uflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@


class Uflow(Element):
"""Add uniform flow to the model.
Uniform flow may only be added to a model of which the background aquifer system
"""Add uniform flow to the model.
Uniform flow may only be added to a model of which the background aquifer system
is confined.
Parameters
Expand All @@ -28,9 +28,7 @@ class Uflow(Element):
"""

def __init__(self, model, slope, angle, label=None):
assert (
model.aq.ilap
), "TimML Error: Uflow can only be added to model with background confined aquifer"
assert model.aq.ilap, "TimML Error: Uflow can only be added to model with background confined aquifer"
self.storeinput(inspect.currentframe())
Element.__init__(
self, model, nparam=2, nunknowns=0, layers=0, name="Uflow", label=label
Expand Down
2 changes: 1 addition & 1 deletion timml/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "6.4.0"
__version__ = "6.4.1"

0 comments on commit 975a074

Please sign in to comment.