Skip to content

Commit 022cb9b

Browse files
authored
Merge pull request #127 from timflow-org/dev
Release v0.3.0
2 parents 32b3071 + c0d9b5e commit 022cb9b

81 files changed

Lines changed: 9703 additions & 2806 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.readthedocs.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ sphinx:
2020

2121
python:
2222
install:
23-
- method: pip
24-
path: .
25-
extra_requirements:
26-
- docs
23+
- method: uv
24+
command: sync
25+
extras: ["docs"]

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
6-
SPHINXOPTS ?=
6+
SPHINXOPTS ?= -j auto
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
99
BUILDDIR = _build

docs/_templates/autoapi/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ API Reference
22
=============
33

44
This section contains the Documentation of the Application Programming Interface (API)
5-
of Pastas. The information in this section is automatically created from the
5+
of timflow. The information in this section is automatically created from the
66
documentation strings in original Python code. In the left-hand menu you will find the
77
different categories of the API documentation.
88

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{% if obj.display %}
2+
{% if is_own_page %}
3+
{{ obj.short_name }}
4+
{{ "=" * obj.short_name | length }}
5+
6+
{% endif %}
7+
{% set visible_children = obj.children|selectattr("display")|list %}
8+
{% set own_page_children = visible_children|selectattr("type", "in", own_page_types)|list %}
9+
{% if is_own_page and own_page_children %}
10+
.. toctree::
11+
:hidden:
12+
13+
{% for child in own_page_children %}
14+
{{ child.include_path }}
15+
{% endfor %}
16+
17+
{% endif %}
18+
.. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}{% if obj.type_params %}[{{ obj.type_params }}]{% endif %}{% if obj.args %}({{ obj.args }}){% endif %}
19+
20+
{% for (args, return_annotation) in obj.overloads %}
21+
{{ " " * (obj.type | length) }} {{ obj.short_name }}{% if args %}({{ args }}){% endif %}
22+
23+
{% endfor %}
24+
{% if obj.bases %}
25+
{% if "show-inheritance" in autoapi_options %}
26+
27+
Bases: {% for base in obj.bases %}{{ base|link_objs }}{% if not loop.last %}, {% endif %}{% endfor %}
28+
{% endif %}
29+
30+
31+
{% if "show-inheritance-diagram" in autoapi_options and obj.bases != ["object"] %}
32+
.. autoapi-inheritance-diagram:: {{ obj.obj["full_name"] }}
33+
:parts: 1
34+
{% if "private-members" in autoapi_options %}
35+
:private-bases:
36+
{% endif %}
37+
38+
{% endif %}
39+
{% endif %}
40+
{% if obj.docstring %}
41+
42+
{{ obj.docstring|indent(3) }}
43+
{% endif %}
44+
{% for obj_item in visible_children %}
45+
{% if obj_item.type not in own_page_types %}
46+
47+
{{ obj_item.render()|indent(3) }}
48+
{% endif %}
49+
{% endfor %}
50+
{% if is_own_page and own_page_children %}
51+
{% set visible_attributes = own_page_children|selectattr("type", "equalto", "attribute")|list %}
52+
{% if visible_attributes %}
53+
Attributes
54+
----------
55+
56+
.. autoapisummary::
57+
58+
{% for attribute in visible_attributes %}
59+
{{ attribute.id }}
60+
{% endfor %}
61+
62+
63+
{% endif %}
64+
{% set visible_exceptions = own_page_children|selectattr("type", "equalto", "exception")|list %}
65+
{% if visible_exceptions %}
66+
Exceptions
67+
----------
68+
69+
.. autoapisummary::
70+
71+
{% for exception in visible_exceptions %}
72+
{{ exception.id }}
73+
{% endfor %}
74+
75+
76+
{% endif %}
77+
{% set visible_classes = own_page_children|selectattr("type", "equalto", "class")|list %}
78+
{% if visible_classes %}
79+
Classes
80+
-------
81+
82+
.. autoapisummary::
83+
84+
{% for klass in visible_classes %}
85+
{{ klass.id }}
86+
{% endfor %}
87+
88+
89+
{% endif %}
90+
{% set visible_methods = own_page_children|selectattr("type", "equalto", "method")|list %}
91+
{% if visible_methods %}
92+
Methods
93+
-------
94+
95+
.. autoapisummary::
96+
97+
{% for method in visible_methods %}
98+
{{ method.id }}
99+
{% endfor %}
100+
101+
102+
{% endif %}
103+
{% endif %}
104+
{% endif %}

docs/conf.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
]
3232

3333
# templates_path = ["_templates"]
34-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
34+
exclude_patterns = ["_build", "_templates", "Thumbs.db", ".DS_Store"]
3535

