Skip to content
Open
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
44 changes: 36 additions & 8 deletions docs/steady/03xsections/cross_section_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"\n",
"ml.solve()\n",
"\n",
"ml.plots.xsection(xy=[(-100, 0), (100, 0)]);"
"ax = ml.plots.xsection(xy=[(-100, 0), (100, 0)])"
]
},
{
Expand Down Expand Up @@ -314,6 +314,41 @@
"ld1.plot(ax); # plot wall"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Plot velocity quiver near the wall."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"x = np.linspace(-5, 5, 30)\n",
"y = np.array([0])\n",
"z = np.array([[4.5, 3.5, 2.5, 1.5, 0.5]]).T\n",
"fig, ax = plt.subplots(1, 1, figsize=(10, 3))\n",
"ml.plots.xsection(xy=[(x[0], 0), (x[-1], 0)], horizontal_axis=\"x\", labels=False, ax=ax)\n",
"\n",
"npts = 31\n",
"ml.plots.tracelines(\n",
" -5 * np.ones(npts),\n",
" np.zeros(npts),\n",
" np.linspace(0, 5, npts),\n",
" ax=ax,\n",
" linewidth=1,\n",
" hstepmax=1.0,\n",
" vstepfrac=0.1,\n",
" orientation=\"ver\",\n",
" silent=True,\n",
")\n",
"ld1.plot(ax) # plot wall\n",
"ml.plots.quiver_z(x, y, z, ax=ax, normalize=True, scale=30, zorder=10);"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -506,13 +541,6 @@
"ml.solve()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
1 change: 0 additions & 1 deletion docs/transient/02examples/horizontal_well.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
" t=[10, 20],\n",
" layers=range(7),\n",
" parallel=True,\n",
" show_progress=True,\n",
")"
]
},
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Hydrology",
]
requires-python = ">=3.11"
dependencies = ["numpy", "scipy", "numba", "matplotlib", "pandas"]
dependencies = ["numpy", "scipy", "numba", "matplotlib", "pandas", "tqdm"]

[project.urls]
homepage = "https://github.com/timflow-org/timflow"
Expand All @@ -41,8 +41,8 @@ documentation = "https://timflow.readthedocs.io/en/latest/"

[project.optional-dependencies]
lint = ["ruff"]
parallel = ["tqdm"]
optional = ["timflow[parallel]", "lmfit"]
lmfit = ["lmfit"]
optional = ["timflow[lmfit]"]
ci = [
"timflow[lint,optional]",
"pytest",
Expand All @@ -61,7 +61,7 @@ docs = [
"myst_nb",
"sphinxcontrib-bibtex",
"sphinx-autoapi",
"jupyter-cache"
"jupyter-cache",
]
dev = ["timflow[docs]"]

Expand Down
17 changes: 11 additions & 6 deletions timflow/plots/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,15 +934,20 @@ def vcontour_array(
x = np.sqrt((x - x[0]) ** 2 + (y - y[0]) ** 2)
else:
raise ValueError("horizontal_axis must be 'x', 'y', or 's'")
# find aquifer for z coordinates
if self._ml.name == "ModelXsection":
aq = self._ml.aq.find_aquifer_data(x[0], y[0]) # use aquifer at first coord
else:
aq = self._ml.aq
if vinterp:
z = 0.5 * (self._ml.aq.zaqbot + self._ml.aq.zaqtop)
z = np.hstack((self._ml.aq.zaqtop[0], z, self._ml.aq.zaqbot[-1]))
z = 0.5 * (aq.zaqbot + aq.zaqtop)
z = np.hstack((aq.zaqtop[0], z, aq.zaqbot[-1]))
arr = np.vstack((arr[0], arr, arr[-1]))
else:
z = np.empty(2 * self._ml.aq.naq)
for i in range(self._ml.aq.naq):
z[2 * i] = self._ml.aq.zaqtop[i]
z[2 * i + 1] = self._ml.aq.zaqbot[i]
z = np.empty(2 * aq.naq)
for i in range(aq.naq):
z[2 * i] = aq.zaqtop[i]
z[2 * i + 1] = aq.zaqbot[i]
arr = np.repeat(arr, 2, 0)
if ax is None:
_, ax = plt.subplots(figsize=figsize)
Expand Down
4 changes: 2 additions & 2 deletions timflow/steady/inhomogeneity1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def plot(
x1 = kwargs.pop("x1")
if np.isfinite(self.x1):
x1 = max(x1, self.x1)
else:
elif not np.isfinite(x1):
x1 = self.x2 - 100.0
elif np.isfinite(self.x1):
x1 = self.x1
Expand All @@ -197,7 +197,7 @@ def plot(
x2 = kwargs.pop("x2")
if np.isfinite(self.x2):
x2 = min(x2, self.x2)
else:
elif not np.isfinite(x2):
x2 = self.x1 + 100.0
elif np.isfinite(self.x2):
x2 = self.x2
Expand Down
Loading