From 82bc347355885ecca91b9ea63f502c2e3f829012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dav=C3=ADd=20Brakenhoff?= Date: Wed, 25 Sep 2024 16:39:17 +0200 Subject: [PATCH] more ruff after merge --- examples/timml_notebook0_sol.py | 4 ---- .../workshop_nhv/vlaketunnel_functions.py | 1 - tests/test_import.py | 2 +- tests/test_notebooks.py | 2 +- timml/__init__.py | 23 ++++++++++--------- timml/bessel.py | 1 + timml/inhomogeneity.py | 1 + timml/model.py | 1 + 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/examples/timml_notebook0_sol.py b/examples/timml_notebook0_sol.py index d4e8f407..8d4a5bb3 100644 --- a/examples/timml_notebook0_sol.py +++ b/examples/timml_notebook0_sol.py @@ -57,7 +57,6 @@ ) - # The default contour levels are not what we want for this example, so let's # specify the levels to go from 39 to 42 with steps of 0.1 (not all those levels # are present in the current window). @@ -83,7 +82,6 @@ # In[8]: - w = timml.Well(ml, xw=-400, yw=0, Qw=50.0, rw=0.2) # After the well is added (or any other elements), the model needs to be solved again. A contour plot is created and a 10 strace line are added. The stepsize is given in meters and represents the largest space step that is taken, but it is reduced when certain accuracy constraints are not met. Note that, after running the code cell below, for each trace line it is printed to the screen what the reason was that the traceline was aborted. In this case it was either because the trace line reached a well or reached the maximum number of steps (the default is 100 steps, but this can be changed by specifying the `nstepmax` keyword). @@ -162,14 +160,12 @@ ) - # ### Capture zone # Create a five year capture zone. You may want to create a contour plot first. # In[14]: - ml.contour(-1000, 100, 50, -500, 500, 50, levels=np.arange(39, 42, 0.1), layers=0) w.plotcapzone(hstepmax=20, nt=20, zstart=0, tmax=5 * 365.25, color="b") diff --git a/examples/workshop_nhv/vlaketunnel_functions.py b/examples/workshop_nhv/vlaketunnel_functions.py index dd0a1dea..cd1edda2 100644 --- a/examples/workshop_nhv/vlaketunnel_functions.py +++ b/examples/workshop_nhv/vlaketunnel_functions.py @@ -91,7 +91,6 @@ def create_model( c_channel = ml.aq.c.copy() c_channel[0] = c_channel_bot - # channel_0: tml.PolygonInhomMaq( kaq=ml.aq.kaq, diff --git a/tests/test_import.py b/tests/test_import.py index 07e3e633..dbc7b771 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -1,5 +1,5 @@ def test_import(): - pass + import timml print(timml.__version__) diff --git a/tests/test_notebooks.py b/tests/test_notebooks.py index f9e00f2f..a34deb77 100644 --- a/tests/test_notebooks.py +++ b/tests/test_notebooks.py @@ -45,7 +45,7 @@ def get_jupyter_kernel(): return kernel -@pytest.mark.notebooks() +@pytest.mark.notebooks @pytest.mark.parametrize("pth", get_notebooks()) def test_notebook(pth): kernel = get_jupyter_kernel() diff --git a/timml/__init__.py b/timml/__init__.py index a4ebb408..f4912010 100644 --- a/timml/__init__.py +++ b/timml/__init__.py @@ -13,17 +13,6 @@ __name__ = "timml" __author__ = "Mark Bakker" # Import all classes and functions -from . import bessel -from .circareasink import CircAreaSink -from .constant import Constant, ConstantStar -from .inhomogeneity import ( - BuildingPit3D, - BuildingPitMaq, - LeakyBuildingPit3D, - LeakyBuildingPitMaq, - PolygonInhom3D, - PolygonInhomMaq, -) from timml.inhomogeneity1d import StripInhom3D, StripInhomMaq from timml.linedoublet import ( ImpLineDoublet, @@ -49,6 +38,18 @@ from timml.version import __version__ from timml.well import HeadWell, LargeDiameterWell, Well, WellBase +from . import bessel +from .circareasink import CircAreaSink +from .constant import Constant, ConstantStar +from .inhomogeneity import ( + BuildingPit3D, + BuildingPitMaq, + LeakyBuildingPit3D, + LeakyBuildingPitMaq, + PolygonInhom3D, + PolygonInhomMaq, +) + __all__ = [ "CircAreaSink", "Constant", diff --git a/timml/bessel.py b/timml/bessel.py index 1daab442..edee4165 100644 --- a/timml/bessel.py +++ b/timml/bessel.py @@ -13,6 +13,7 @@ def set_bessel_method(method="numba"): warn( "Cannot import compiled fortran bessel module! Defaulting to numba!", category=ImportWarning, + stacklevel=1, ) bessel = import_module("timml.besselaesnumba.besselaesnumba") elif method == "numba": diff --git a/timml/inhomogeneity.py b/timml/inhomogeneity.py index d6ce83ed..fdf8915b 100644 --- a/timml/inhomogeneity.py +++ b/timml/inhomogeneity.py @@ -767,6 +767,7 @@ def __init__( f"Found resistances smaller than {self.tiny}, " f"these were replaced by {self.tiny}.", category=UserWarning, + stacklevel=1, ) self.res[self.res < self.tiny] = self.tiny diff --git a/timml/model.py b/timml/model.py index a56ab636..9190c5dc 100644 --- a/timml/model.py +++ b/timml/model.py @@ -675,6 +675,7 @@ def __init__( hstar=0, ): """Model3D. + for semi-confined aquifers, set top equal to 'semi' and provide topres: resistance of top tophick: thickness of top