Skip to content

Commit

Permalink
move to autoapi for docs
Browse files Browse the repository at this point in the history
ruff format/check
  • Loading branch information
dbrakenhoff committed Sep 26, 2024
1 parent 2a09ca9 commit 8b99ddd
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 26 deletions.
6 changes: 4 additions & 2 deletions docs/03examples/line-sink-ditch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"ml = ttim.ModelMaq(kaq=10, z=[10, 0], Saq=1e-4, tmin=0.01, tmax=10)\n",
"x = np.linspace(-100, 100, 21)\n",
"y = np.zeros(len(x))\n",
"lsd = ttim.LineSinkDitchString(ml, xy=list(zip(x, y)), tsandQ=[(0, 100)])\n",
"lsd = ttim.LineSinkDitchString(ml, xy=list(zip(x, y, strict=False)), tsandQ=[(0, 100)])\n",
"ml.solve()"
]
},
Expand Down Expand Up @@ -114,7 +114,9 @@
"ml = ttim.ModelMaq(kaq=10, z=[10, 0], Saq=1e-4, tmin=0.01, tmax=10)\n",
"x = np.linspace(-100, 100, 21)\n",
"y = np.zeros(len(x))\n",
"lsd = ttim.LineSinkDitchString(ml, xy=list(zip(x, y)), tsandQ=[(0, 100)], Astorage=100)\n",
"lsd = ttim.LineSinkDitchString(\n",
" ml, xy=list(zip(x, y, strict=False)), tsandQ=[(0, 100)], Astorage=100\n",
")\n",
"ml.solve()"
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/03examples/line_sink_well_sol.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"yls = [-500, -300, -200, -100, -50, 0, 50, 100, 200, 300, 500]\n",
"xls = 50 * np.ones(len(yls))\n",
"ls1 = ttim.HeadLineSinkString(\n",
" ml, list(zip(xls, yls)), tsandh=\"fixed\", layers=0, label=\"river\"\n",
" ml, list(zip(xls, yls, strict=False)), tsandh=\"fixed\", layers=0, label=\"river\"\n",
")\n",
"ml.solve()\n",
"ml.xsection(x1=-200, x2=200, npoints=100, t=100, layers=[0, 1, 2], sstart=-200)"
Expand Down Expand Up @@ -227,7 +227,7 @@
"yls = [-500, -300, -200, -100, -50, 0, 50, 100, 200, 300, 500]\n",
"xls = 50 * np.ones(len(yls))\n",
"ls1 = ttim.HeadLineSinkString(\n",
" ml, list(zip(xls, yls)), tsandh=\"fixed\", layers=0, label=\"river\"\n",
" ml, list(zip(xls, yls, strict=False)), tsandh=\"fixed\", layers=0, label=\"river\"\n",
")\n",
"ml.solve()\n",
"\n",
Expand Down
8 changes: 6 additions & 2 deletions docs/03examples/well_near_river_or_wall.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
" w = ttim.Well(ml2, 0, 0, rw=0.3, tsandQ=[(0, 1000)])\n",
" yls = np.arange(ystart, -ystart + 1, 20)\n",
" xls = 50 * np.ones(len(yls))\n",
" lss = ttim.HeadLineSinkString(ml2, xy=list(zip(xls, yls)), tsandh=\"fixed\")\n",
" lss = ttim.HeadLineSinkString(\n",
" ml2, xy=list(zip(xls, yls, strict=False)), tsandh=\"fixed\"\n",
" )\n",
" ml2.solve()\n",
" h2 = ml2.head(20, 0, t)\n",
" plt.plot(t, h2[0], \"--\", label=f\"line-sink string from {ystart} to {-ystart}\")\n",
Expand Down Expand Up @@ -199,7 +201,9 @@
" w = ttim.Well(ml2, 0, 0, rw=0.3, tsandQ=[(0, 1000)])\n",
" yls = np.arange(ystart, -ystart + 1, 20)\n",
" xls = 50 * np.ones(len(yls))\n",
" lss = ttim.LeakyLineDoubletString(ml2, xy=list(zip(xls, yls)), res=\"imp\")\n",
" lss = ttim.LeakyLineDoubletString(\n",
" ml2, xy=list(zip(xls, yls, strict=False)), res=\"imp\"\n",
" )\n",
" ml2.solve()\n",
" h2 = ml2.head(20, 0, t)\n",
" plt.plot(t, h2[0], \"--\", label=f\"line-doublet string from {ystart} to {-ystart}\")\n",
Expand Down
4 changes: 3 additions & 1 deletion docs/04pumpingtests/confined1_oude_korendijk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,9 @@
"]\n",
"\n",
"# Looping through all calibration objects and fetching the desired values\n",
"for calib, w_sto, obs_dts in zip([ca1, ca2, ca, ca3, ca4, ca0], w_storage, obs_dataset):\n",
"for calib, w_sto, obs_dts in zip(\n",
" [ca1, ca2, ca, ca3, ca4, ca0], w_storage, obs_dataset, strict=False\n",
"):\n",
" p = (\n",
" calib.parameters\n",
" ) # Accessing the parameters Dataframe inside the Calibrate object\n",
Expand Down
15 changes: 10 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"autoapi.extension",
# "sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.doctest",
# "sphinx.ext.intersphinx",
Expand Down Expand Up @@ -77,18 +78,22 @@