3636
# -- Options for HTML output -------------------------------------------------
3737
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
@@ -79,8 +79,16 @@
7979
"inherited-members",
8080
"show-inheritance",
8181
]
82-
autoapi_own_page_level = "method"
82+
autoapi_own_page_level = "class"
8383
autoapi_template_dir = "_templates/autoapi"
84+
suppress_warnings = ["autoapi"]
85+
86+
# Keep API signatures and section navigation compact by omitting module prefixes
87+
# (e.g., show `River` instead of `timflow.steady.linesink.River`).
88+
add_module_names = False
89+
90+
# Keep local object TOC entries compact in the right sidebar.
91+
toc_object_entries_show_parents = "hide"
8492

8593
# -- Numpydoc settings ----------------------------------------------------------------
8694

@@ -99,31 +107,22 @@
99107

100108
# -- myst_nb options ------------------------------------------------------------------
101109

110+
nb_execution_mode = "cache"
111+
102112
nb_execution_allow_errors = True # Allow errors in notebooks, to see the error online
103-
nb_execution_mode = "auto"
104-
nb_merge_streams = True
113+
nb_execution_show_tb = True
114+
nb_execution_timeout = 100
105115
nb_execution_excludepatterns = [
106116
"besselnumba_timing.ipynb",
107117
"vertical_anisotropy.ipynb",
118+
"transient/04pumpingtests/*.ipynb",
108119
]
109120

110121
myst_enable_extensions = ["dollarmath", "amsmath", "html_image"]
111122
myst_dmath_double_inline = True
112-
nb_render_markdown_format = "myst" # Enable MyST markdown parsing in notebooks
113-
nb_render_text_lexer = "myst-ansi" # Better rendering of ANSI output
114-
# nb_mime_priority_overrides = {
115-
# "html": (
116-
# "application/vnd.jupyter.widget-view+json",
117-
# "application/javascript",
118-
# "text/html",
119-
# "image/svg+xml",
120-
# "image/png",
121-
# "image/jpeg",
122-
# "text/markdown",
123-
# "text/latex",
124-
# "text/plain",
125-
# )
126-
# }
123+
124+
nb_merge_streams = True
125+
127126

128127
# -- bibtex options ------------------------------------------------------------------
129128

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@ view the code documentation.
5454

5555
Steady <steady/index>
5656
Transient <transient/index>
57+
Utilities <utils/index>
5758
Code Reference <api/index>
59+
Timings <timings>
5860
Cite <about/index>

docs/steady/00userguide/tutorials/tutorial1_well_multi_layer_aquifer.ipynb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,6 @@
250250
" ax=axes,\n",
251251
")"
252252
]
253-
},
254-
{
255-
"cell_type": "code",
256-
"execution_count": null,
257-
"metadata": {},
258-
"outputs": [],
259-
"source": []
260253
}
261254
],
262255
"metadata": {

docs/steady/02examples/01_well_in_uniform_flow.ipynb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@
222222
"print(\"The discharge at the abandoned well is:\")\n",
223223
"print(wabandoned.discharge())"
224224
]
225+
},
226+
{
227+
"cell_type": "code",
228+
"execution_count": null,
229+
"metadata": {},
230+
"outputs": [],
231+
"source": []
225232
}
226233
],
227234
"metadata": {

docs/steady/03xsections/cross_section_models.ipynb

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@
124124
"outputs": [],
125125
"source": [
126126
"fig, ax = plt.subplots(1, 1, figsize=(10, 3))\n",
127-
"ml.plots.xsection(xy=[(-150, 0), (150, 0)], ax=ax, params=True);"
127+
"ml.plots.xsection(\n",
128+
" xy=[(-150, 0), (150, 0)], ax=ax, params=True, units={\"kaq\": \"m/d\", \"c\": \"d\"}\n",
129+
")"
128130
]
129131
},
130132
{
@@ -149,7 +151,9 @@
149151
"metadata": {},
150152
"outputs": [],
151153
"source": [
152-
"ml.plots.vcontoursf1D(x1=-200, x2=200, nx=100, levels=20, color=\"C0\", figsize=(10, 3));"
154+
"ml.plots.vcontour_stream_function(\n",
155+
" x1=-200, x2=200, nx=100, levels=20, color=\"C0\", figsize=(10, 3)\n",
156+
");"
153157
]
154158
},
155159
{
@@ -238,7 +242,9 @@
238242
"metadata": {},
239243
"outputs": [],
240244
"source": [
241-
"ml.plots.vcontoursf1D(x1=-200, x2=200, nx=100, levels=20, color=\"C0\", figsize=(10, 3));"
245+
"ml.plots.vcontour_stream_function(\n",
246+
" x1=-200, x2=200, nx=100, levels=20, color=\"C0\", figsize=(10, 3)\n",
247+
");"
242248
]
243249
},
244250
{
@@ -302,7 +308,7 @@
302308
"metadata": {},
303309
"outputs": [],
304310
"source": [
305-
"ax = ml.plots.vcontoursf1D(\n",
311+
"ax = ml.plots.vcontour_stream_function(\n",
306312
" x1=-200, x2=200, nx=100, levels=20, color=\"C0\", figsize=(10, 3), horizontal_axis=\"x\"\n",
307313
")\n",
308314
"ld1.plot(ax); # plot wall"
@@ -359,7 +365,9 @@
359365
"tfs.Constant(ml, 100, 0, 10)\n",
360366
"ml.solve()\n",
361367
"\n",
362-
"ml.plots.vcontoursf1D(x1=-100, x2=100, nx=100, levels=20, color=\"C0\", figsize=(10, 3));"
368+
"ml.plots.vcontour_stream_function(\n",
369+
" x1=-100, x2=100, nx=100, levels=20, color=\"C0\", figsize=(10, 3)\n",
370+
");"
363371
]
364372
},
365373
{
@@ -372,7 +380,7 @@
372380
"tfs.XsectionAreaSink(ml2, -50, 50, 0.001)\n",
373381
"tfs.Constant(ml2, -100, 0, 10)\n",
374382
"ml2.solve()\n",
375-
"ml2.plots.vcontoursf1D(\n",
383+
"ml2.plots.vcontour_stream_function(\n",
376384
" x1=-100, x2=100, nx=100, levels=20, color=\"C0\", figsize=(10, 3), horizontal_axis=\"x\"\n",
377385
");"
378386
]
@@ -419,7 +427,9 @@
419427
"\n",
420428
"ml.solve()\n",
421429
"\n",
422-
"ml.plots.vcontoursf1D(x1=-20, x2=20, nx=100, levels=20, color=\"C0\", figsize=(10, 3));"
430+
"ml.plots.vcontour_stream_function(\n",
431+
" x1=-20, x2=20, nx=100, levels=20, color=\"C0\", figsize=(10, 3)\n",
432+
");"
423433
]
424434
},
425435
{
@@ -448,7 +458,9 @@
448458
"\n",
449459
"ml.solve()\n",
450460
"\n",
451-
"ml.plots.vcontoursf1D(x1=-20, x2=20, nx=100, levels=20, color=\"C0\", figsize=(10, 3));"
461+
"ml.plots.vcontour_stream_function(\n",
462+
" x1=-20, x2=20, nx=100, levels=20, color=\"C0\", figsize=(10, 3)\n",
463+
");"
452464
]
453465
},
454466
{
@@ -499,9 +511,7 @@
499511
"execution_count": null,
500512
"metadata": {},
501513
"outputs": [],
502-
"source": [
503-
"from timflow.steady.linesink1d import FluxDiffLineSink1D, HeadDiffLineSink1D"
504-
]
514+
"source": []
505515
},
506516
{
507517
"cell_type": "code",
@@ -512,8 +522,8 @@
512522
"ml = tfs.ModelMaq(kaq=[10], z=[0, -10], topboundary=\"conf\")\n",
513523
"ls = tfs.River1D(ml, xls=0, hls=1, wh=\"H\", layers=0)\n",
514524
"ls = tfs.River1D(ml, xls=200, hls=0, wh=\"H\", layers=0)\n",
515-
"hd = HeadDiffLineSink1D(ml, xls=100)\n",
516-
"fd = FluxDiffLineSink1D(ml, xls=100)\n",
525+
"hd = tfs.linesink1d.HeadDiffLineSink1D(ml, xls=100)\n",
526+
"fd = tfs.linesink1d.FluxDiffLineSink1D(ml, xls=100)\n",
517527
"ml.solve()\n",
518528
"\n",
519529
"x = np.linspace(0, 200, 101)\n",
@@ -526,9 +536,21 @@
526536
],
527537
"metadata": {
528538
"kernelspec": {
529-
"display_name": "Python 3",
539+
"display_name": "timflow (3.13.11)",
530540
"language": "python",
531541
"name": "python3"
542+
},
543+
"language_info": {
544+
"codemirror_mode": {
545+
"name": "ipython",
546+
"version": 3
547+
},
548+
"file_extension": ".py",
549+
"mimetype": "text/x-python",
550+
"name": "python",
551+
"nbconvert_exporter": "python",
552+
"pygments_lexer": "ipython3",
553+
"version": "3.13.11"
532554
}
533555
},
534556
"nbformat": 4,

docs/steady/04benchmarks/test_linesink_discharge.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"source": [
3737
"ml1 = tfs.ModelMaq(kaq=20)\n",
3838
"rf1 = tfs.Constant(ml1, xr=0, yr=20, hr=30)\n",
39-
"ls1 = tfs.LineSinkBase(ml1, x1=-10, y1=-10, x2=10, y2=10, Qls=1000)\n",
39+
"ls1 = tfs.linesink.LineSinkBase(ml1, x1=-10, y1=-10, x2=10, y2=10, Qls=1000)\n",
4040
"ml1.solve()"
4141
]
4242
},

0 commit comments

Comments
 (0)