autodoc_typehints = "description"
autodoc_typehints_format = "short"
# autosummary_generate = True
# autoclass_content = "class"
autosectionlabel_prefix_document = True

autosummary_generate = True

autoclass_content = "class"
# -- AutoAPI settings -----------------------------------------------------------------

autosectionlabel_prefix_document = True
autoapi_dirs = ["../ttim"]
autoapi_root = "05api"

# -- Numpydoc settings ----------------------------------------------------------------

numpydoc_class_members_toctree = True
numpydoc_show_class_members = False

# -- Intersphinx settings -------------------------------------------------------------

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/devdocs", None),
Expand Down
4 changes: 2 additions & 2 deletions examples/linesinkex.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
f2py=False,
)
ls1 = ttim.HeadLineSinkString(
ml1, list(zip(xls, yls)), tsandh=[(0, 2)], layers=0, label="river"
ml1, list(zip(xls, yls, strict=False)), tsandh=[(0, 2)], layers=0, label="river"
)
ml1.solve()

Expand All @@ -35,7 +35,7 @@
f2py=True,
)
ls2 = ttim.HeadLineSinkString(
ml2, list(zip(xls, yls)), tsandh=[(0, 2)], layers=0, label="river"
ml2, list(zip(xls, yls, strict=False)), tsandh=[(0, 2)], layers=0, label="river"
)
ml2.solve()

Expand Down
14 changes: 4 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,8 @@ maintainers = [
{ name = "Mark Bakker", email = "[email protected]" },
{ name = "Davíd Brakenhoff", email = "[email protected]" },
]
requires-python = ">= 3.8"
dependencies = [
"numpy>=1.17",
"scipy>=1.5",
"numba>=0.5",
"matplotlib>=3.1",
"lmfit>=1.0",
"pandas>=1.1",
]
requires-python = ">= 3.10"
dependencies = ["numpy", "scipy", "numba", "matplotlib", "lmfit", "pandas"]

keywords = ["hydrology", "groundwater", "model", "analytic element method"]
classifiers = [
Expand Down Expand Up @@ -54,12 +47,13 @@ documentation = "http://mbakker7.github.io/ttim/docs/builddocs/html/index.html"
ci = ["pytest>=4.6", "pytest-cov", "jupyter>=1.0.0", "shapely", "flake8", "coveralls"]
docs = [
"ttim[ci]",
"sphinx>=3.1, <6.0",
"sphinx",
"sphinx-design",
"pydata-sphinx-theme",
"numpydoc",
"myst_nb",
"sphinxcontrib-bibtex",
"sphinx-autoapi",
]

[tool.setuptools]
Expand Down
2 changes: 1 addition & 1 deletion ttim/linedoublet.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def __init__(
self.model.addelement(self)

def __repr__(self):
return self.name + " with nodes " + str(zip(self.x, self.y))
return self.name + " with nodes " + str(zip(self.x, self.y, strict=False))

def initialize(self):
for ld in self.ldlist:
Expand Down
2 changes: 1 addition & 1 deletion ttim/linesink.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def __init__(
self.lslist = []

def __repr__(self):
return self.name + " with nodes " + str(zip(self.x, self.y))
return self.name + " with nodes " + str(zip(self.x, self.y, strict=False))

def initialize(self):
self.ncp = self.nls
Expand Down

0 comments on commit 8b99ddd

Please sign in to comment.